Guide

CLI

Run agents from the terminal with the MoiAgent command-line interface.

Install globally via npm

npm install -g moiagent-cli
Requires 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 notification
moi acme/issue-creator Bug in checkoutGitHub issue creator
moi acme/weather-agent TokyoWeather reporter

Commands

Authentication

moi loginAuthenticate with your MoiAgent account
moi logoutClear stored credentials
moi whoamiShow current user and workspaces

Agent Management

moi listList all available agents
moi create <workspace>/<agent>Create a new agent
moi update <workspace>/<agent>Update an agent
moi delete <workspace>/<agent>Delete an agent

Tool Management

moi tools list <workspace>/<agent>List agent tools
moi tools show <workspace>/<agent> <tool>Show tool details
moi tools add <workspace>/<agent>Add a tool
moi tools remove <workspace>/<agent> <tool>Remove a tool

Auth Tokens

moi tokensList your auth tokens
moi tokens create --name <name>Create a new auth token
moi tokens revoke <id>Revoke an auth token

Create & Update Options

Options available for moi create and moi update:

OptionDescription
-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:

OptionDescription
-n, --name <name>Auth token name (required)
-e, --expires <duration>Expiration: 30d, 90d, 6m, 1y

Global Options

--debug

Show detailed request/response info

--help

Show help information

Environment Variables

VariableDescription
MOI_TOKENAPI 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