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.16.tar.gz (42.6 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.16-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mangopi_cli-0.1.16.tar.gz
  • Upload date:
  • Size: 42.6 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.16.tar.gz
Algorithm Hash digest
SHA256 4815d4d5cce58a2292ece08ff11b1f26d406ff0b56d7df4f8781687a87cda007
MD5 399ee8827b60af7fd23cc82ee5906b15
BLAKE2b-256 eac51976235188f509b5610e323d1b614fb885d2798a1c47e1f025980e95eb92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mangopi_cli-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 25.3 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.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2d914ac06931a9feba84e4a5a5b42da582cdce9285afc06385d20a08ae7ed453
MD5 7bf4040f05aa8d21de59efacaeca1356
BLAKE2b-256 d613f7a1acbd036cdfdef3dd7b074d6ed72a555a3ac3f7eaf845701ed4379a33

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