Skip to content
API Blog

CLI Reference

The Lobu CLI (@lobu/cli) scaffolds projects, runs agents locally, and manages deployments.

Terminal window
# Run directly (no install)
npx @lobu/cli@latest <command>
# Or install globally
npm install -g @lobu/cli
lobu <command>

Scaffold a new agent project with lobu.toml, Docker Compose, and environment config.

Terminal window
npx @lobu/cli@latest init my-agent

Generates:

  • lobu.toml — agent configuration (skills, providers, connections, network)
  • docker-compose.yml — service definitions (gateway, Redis, optional Owletto)
  • .env — credentials and environment variables
  • agents/{name}/ — agent directory with IDENTITY.md, SOUL.md, USER.md, and skills/
  • skills/ — shared skills directory (available to all agents)
  • AGENTS.md, TESTING.md, README.md, .gitignore
  • Dockerfile.worker — worker image customization (Docker mode only)

Interactive prompts guide you through deployment mode, provider, skills, platform, network access policy, gateway port, public URL, admin password, and memory configuration.


Send a prompt to an agent and stream the response to the terminal.

Terminal window
npx @lobu/cli@latest chat "What is the weather?"
npx @lobu/cli@latest chat "Hello" --agent my-agent --thread conv-123
npx @lobu/cli@latest chat "Check my PRs" --user telegram:12345
npx @lobu/cli@latest chat "Status update" -c staging

API mode (default): creates a session, sends the message, and streams the response to the terminal.

Platform mode (with --user): routes the message through Telegram/Slack/Discord so the response appears on the platform. The terminal also streams the output.

FlagDescription
-a, --agent <id>Agent ID (defaults to first agent in lobu.toml)
-u, --user <id>Route through a platform (e.g. telegram:12345, slack:C0123)
-t, --thread <id>Thread/conversation ID for multi-turn conversations
-g, --gateway <url>Gateway URL (default: http://localhost:8080 or from .env)
--dry-runProcess without persisting history
--newForce a new session (ignore existing)
-c, --context <name>Use a named context for gateway URL and credentials

Run agent evaluations. Eval files live in the agent directory and define test cases with expected outcomes.

Terminal window
npx @lobu/cli@latest eval # run all evals
npx @lobu/cli@latest eval basic-qa # run a specific eval
npx @lobu/cli@latest eval --model claude/sonnet # eval with a specific model
npx @lobu/cli@latest eval --ci --output results.json # CI mode with JSON output
FlagDescription
-a, --agent <id>Agent ID (defaults to first in lobu.toml)
-g, --gateway <url>Gateway URL (default: http://localhost:8080)
-m, --model <model>Model to evaluate (e.g. claude/sonnet, openai/gpt-4.1)
--trials <n>Override trial count
--ciCI mode: JSON output, non-zero exit on failure
--output <file>Write results to JSON file
--listList available evals without running them

Run the agent stack. Validates lobu.toml, prepares environment variables, then starts docker compose up. Extra flags are forwarded to Docker Compose.

Without -d, the CLI starts containers then tails gateway logs. With -d, it starts detached and exits.

Terminal window
npx @lobu/cli@latest run # start and tail logs
npx @lobu/cli@latest run -d # detached mode
npx @lobu/cli@latest run -d --build # rebuild containers

Validate lobu.toml schema, skill IDs, and provider configuration.

Terminal window
npx @lobu/cli@latest validate

Returns exit code 1 if validation fails.


Manage named API contexts for switching between local and remote gateways.

Terminal window
npx @lobu/cli@latest context list
npx @lobu/cli@latest context current
npx @lobu/cli@latest context add staging --api-url https://staging.example.com
npx @lobu/cli@latest context use staging
SubcommandDescription
listList all configured contexts
currentShow the active context
add <name> --api-url <url>Add a named context
use <name>Set the active context

Environment overrides: set LOBU_CONTEXT to select a context by name, or LOBU_API_URL to override the URL directly.


Authenticate with Lobu Cloud. Opens a browser for OAuth by default.

Terminal window
npx @lobu/cli@latest login
npx @lobu/cli@latest login --token <api-token> # CI/CD
npx @lobu/cli@latest login --admin-password # local dev fallback
npx @lobu/cli@latest login -c staging # login to a named context
npx @lobu/cli@latest login --force # re-authenticate (revokes existing session)
FlagDescription
--token <token>Use an API token directly (for CI/CD pipelines)
--admin-passwordUse the development-only admin password fallback
-c, --context <name>Authenticate against a named context
-f, --forceRe-authenticate, revoking the existing session first

Revoke the session server-side and clear stored credentials. If the gateway is unreachable, local credentials are still cleared.

Terminal window
npx @lobu/cli@latest logout
npx @lobu/cli@latest logout -c staging
FlagDescription
-c, --context <name>Clear credentials for a named context

Show the current authenticated user, linked agent, and API URL.

Terminal window
npx @lobu/cli@latest whoami
npx @lobu/cli@latest whoami -c staging
FlagDescription
-c, --context <name>Query a named context

Show agent health: lists agents with their providers and models, platform connections with status, and active sandboxes. Requires the gateway to be running.

Terminal window
npx @lobu/cli@latest status

Manage agent secrets (stored in .env for local dev).

Terminal window
npx @lobu/cli@latest secrets set OPENAI_API_KEY sk-...
npx @lobu/cli@latest secrets list
npx @lobu/cli@latest secrets delete OPENAI_API_KEY
SubcommandDescription
set <key> <value>Set a secret
listList secrets (values redacted)
delete <key>Remove a secret

Install bundled starter skills into a local skills/ directory.

Terminal window
npx @lobu/cli@latest skills list
npx @lobu/cli@latest skills add lobu
npx @lobu/cli@latest skills add lobu --force
SubcommandDescription
listShow bundled Lobu starter skills
add <id>Copy a bundled starter skill into skills/<id>

Use the Owletto CLI to install Owletto starter skills separately:

Terminal window
npx owletto@latest skills add owletto

Browse and manage LLM providers.

Terminal window
npx @lobu/cli@latest providers list # browse available providers
npx @lobu/cli@latest providers add gemini # add to lobu.toml
SubcommandDescription
listBrowse available LLM providers
add <id>Add a provider to lobu.toml
Terminal window
# 1. Scaffold
npx @lobu/cli@latest init my-agent
# 2. Configure
cd my-agent
npx @lobu/cli@latest skills add lobu
npx @lobu/cli@latest providers add gemini
npx @lobu/cli@latest secrets set GEMINI_API_KEY ...
# Optional: install the Owletto starter skill separately
npx owletto@latest skills add owletto
# 3. Validate
npx @lobu/cli@latest validate
# 4. Run locally
npx @lobu/cli@latest run -d
# 5. Chat with your agent
npx @lobu/cli@latest chat "Hello, what can you do?"