Skip to content

CLI Commands

Complete reference for the Moxxy CLI (@moxxy/cli).

Overview

The Moxxy CLI is a Node.js (22+) package built with TypeScript, @clack/prompts, and Ink 6.0 (React-based TUI). It manages the moxxy-gateway Rust binary and provides interactive setup workflows.

bash
npx @moxxy/cli <command> [options]
# or if installed globally:
moxxy <command> [options]

Global Options

OptionDescription
-h, --helpShow help information
--versionShow version information

Commands Reference

CommandDescription
initInteractive setup wizard
gatewayManage the gateway daemon
channelConfigure messaging channels

init

Run the interactive setup wizard to configure Moxxy for first use.

bash
moxxy init

What It Does

  1. Walks you through LLM provider selection (Anthropic, OpenAI, Ollama, or OpenAI-compatible)
  2. Prompts for the selected provider's API key
  3. Generates the first API token (bearer token with mox_ prefix)
  4. Optionally configures a Telegram channel
  5. Downloads the moxxy-gateway binary to ~/.moxxy/bin/ if not already present
  6. Initializes the SQLite database (~/.moxxy/moxxy.db)

Example

bash
$ moxxy init

  Welcome to moxxy!

  ? Select your LLM provider:
    > Anthropic (Claude)
      OpenAI
      Ollama
      OpenAI-compatible

  ? Enter your Anthropic API key: sk-ant-***

  Your first API token: mox_a1b2c3d4e5f6...

  ? Set up Telegram channel? (Y/n)

  Gateway binary downloaded to ~/.moxxy/bin/moxxy-gateway
  Configuration saved to ~/.moxxy/

  Run 'moxxy gateway start' to begin!

gateway

Manage the moxxy-gateway background daemon.

bash
moxxy gateway <subcommand>

Subcommands

SubcommandDescription
startStart the gateway daemon
stopStop the gateway daemon
restartRestart the gateway daemon
statusCheck gateway status

The CLI auto-downloads the moxxy-gateway Rust binary to ~/.moxxy/bin/ if it is not already present.

See Gateway for detailed documentation on the gateway architecture and startup sequence.

start

bash
moxxy gateway start

Starts the moxxy-gateway binary, which initializes the Axum HTTP server on port 3000 (default), opens the SQLite database, loads channel bridges, and begins processing.

stop

bash
moxxy gateway stop

Sends a graceful shutdown signal to the running gateway process.

restart

bash
moxxy gateway restart

Performs a stop followed by a start.

status

bash
moxxy gateway status

Shows whether the gateway is running, its PID, uptime, and connected channels.


channel

Configure messaging channel connections.

bash
moxxy channel <type> [options]

Available Channels

TypeDescription
telegramConfigure Telegram bot
discordConfigure Discord bot

Telegram

bash
moxxy channel telegram --agent <name>

Interactive setup that prompts for a bot token from @BotFather, then walks through the pairing code flow.

See Channels for detailed setup instructions.

Discord

bash
moxxy channel discord --agent <name>

Interactive setup that prompts for a Discord bot token. Requires Message Content Intent to be enabled.

See Channels for detailed setup instructions.


Environment Variables

Moxxy respects the following environment variables:

VariableDefaultDescription
MOXXY_HOME~/.moxxyRoot data directory
MOXXY_HOST127.0.0.1Gateway bind address
MOXXY_PORT3000Gateway listen port
MOXXY_API_URLhttp://127.0.0.1:3000Full API base URL
MOXXY_TOKEN-Bearer token for API authentication
MOXXY_LOOPBACK-Enable loopback mode (bypasses auth for localhost)
MOXXY_VAULT_KEY-Override vault encryption key
MOXXY_DB_PATH~/.moxxy/moxxy.dbSQLite database path
MOXXY_GATEWAY_URL-Gateway binary download URL override
MOXXY_CORS_ORIGINS-Allowed CORS origins (comma-separated)
ANTHROPIC_API_KEY-Anthropic API key
OPENAI_API_KEY-OpenAI API key

Exit Codes

CodeMeaning
0Success
1General error
2Configuration error
3Network error
4Authentication error

Open source · Self-hosted · Data sovereign