AI coding agent toolkit in MoonBit. Ships the `pimbt` CLI with 7 LLM providers (OpenAI / Anthropic / Gemini / Mistral / Bedrock / Vertex / Azure), a unified streaming abstraction, an agent loop with tool calls and compaction, a session-tree coding agent with built-in tools, three CLI modes (interactive / print / RPC), and one-command NyxID integration for credential-brokered LLM access.
中文版:README.zh-CN.md
| Package | Status | Notes |
|---|---|---|
| lib/ai | ✅ complete | 7 LLM providers (OpenAI / Anthropic / Mistral / Gemini / Bedrock / Vertex / Azure), NyxID gateway, OAuth + PKCE primitives, env-api-keys, model registry, overflow detection |
| lib/tui | ✅ complete | Component trait, diff rendering, component library (Input / SelectList / Loader / Box / Container), Markdown rendering, fuzzy search, autocomplete, undo stack |
| lib/agent | ✅ complete | Agent engine: turn loop, three-phase tool execution, event system, steering / follow-up queues |
| lib/coding_agent | ✅ complete | Session tree, compaction, extension system, 6 built-in tools, slash commands, skills, HTML export, path / mime / git / frontmatter utilities |
| lib/cli (→ pimbt) | ✅ complete | 3 modes (Print / Interactive / RPC), multi-target (JS / Native / WASM), theme system, NyxID login + auto token refresh + providers management |
| lib/web_ui | ✅ complete | Web transcript, storage, 6 dialogs, 12 artifact types, tool renderers, IndexedDB backend interface |
| lib/mom | ✅ complete | Platform-neutral channel model, Slack adapter, event loop / timer / watcher / host driver |
| lib/pods | ✅ complete | PodRegistry, SSH/SCP command builders, vLLM deployment commands |
git clone https://github.com/eanzhao/pi-moonbit.git
cd pi-moonbit
./scripts/install.shPREFIX=/usr/local ./scripts/install.sh # system-wide install (may need sudo)
./scripts/install.sh --symlink # dev mode: symlink main.js so moon build updates it live
./scripts/install.sh --uninstall # remove pimbtpimbt --help
pimbt login # browser-based NyxID login
pimbt providers connect openai # paste an LLM API key
pimbt --api nyxid-gateway --model gpt-5.4 "hello"# 1. Browser-based login (no client_id needed — uses NyxID's CLI auth flow)
pimbt login
# 2. Self-check shows whether you have any providers configured. If not:
pimbt providers connect openai # prompts for your sk-... key
pimbt providers connect anthropic # or: --api-key sk-ant-... to skip the prompt
# 3. Easiest path: just run `pimbt` — it walks you through an interactive
# provider → model picker (arrow keys on TTY, real model IDs fetched
# live from each provider's /models endpoint).
pimbt
# 4. Or pass --model directly. NyxID routes by model id automatically.
pimbt --api nyxid-gateway --model gpt-5.4 "write a fib function"
pimbt --api nyxid-gateway --model claude-sonnet-4-5-20250929 "explain quicksort"
# Inspect what's connected / the gateway's prefix-routing rules:
pimbt providers list
pimbt modelsexport OPENAI_API_KEY=sk-...
pimbt --api openai-responses --model gpt-5.4 "hello"
export ANTHROPIC_API_KEY=sk-ant-...
pimbt --api anthropic-messages --model claude-sonnet-4-5 "hello"
export GOOGLE_API_KEY=...
pimbt --api google-generativeai --model gemini-2.0-flash "hello"
export MISTRAL_API_KEY=...
pimbt --api mistral-conversation --model mistral-large-latest "hello"moon check # type check
moon build # compile
moon test # run all tests
moon test lib/ai # run tests for one package
# Run the CLI without installing
moon run src/main --target js -- --helppi-moonbit/
├── moon.mod.json
├── docs/ # design docs, one per phase
├── lib/
│ ├── ai/ # Phase 01 — LLM provider abstraction
│ ├── tui/ # Phase 02 — terminal UI library
│ ├── agent/ # Phase 03 — agent loop engine
│ ├── coding_agent/ # Phase 04 — coding-agent core
│ ├── web_ui/ # Phase 06 — web UI support layer
│ ├── mom/ # Phase 07 — mom runtime
│ ├── pods/ # GPU pod management
│ └── cli/ # Phase 05 — pimbt CLI implementation
├── src/main/ # pimbt entry point (thin shell over lib/cli)
├── scripts/install.sh # local installer
└── pi-mono/ # original TypeScript reference (gitignored, read-only)AI coding agent toolkit in MoonBit. Ships the `pimbt` CLI with 7 LLM providers (OpenAI / Anthropic / Gemini / Mistral / Bedrock / Vertex / Azure), a unified streaming abstraction, an agent loop with tool calls and compaction, a session-tree coding agent with built-in tools, three CLI modes (interactive / print / RPC), and one-command NyxID integration for credential-brokered LLM access.