@moxxy/cli
v0.51.0
Published
moxxy command-line agent: TUI, one-shot prompts, setup, services, and API-key or installed-CLI subscription providers.
Downloads
3,413
Maintainers
Readme
What this package is
@moxxy/cli is the published moxxy binary. It bundles the framework runtime, every built-in mode, every built-in provider, every built-in plugin, the Ink TUI channel, MCP support, the scheduler, webhooks, and the OS service installer into a single executable.
Install this if you want to use moxxy. If you want to author plugins, depend on @moxxy/sdk instead.
What you get out of the box
- A complete agent stack with Anthropic, OpenAI, and ChatGPT (OAuth) providers.
- Three loop modes:
default(Claude-Code-style ReAct loop),goal(autonomous auto-approve loop), andresearch(parallel-subagent fan-out + synthesis). - Built-in tools: Read, Edit, Write, Bash, Grep, Glob, WebFetch, computer-control (macOS), and browser-session (Playwright, optional).
- Multi-channel by design: TUI, Telegram, HTTP, web, cron, and webhooks. One session can drive several surfaces at once.
- Voice input on any audio-capable channel through
@moxxy/plugin-stt-whisper. - An encrypted vault (AES-256-GCM at rest) so secrets in config are referenced as
${vault:KEY}and never written in plaintext. - A long-term memory subsystem with a journal and vector recall. TF-IDF ships built-in. Swap to OpenAI embeddings via
@moxxy/plugin-embeddings-openai. - A permission resolver that gates every tool call and learns allow-always rules per tool.
- Opt-in capability isolation. Tools declare what they need and an isolator enforces it.
inprocships built-in.worker,subprocess,wasm, and Docker isolators drop in behind the same interface. - A scheduler for cron expressions and one-shot ISO timestamps.
- A webhook listener with HMAC verification, header and JSON-path filters, and a
cloudflaredorngroktunnel helper. - An OS service installer for launchd (macOS) and systemd (Linux), or a single
serve --backgroundprocess that runs every channel together.
Installation
npm install -g @moxxy/cliOr run it without installing:
npx @moxxy/cli initRequirements: Node.js 20.19 or later. Use an API key for Anthropic/OpenAI, or reuse an authenticated Claude Code Pro/Max or Codex subscription as described below.
Claude Code (Pro/Max subscription, no API key)
- Install the official Claude CLI so
claudeis onPATH(or setCLAUDE_CODE_EXECUTABLE=/absolute/path/to/claude). - Run
claude auth loginormoxxy login claude-code, then confirm withclaude auth statusandmoxxy doctor. - Select "Claude Agent" (
claude-code) inmoxxy init. It defaults toclaude-sonnet-5-5; override per run with--model, or persistplugins.provider.items.claude-code.model.
Claude Code itself does each turn, through the Claude Agent SDK (installed into ~/.moxxy/agents/claude-agent-sdk on first use), with its own tools, skills, settings and MCP servers. Moxxy asks you before each of Claude's tools, with its permission rules applied, shows Claude's questions, and lends Claude its own tools over a local MCP server. Auto-approve shows how your Claude really runs from the moment a conversation starts (on when your Claude settings default to bypass permissions), and switches only the current conversation's Claude; once you turn it off, Claude starts asking even over that default. Claude's own settings are never edited. Claude also owns its login files—moxxy neither reads nor stores subscription credentials in its vault.
Desktop and interactive CLI setup can start sign-in. Headless runners/services generally cannot complete browser or TTY authentication: authenticate first as the same OS account that runs the service, make claude available in that account's service PATH (or set the executable path), and restart it. Recovery commands are claude auth status, claude auth login, moxxy login claude-code, and moxxy doctor.
Codex (ChatGPT sign-in, no API key)
- Install the Codex CLI so
codexis onPATH(or setCODEX_EXECUTABLE=/absolute/path/to/codex). - Run
codex loginormoxxy login codex-agent, then confirm withcodex login statusandmoxxy doctor. - Select "ChatGPT — Codex agent" (
codex-agent) inmoxxy init. A new conversation starts ongpt-6-lunaby default. Choose a model per run with--modelor save a default inplugins.provider.items.codex-agent.model.
Codex itself does each turn through codex app-server, with its own instructions, config, tools, skills and MCP servers. Moxxy shows Codex's approvals and questions, shows its plan in plan mode, ends goal mode when Codex's own goal is met, and lends Codex its own tools over a local MCP server. Auto-approve shows how your Codex really runs from the moment a conversation opens (Moxxy asks a short-lived codex app-server for the folder's config), gives only the current conversation's Codex full access, and stays as you set it; ~/.codex/config.toml is never edited. Your reason for declining reaches Codex, fast mode runs it on its fast tier, and Stop interrupts its turn, tools included.
OpenCode (your own OpenCode setup)
- Install OpenCode so
opencodeis onPATH(or setOPENCODE_EXECUTABLE=/absolute/path/to/opencode). - Its free models work without signing in; for other providers run
opencode auth login(ormoxxy login opencode) in a terminal. - Select "OpenCode agent" (
opencode) inmoxxy init. Pick any modelopencode modelslists with--model, or persistplugins.provider.items.opencode.model.
OpenCode itself does each turn through opencode acp, with its own instructions, config, tools, skills, permission rules and MCP servers. Moxxy shows what it does and its permission asks; auto-approve shows how OpenCode really runs from the moment a conversation opens (on with OpenCode's defaults, which ask for nothing; turning it off restarts that OpenCode once with your rules made to ask, for that process only), steers plan and goal mode through tools it lends OpenCode over a local MCP server, and never edits OpenCode's config.
Keeping the agent CLIs up to date
Moxxy checks the three CLIs when the TUI, moxxy serve or the desktop starts and every hour after: whether each is installed, signed in, and as new as the vendor's latest release on npm. A CLI older than the oldest version Moxxy was checked against (Claude Code 2.1.296, Codex 0.155.1, OpenCode 1.19.0) must be updated before its connection is used. The TUI says so in one line above the prompt, the desktop above the message box and in Settings → Providers, and moxxy doctor lists it. moxxy agents install <agent> runs the vendor's installer (Claude claude.ai/install.sh, Codex chatgpt.com/codex/install.sh, OpenCode opencode.ai/v2/install; on Windows their PowerShell installers, and npm for OpenCode); moxxy agents update <agent> runs the agent's own update command, which knows how it was installed (for an OpenCode 1 when OpenCode 2 is out, opencode upgrade --major, which replaces it with OpenCode 2 the same way). Moxxy never updates a CLI by itself, and the desktop refuses to update one while a turn runs.
Two checks keep the connections honest as the vendors ship new CLIs:
pnpm test:agents:compat # no sign-in: each CLI's handshake and protocol (also daily on CI)
pnpm test:agents:live # real conversations with your own sign-ins
pnpm test:agents:live --agent codex # one agentThe live check drives moxxy serve the way the desktop does, on a throwaway Moxxy home with this repo's connection packages: a reply, a file change, a Moxxy tool, a follow-up that needs the earlier turn, Stop during a running command, and a restart that must resume the conversation. An agent that is not installed or not signed in is reported as not checked, never as passed; the report is saved under .live-reports/.
Quickstart
moxxy init # interactive: choose provider, paste API key (stored in the vault)
moxxy # launch the interactive TUIOne-shot from the command line:
moxxy -p "summarize the README in three bullets"Resume a previous conversation:
moxxy resumemoxxy --help lists every command. moxxy <command> --help shows per-command details.
Commands
The CLI groups commands the same way moxxy --help does.
Setup
| Command | What it does |
|---|---|
| moxxy init | Interactive first-time setup. Picks a provider, captures the key, writes it into the vault. |
| moxxy login <provider> | OAuth sign-in for providers that do not use API keys (for example codex-agent). |
| moxxy login status | Show stored OAuth credentials. |
| moxxy login logout <provider> | Remove stored OAuth credentials. |
| moxxy doctor | Diagnose your install: provider readiness, vault unlock, missing optional dependencies. |
| moxxy agents [status] | Where the Claude, Codex and OpenCode CLIs stand: installed version, the latest, what to do next (--json for scripts). |
| moxxy agents install\|update <agent> | Install the agent's CLI with the vendor's installer, or update it with its own command (claude update, codex update, opencode upgrade). |
Run
| Command | What it does |
|---|---|
| moxxy | Default. Starts the Ink TUI. |
| moxxy tui | Same as above, explicit. |
| moxxy -p "…" (or --prompt) | One-shot prompt to stdout. |
| moxxy resume [-s <id>] | Resume a persisted session. Interactive picker if no id. |
| moxxy <channel> | Start a registered channel by name. |
| moxxy channels | List registered channels and their subcommands. |
| moxxy serve | Start every channel together with the scheduler and webhooks in one process. |
When a runner is already serving the session, moxxy tui receives the selected conversation over its socket. The terminal opens after it has received the history in order. Other connected clients can continue working during this transfer.
Manage
| Command | What it does |
|---|---|
| moxxy sessions list and delete | Inspect or remove persisted sessions. |
| moxxy skills list, new, audit | Manage skill files across user, project, builtin, and plugin scopes. |
| moxxy plugins list, reload, new | Manage the plugin host. reload picks up newly installed packages. |
| moxxy mcp list, add, enable, disable, remove | Manage MCP servers in ~/.moxxy/mcp.json. |
| moxxy perms list, add, remove | Inspect or edit the persisted permission rules. |
| moxxy memory journal and recall | Read or query long-term memory. |
| moxxy schedule add, list, remove | Time-driven prompts (cron or one-shot ISO). |
| moxxy security audit, status, isolators | Inspect tool capability declarations and the active isolator. |
| moxxy service install, logs, status, uninstall | Background OS services (launchd or systemd). |
| moxxy self-update | Update bundled plugins, skills, and core safely. |
Flags
| Flag | What it does |
|---|---|
| --prompt, -p "…" | One-shot input. |
| --model <id> | Override the default model for this invocation. |
| --output-format <fmt> | text, json, or stream-json (one-shot output mode). |
| --cwd <path> | Set the agent's working directory. |
| --config <path> | Load a specific moxxy.config.ts. |
| --no-color | Disable ANSI colors. |
| -h, --help, -v, --version | Standard. |
Environment
| Variable | What it does |
|---|---|
| ANTHROPIC_API_KEY | Default Anthropic provider key. |
| OPENAI_API_KEY | OpenAI provider key (also used by the openai embeddings plugin). |
| MOXXY_VAULT_PASSPHRASE | Headless vault unlock when no OS keychain is available. |
| MOXXY_FIXTURES | record or replay. Provider fixture mode used by tests. |
Channels
Run your agent through whichever surface fits the task.
| Channel | What it does | Command |
|---|---|---|
| TUI | Grok-style interactive terminal UI. | moxxy |
| Telegram | Message the agent from anywhere. Voice notes get transcribed and run as turns. Pairs with a 6-digit code. | moxxy telegram |
| HTTP | POST /v1/turn (JSON, SSE streaming) and POST /v1/turn/audio (raw bytes, iOS Shortcut friendly), bearer-token auth. | moxxy channels http |
| Cron | Time-driven prompts. Cron expressions or one-shot ISO timestamps. | moxxy schedule add … |
| Webhooks | External systems fire prompts on signed POST. HMAC plus bearer plus filter rules. | moxxy serve (auto-starts the listener) |
Services
Two ways to keep moxxy online 24/7.
Per-channel units, one process each so failures stay independent:
moxxy service install telegram # launchd on macOS, systemd --user on Linux
moxxy service logs telegram # tail the logOr one process for everything, with a shared event log:
moxxy serve --background # every channel plus the scheduler plus webhooks
moxxy serve --background --except http # skip what you do not want
moxxy serve --status # is it running?Logs land in ~/.moxxy/services/<name>.log. The units survive reboots.
Configuration
moxxy.config.ts at your project root:
import { defineConfig } from '@moxxy/config';
export default defineConfig({
provider: {
name: 'anthropic',
model: 'claude-sonnet-5-5',
config: { apiKey: '${vault:ANTHROPIC_API_KEY}' }, // resolved from the vault
},
mode: 'default',
plugins: {
'@moxxy/plugin-browser': { enabled: false }, // disable a plugin (or use `moxxy plugins disable`)
},
});${vault:NAME} placeholders resolve on session start. The vault unlocks via OS keychain (keytar) with a passphrase fallback (MOXXY_VAULT_PASSPHRASE for headless boxes).
Docs
Full documentation lives at docs.moxxy.ai: concepts, recipes, plugin authoring, channel guides. The marketing site is at moxxy.ai.
Contributing
PRs welcome. The issue tracker and author guides live in the moxxy monorepo.
License
MIT. See the repository root for the full text.
