Skip to main content

Mango Pi Cli

Project description

Mangopi CLI

A lightweight, zero-dependency AI coding assistant running directly in your terminal.

Mangopi CLI is a local-first AI coding assistant inspired by tools like Claude Code, designed for developers who want a fast, hackable, and minimal runtime experience.

It provides an agentic coding workflow with:

  • file editing
  • shell execution
  • tool calling
  • autonomous goal execution
  • context-aware conversation management
  • automatic context compacting

All with instant startup and no heavyweight framework dependencies.


Features

  • Zero dependency (Python standard library only)
  • Instant startup speed
  • Claude Code–style terminal UX
  • OpenAI-compatible API support
  • Built-in file and shell tools
  • Autonomous Goal Mode
  • Automatic context compacting
  • Persistent local sessions
  • Skill system support (SKILL.md)
  • Safe shell execution checks
  • Fully hackable and easy to extend
  • Large-context optimized architecture

Installation

From PyPI

pip install mangopi-cli

Start Mangopi CLI:

mangopi-cli

From Source

git clone git@github.com:w4n9H/mangopi-cli.git
cd mangopi-cli
python mangopi_cli.py

Configuration

Required:

export MANGO_KEY="your_api_key"

Recommended:

export MANGO_API_URL="https://api.deepseek.com"
export MANGO_MODEL="deepseek-v4-flash"

Optional:

export MANGO_MAX_CONTEXT=1000000
export MANGO_LANG=zh

Supported Providers

Mangopi CLI supports:

  • DeepSeek
  • OpenAI-compatible APIs
  • MiniMax
  • Custom compatible endpoints

Example:

export MANGO_API_URL="https://api.openai.com/v1"
export MANGO_MODEL="gpt-4o-mini"

Usage

Start the CLI:

mangopi-cli

or:

python mangopi_cli.py

Built-in Commands

Command Description
/q Quit
/n Start a new session
/c Compact current session
/h Show help
/g <goal> Autonomous goal execution mode

Goal Mode

Goal Mode allows Mangopi CLI to autonomously:

  • plan
  • execute
  • verify
  • iterate

until the objective is fully completed.

Example:

/g build a fastapi todo app with tests

The agent will continue working until it determines the task is complete.


Built-in Tools

Tool Description
read Read files
write Write or overwrite files
edit Replace exact strings in files
search Search files using glob patterns
grep Regex search through project files
bash Execute shell commands
use_skill Load installed skills
attempt_completion Finish the current task

Mangopi CLI can autonomously inspect files, modify code, search projects, and execute shell commands.


Skill System

Mangopi CLI supports reusable workflow skills.

Example structure:

~/.mangocli/skills/python_backend/

├── SKILL.md
├── scripts/
└── references/

Example SKILL.md:

---
description: Python backend workflow
tags: ["python", "backend"]
---

Use pytest for tests.
Prefer small functions.

The model can automatically discover and load relevant skills during execution.


Session Persistence

Sessions are stored locally:

.mangocli/session/session.json

Mangopi CLI automatically:

  • restores previous sessions
  • preserves important context
  • compacts old conversations
  • manages long-running workflows

Context Compacting

Mangopi CLI includes multiple compacting strategies:

  • micro compact
  • session memory compact
  • conversation compact
  • full LLM summary compact

This enables extremely long-running coding sessions while staying within model context limits.


Safety

Dangerous shell commands require confirmation before execution.

Examples include:

  • rm -rf
  • mkfs
  • chmod 777
  • sudo rm
  • destructive system operations

Architecture

Core components:

Component Responsibility
Printer Terminal UI rendering
ContextManager Conversation memory & compacting
ToolBase Tool framework
Provider API abstraction layer
SystemPrompt Runtime prompt assembly
SkillManager Skill discovery & loading

Philosophy

Mangopi CLI focuses on:

  • fast startup
  • zero dependency
  • local-first workflows
  • terminal-native AI interaction
  • lightweight runtime design
  • simplicity over abstraction
  • hackability over frameworks

No Electron. No Docker. No Redis. No heavyweight AI frameworks.

Just a fast and hackable AI coding assistant for the terminal.


License

Apache License 2.0


Author

Created by moofs.

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_cli-0.1.18.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

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

mangopi_cli-0.1.18-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file mangopi_cli-0.1.18.tar.gz.

File metadata

  • Download URL: mangopi_cli-0.1.18.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mangopi_cli-0.1.18.tar.gz
Algorithm Hash digest
SHA256 f341abce8b16eafc41e10f48cd2938b41eea8fe0cd05d2ff128aeedce77f7373
MD5 c511e0daab4a21746b0e50d30df70a6d
BLAKE2b-256 95d923a6b5ddb2705436f308475725a8feab5b2260088ae9ec8a8647d42b7151

See more details on using hashes here.

File details

Details for the file mangopi_cli-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: mangopi_cli-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mangopi_cli-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 4104ea96e2b69a775af65dc89410463e71d384490b2aeb17ce1ae456c65a1e44
MD5 08c3ca8145b9a43675dec340d2fac728
BLAKE2b-256 43ee43efe144997b62c734b13344e28cca9974646d74117ced27cb313de21ea2

See more details on using hashes here.

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