Skip to main content

Web UI for mangopi-cli — an AI-driven task automation pipeline with real-time streaming, SSE, and HTMX

Project description

mangopi-web

A real-time web UI for mangopi-cli, an AI-driven task automation pipeline. Built with FastAPI, HTMX, Alpine.js, and Server-Sent Events (SSE).

Manage, monitor, and interact with AI agent pipelines through a modern single-page application — no page reloads, no heavy JavaScript frameworks.


Features

  • Real-time streaming — Live task output pushed via SSE and rendered as HTML fragments
  • Multi-agent pipeline — Supports Research, Plan, Develop, Review, Test, and Push phases
  • Concurrent task management — Queue and run up to MAX_CONCURRENT tasks in parallel
  • SQLite persistence — Task state, events, and usage data stored locally
  • OOB (Out-of-Band) updates — HTMX-powered sidebar and status pills update automatically
  • Dark mode — Built-in theme toggle with system preference detection
  • Heatmap dashboard — Daily task activity for the last 12 weeks
  • Git integration — Workspace info and commit history at a glance
  • Mock mode — Run the UI against a simulated CLI for development and testing
  • Lightweight — Single Python file, zero-node frontend (HTMX + Alpine.js via CDN-free static files)

Screenshot

┌──────────────────────────────────────────────────────────────┐
│  Sidebar           │  Main Area (Phase View)                │
│  ┌────────────┐   │  ┌──────────────────────────────────┐  │
│  │ Task list   │   │  │ Pipeline progress                │  │
│  │ ● Task 1    │   │  │ Plan  ● Dev  ● Review  ● Test   │  │
│  │ ● Task 2    │   │  │                                  │  │
│  │ + New Task  │   │  │ [Event log - streaming output]   │  │
│  └────────────┘   │  └──────────────────────────────────┘  │
└──────────────────────────────────────────────────────────────┘

Installation

pip install mangopi-web

From source

git clone https://github.com/w4n9H/mangopi-web.git
cd mangopi-web
pip install -e .

Quick Start

1. Start the web server

mangopi-web

Opens at http://127.0.0.1:8080.

2. Create a task

Click New Task, enter a goal (e.g. "fix login bug"), choose an optional mode, and submit. The pipeline runs immediately and output streams into the phase view.

3. Modes

Mode Flag Pipeline
Normal (none) plan → develop → review → test
Fast --fast develop → test
Wish --wish research → plan → develop → review → test
Fast + Wish both research → develop → test
Push --push (append push to any of the above)

Configuration

All settings are controlled via environment variables:

Variable Default Description
MANGOPI_WEB_HOST 127.0.0.1 Bind address
MANGOPI_WEB_PORT 8080 Bind port
MANGOPI_WEB_DB ./.mangocli/web.db SQLite database path
MANGOPI_WEB_MODE (unset) Set to mock for mock CLI mode
MANGOPI_WEB_MAX_CONCURRENT 3 Max parallel tasks

Security note: Binding to 0.0.0.0 is blocked unless you use a reverse proxy. There is no authentication in v0.1.


Development

Project structure

mangopi-web/
├── mangopi_web.py              # Main application (single module)
├── mock/
│   └── fake_cli.py             # Mock CLI for testing without real API keys
├── static/
│   ├── alpine.min.js           # Alpine.js
│   ├── htmx.min.js             # HTMX
│   └── sse.js                  # SSE polyfill / client
├── templates/
│   ├── base.html               # Base layout with sidebar
│   ├── index.html              # SPA shell
│   └── partials/
│       ├── event_fragment.html  # Single event renderer
│       ├── phase_pipeline.html  # Pipeline step indicators
│       ├── pipeline_oob.html    # OOB status updates
│       ├── task_detail.html     # Full task detail page
│       ├── task_item.html       # Sidebar task card
│       ├── task_item_oob.html   # OOB card updates
│       ├── task_list.html       # Task list fragment
│       └── task_phase_view.html # Phase view + event log
├── pyproject.toml
└── README.md

Running in mock mode

MANGOPI_WEB_MODE=mock python mangopi_web.py
# or
python mangopi_web.py --mock

This uses mock/fake_cli.py instead of the real mangopi-cli, so no API keys are needed.

Live reload during development

pip install uvicorn[standard]
uvicorn mangopi_web:app --reload --port 8080

API Endpoints

Method Path Description
GET / SPA index page
GET /tasks Task list fragment (HTMX)
POST /tasks Create and start a new task
DELETE /tasks/{id} Delete a task and kill its process
GET /tasks/{id} Task detail / phase view
POST /tasks/{id}/advance OOB card updates (triggered by SSE)
GET /tasks/{id}/pipeline-oob Pipeline OOB status poll
GET /events/{id} SSE stream for live task events
GET /health Health check JSON
GET /api/heatmap Daily task count for last 12 weeks
GET /api/workspace Workspace path & git branch
GET /api/git/commits Recent git commit history

License

Apache License 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mangopi_web-0.1.2.tar.gz (76.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mangopi_web-0.1.2-py3-none-any.whl (79.4 kB view details)

Uploaded Python 3

File details

Details for the file mangopi_web-0.1.2.tar.gz.

File metadata

  • Download URL: mangopi_web-0.1.2.tar.gz
  • Upload date:
  • Size: 76.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mangopi_web-0.1.2.tar.gz
Algorithm Hash digest
SHA256 66ea1a62d8acd664618ba9c7f05a73955cea0ed3e12b4f62672e046a822a25b8
MD5 63162fdc23a78821bf5d3700dfc3cbc1
BLAKE2b-256 aeb0dbda5e6f4e999e37b5d870bf1fef989a0e27bfda2288c34faae08b7acf12

See more details on using hashes here.

Provenance

The following attestation bundles were made for mangopi_web-0.1.2.tar.gz:

Publisher: ci.yml on w4n9H/mangopi-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mangopi_web-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mangopi_web-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 79.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mangopi_web-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5473da954507f09db858c327c47ba04094f7ead9cb63bdacd7d7f90e1f11ac05
MD5 1dff97986ca2f1a95b2a9c41f57342c0
BLAKE2b-256 9e0364ce27396b1a63f1be6186b0485cb34c203b86725c687e631f185aeb8e82

See more details on using hashes here.

Provenance

The following attestation bundles were made for mangopi_web-0.1.2-py3-none-any.whl:

Publisher: ci.yml on w4n9H/mangopi-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page