moiagent-cli
v0.2.5
Published
CLI for MoiAgent - create and run AI agents from your terminal
Maintainers
Readme
MoiAgent CLI
Execute AI agents from the command line. Create focused agents with custom instructions and API tools via the MoiAgent dashboard, then invoke them from your terminal or let AI coding assistants use them as subagents.
Installation
npm install -g moiagent-cliQuick Start
# Authenticate (required once)
moi login
# Run an agent
moi acme/code-reviewer "Review this Python file for bugs"
# List available agents
moi listUsage
Execute an Agent
moi <workspace>/<agent> "<message>"Examples:
moi acme/code-reviewer "Review this Python file for bugs"
moi acme/slack-notifier "Send deployment complete to #releases"
moi acme/db-query "List all users created in the last 24 hours"
moi acme/github-helper "Create an issue for the login bug"The agent receives your message and responds with the result. Agents can have tools (APIs, databases, OAuth integrations) to perform actions.
Debug Mode
Add --debug to see request details:
moi --debug acme/code-reviewer "Review this file"Commands
Authentication
| Command | Description |
|---------|-------------|
| moi login | Authenticate with your MoiAgent account |
| moi logout | Clear stored credentials |
| moi whoami | Show current user and workspaces |
Agent Management
| Command | Description |
|---------|-------------|
| moi list | Show available agents in your workspaces |
| moi create <workspace>/<agent> [options] | Create a new agent |
| moi update <workspace>/<agent> [options] | Update an existing agent |
| moi delete <workspace>/<agent> [--force] | Delete an agent |
Options for create/update:
-n, --name <name>- Agent name-d, --description <text>- Agent description-i, --instructions <text>- System prompt instructions-s, --status <status>- Status:active,draft,archived
Examples:
moi create acme/helper -d "General assistant" -i "You are helpful"
moi update acme/helper -i "New instructions for the agent"
moi delete acme/old-agent --forceAPI Tokens
Manage API tokens for CI/CD and programmatic access:
| Command | Description |
|---------|-------------|
| moi tokens | List your API tokens |
| moi tokens create --name <name> | Create a new token |
| moi tokens revoke <id> | Revoke a token |
Options for create:
-n, --name <name>- Token name (required)-e, --expires <duration>- Expiration:30d,90d,6m,1y
Environment Variables
| Variable | Description |
|----------|-------------|
| MOI_TOKEN | API token for CI/CD (bypasses interactive login) |
CI/CD Usage
For non-interactive environments (GitHub Actions, CI pipelines), use an API token:
# Create a token via CLI or dashboard
moi tokens create --name "GitHub Actions" --expires 1y
# Use in CI (set MOI_TOKEN environment variable)
export MOI_TOKEN=moi_xxxxx
moi acme/deploy-checker "Verify deployment is healthy"GitHub Actions example:
- name: Run MoiAgent
env:
MOI_TOKEN: ${{ secrets.MOI_TOKEN }}
run: moi acme/code-reviewer "Review the changes in this PR"Requirements
- Node.js 18.0.0 or higher
- A MoiAgent account (sign up)
License
MIT
