Guide
CLI
Run agents from the terminal with the MoiAgent command-line interface.
Install globally via npm
npm install -g moiagent-cliRequires Node.js 18+
Basic Usage
Execute an agent by providing the workspace, agent name, and message:
Terminal
$moi <workspace>/<agent> <message>
Quotes around the message are optional. Use them for messages with special characters or newlines.
moi acme/slack-notifier Deploy completeSlack notificationmoi acme/issue-creator Bug in checkoutGitHub issue creatormoi acme/weather-agent TokyoWeather reporterCommands
Authentication
moi loginAuthenticate with your MoiAgent accountmoi logoutClear stored credentialsmoi whoamiShow current user and workspacesAgent Management
moi listList all available agentsmoi create <workspace>/<agent>Create a new agentmoi update <workspace>/<agent>Update an agentmoi delete <workspace>/<agent>Delete an agentTool Management
moi tools list <workspace>/<agent>List agent toolsmoi tools show <workspace>/<agent> <tool>Show tool detailsmoi tools add <workspace>/<agent>Add a toolmoi tools remove <workspace>/<agent> <tool>Remove a toolAuth Tokens
moi tokensList your auth tokensmoi tokens create --name <name>Create a new auth tokenmoi tokens revoke <id>Revoke an auth tokenCreate & Update Options
Options available for moi create and moi update:
| Option | Description |
|---|---|
-n, --name <name> | Agent display name |
-d, --description <text> | Agent description |
-i, --instructions <text> | Agent instructions |
-s, --status <status> | Status: active, draft, or archived |
Example
$moi create acme/helper -d "General assistant" -i "You are helpful"
Auth Token Options
Options for moi tokens create:
| Option | Description |
|---|---|
-n, --name <name> | Auth token name (required) |
-e, --expires <duration> | Expiration: 30d, 90d, 6m, 1y |
Global Options
--debugShow detailed request/response info
--helpShow help information
Environment Variables
| Variable | Description |
|---|---|
MOI_TOKEN | API token for CI/CD (bypasses interactive login) |
CI/CD Usage
Set
MOI_TOKEN in your CI environment to use agents without interactive login. See CI/CD documentation for examples.Exit Codes
0
Success
1
General error
2
Auth required
3
Not found
4
Quota exceeded