CLI Reference
Complete reference for all Gentoro OneMCP CLI commands, configuration files, and options.
Command Overview
onemcp [command] [options]Quick Reference
| Command | Description |
|---|---|
chat [handbook] | Start interactive chat mode |
stop | Stop all services |
status | Show service health status |
update | Update CLI to latest version |
reset | Reset configuration and re-run setup |
provider set | Configure AI provider and API key |
provider switch | Switch between providers |
provider list | List configured providers |
handbook init <name> | Create new handbook |
handbook validate | Validate handbook structure |
handbook list | List all handbooks |
handbook use <name> | Set current handbook |
handbook current | Show current handbook |
service auth <name> | Configure service authentication |
service renew <name> | Renew service token |
service list | List configured services |
doctor | Check system requirements |
logs [service] | View service logs |
--version | Show CLI version |
--help | Show help information |
Chat & Services
onemcp chat
Start interactive chat mode with AI.
onemcp chat [handbook]Arguments:
handbook(optional) - Name of handbook to use. If omitted, uses current handbook.
Behavior:
- On first run, launches setup wizard
- Automatically starts all required services
- Opens interactive chat interface
- Provides example queries for mock server
Interactive Commands:
exit- Exit chat modeclear- Clear conversation historyswitch- Switch to a different handbookhelp- Show available commands
Examples:
# Chat with current handbook
onemcp chat
# Chat with specific handbook
onemcp chat analytics-dashboard
# Chat with ACME Analytics example
onemcp chat ecommerce-apiServices Started:
- OneMCP Server (port 8080)
- TypeScript Runtime (port 7070)
- Mock Server (port 8082, if using ACME Analytics)
- OpenTelemetry Collector (port 4317, optional)
onemcp stop
Stop all running OneMCP services.
onemcp stopBehavior:
- Gracefully shuts down all child processes
- Closes open ports
- Preserves logs and configuration
Example:
onemcp stoponemcp status
Show health status of all services.
onemcp statusOutput:
- Service name
- Status (healthy/unhealthy/stopped)
- Port number
- Uptime
Example:
onemcp status
# Output:
# OneMCP Server (8080): healthy (uptime: 2h 15m)
# TypeScript Runtime (7070): healthy (uptime: 2h 15m)
# Mock Server (8082): healthy (uptime: 2h 15m)onemcp update
Update CLI to the latest version.
onemcp updateBehavior:
- Pulls latest code from GitHub
- Rebuilds the CLI
- Preserves configuration and handbooks
- Restarts services if running
Example:
onemcp updateonemcp reset
Reset all configuration and re-run setup wizard.
onemcp resetBehavior:
- Stops all services
- Deletes
~/.onemcp/config.yaml - Clears provider configurations
- Preserves handbooks
- Launches setup wizard on next command
Warning: This deletes all configuration. Use with caution.
Example:
onemcp resetProvider Management
onemcp provider set
Configure a new AI provider or update existing one.
onemcp provider setInteractive Prompts:
- Choose provider (OpenAI, Anthropic, Gemini)
- Enter API key
- Confirm and save
Supported Providers:
- OpenAI - GPT-4, GPT-3.5-turbo, etc.
- Anthropic - Claude 3 Opus, Sonnet, Haiku
- Google Gemini - Gemini Pro, Gemini Ultra
Example:
onemcp provider set
# Interactive prompts:
# ? Select provider: OpenAI
# ? Enter API key: sk-...
# β Provider configured successfullyonemcp provider switch
Switch between configured providers.
onemcp provider switchInteractive Prompts:
- Shows list of configured providers
- Select provider to use
- No need to re-enter API keys
Example:
onemcp provider switch
# Interactive prompts:
# ? Select provider:
# > OpenAI (sk-...abc)
# Anthropic (sk-...xyz)
# Gemini (AI...123)onemcp provider list
List all configured providers and their API keys (masked).
onemcp provider listOutput:
- Provider name
- API key (first 6 and last 3 characters visible)
- Current provider indicator
Example:
onemcp provider list
# Output:
# * OpenAI: sk-proj...abc (current)
# Anthropic: sk-ant-...xyz
# Gemini: AIza...123Handbook Management
onemcp handbook init
Create a new handbook.
onemcp handbook init <name>Arguments:
name(required) - Name for the new handbook
Behavior:
- Creates handbook directory at
~/handbooks/<name> - Generates standard directory structure
- Creates template
Agent.md - Initializes empty
apis/,docs/,regression/directories
Directory Structure Created:
~/handbooks/<name>/
βββ Agent.md
βββ apis/
βββ docs/
βββ regression/
βββ state/Example:
onemcp handbook init customer-api
# Output:
# β Created handbook: customer-api
# β Directory: ~/handbooks/customer-apionemcp handbook validate
Validate current handbook structure.
onemcp handbook validateChecks:
- Handbook directory exists
- Required directories present (
apis/,docs/,regression/,state/) Agent.mdexists and is readable- OpenAPI specs are valid YAML/JSON
- Documentation files are valid Markdown
Example:
onemcp handbook validate
# Output:
# β Handbook structure valid
# β Agent.md found
# β 2 OpenAPI specs validated
# β 5 documentation files validatedonemcp handbook list
List all handbooks.
onemcp handbook listOutput:
- Handbook name
- Location
- Current handbook indicator
Example:
onemcp handbook list
# Output:
# * ecommerce-api (current)
# customer-api
# analytics-dashboard
# payment-serviceonemcp handbook use
Set the current handbook.
onemcp handbook use <name>Arguments:
name(required) - Name of handbook to activate
Behavior:
- Updates
currentHandbookin~/.onemcp/config.yaml - Subsequent
onemcp chatcommands use this handbook
Example:
onemcp handbook use customer-api
# Output:
# β Switched to handbook: customer-apionemcp handbook current
Show the current handbook.
onemcp handbook currentOutput:
- Current handbook name
- Location
- Last modified date
Example:
onemcp handbook current
# Output:
# Current handbook: customer-api
# Location: ~/handbooks/customer-api
# Last modified: 2025-11-06 14:30:00Service Management
onemcp service auth
Configure authentication for a service.
onemcp service auth <name>Arguments:
name(required) - Service name
Interactive Prompts:
- Authentication header (e.g.,
Authorization) - Token pattern (e.g.,
Bearer {token}) - Token value
- Expiration date
Creates:
~/handbooks/{current-handbook}/service.yaml
Example:
onemcp service auth my-api
# Interactive prompts:
# ? Header name: Authorization
# ? Token pattern: Bearer {token}
# ? Token value: eyJhbGc...
# ? Expires at: 2025-12-31
# β Service authentication configuredGenerated service.yaml:
service: my-api
header: Authorization
pattern: Bearer {token}
token: eyJhbGc...
expiresAt: 2025-12-31T23:59:59Zonemcp service renew
Renew authentication token for a service.
onemcp service renew <name>Arguments:
name(required) - Service name
Interactive Prompts:
- New token value
- New expiration date
Updates:
tokenfield inservice.yamlexpiresAtfield inservice.yaml
Example:
onemcp service renew my-api
# Interactive prompts:
# ? New token value: eyJhbGc...
# ? Expires at: 2026-01-31
# β Token renewed successfullyonemcp service list
List all configured services.
onemcp service listOutput:
- Service name
- Handbook
- Expiration date
- Status (valid/expired)
Example:
onemcp service list
# Output:
# customer-api (customer-api handbook)
# Expires: 2025-12-31 [valid]
#
# payment-api (payment-service handbook)
# Expires: 2025-11-01 [expired]Diagnostics
onemcp doctor
Check system requirements and configuration.
onemcp doctorChecks:
- Node.js version (>= 20)
- Java version (21)
- Maven installation
- Network connectivity
- Port availability (8080, 7070, 8082, 4317)
- Configuration file validity
- Handbook directory structure
Example:
onemcp doctor
# Output:
# β Node.js 20.10.0 (required: >= 20)
# β Java 21.0.1 (required: 21)
# β Maven 3.9.5
# β Network connectivity
# β Port 8080 available
# β Port 7070 available
# β Port 8082 available
# β Configuration valid
# β Handbook directory exists
#
# All checks passed!onemcp logs
View service logs.
onemcp logs [service] [options]Arguments:
service(optional) - Service name (app,typescript,mock,otel)
Options:
-f, --follow- Follow log output (liketail -f)-n, --lines <number>- Show last N lines (default: 100)
Examples:
# View all logs
onemcp logs
# View app logs
onemcp logs app
# Follow TypeScript runtime logs
onemcp logs typescript -f
# Show last 50 lines of mock server logs
onemcp logs mock -n 50Log Files:
~/.onemcp/logs/app.log- OneMCP server~/.onemcp/logs/typescript.log- TypeScript runtime~/.onemcp/logs/mock.log- Mock server~/.onemcp/logs/otel.log- OpenTelemetry collector~/.onemcp/logs/archived/- Archived logs
onemcp βversion
Show CLI version.
onemcp --versionExample:
onemcp --version
# Output:
# @gentoro/onemcp-cli v1.0.0onemcp βhelp
Show help information.
onemcp --help
onemcp [command] --helpExamples:
# General help
onemcp --help
# Command-specific help
onemcp chat --help
onemcp handbook --help
onemcp provider --helpConfiguration Files
Global Configuration
Location: ~/.onemcp/config.yaml
Structure:
provider: openai # Current AI provider
apiKeys: # Provider API keys
openai: sk-proj-...
anthropic: sk-ant-...
gemini: AIza...
currentHandbook: my-service # Active handbook
handbookDir: ~/handbooks # Handbooks directory
logDir: ~/.onemcp/logs # Logs directory
ports: # Service ports (optional)
app: 8080
typescript: 7070
mock: 8082
otel: 4317Fields:
provider- Default AI provider (openai, anthropic, gemini)apiKeys- Map of provider names to API keyscurrentHandbook- Name of active handbookhandbookDir- Path to handbooks directorylogDir- Path to logs directoryports- Custom port configuration (optional)
Handbook Structure
Location: ~/handbooks/{handbook-name}/
Structure:
handbook/
βββ Agent.md # AI instructions (required)
βββ apis/ # OpenAPI specifications
β βββ api-v1.yaml
β βββ api-v2.yaml
βββ docs/ # Supplementary documentation
β βββ overview.md
β βββ examples.md
β βββ troubleshooting.md
βββ regression/ # Test definitions (optional)
β βββ test-cases.yaml
βββ state/ # Runtime data (auto-generated)
βββ knowledge-base-state.jsonRequired:
Agent.md- Instructions for the AI agent
Optional:
apis/- OpenAPI specifications (YAML or JSON)docs/- Markdown documentation filesregression/- Test case definitionsstate/- Auto-generated, do not edit manually
Service Authentication
Location: ~/handbooks/{handbook-name}/service.yaml
Structure:
service: my-api # Service identifier
header: Authorization # HTTP header name
pattern: Bearer {token} # Token pattern
token: eyJhbGc... # Token value
expiresAt: 2025-12-31T23:59:59Z # Expiration timestampFields:
service- Unique service identifierheader- HTTP header for authentication (e.g.,Authorization,X-API-Key)pattern- Token pattern with{token}placeholder (e.g.,Bearer {token},ApiKey {token})token- The actual token valueexpiresAt- ISO 8601 timestamp for token expiration
Common Patterns:
# Bearer token
header: Authorization
pattern: Bearer {token}
# API key
header: X-API-Key
pattern: {token}
# Custom header
header: X-Custom-Auth
pattern: Token {token}Environment Variables
Installation
ONEMCP_INSTALL_METHOD- Installation method (npm,system-wide,local-bin)ONEMCP_REPO_BRANCH- Git branch to install from
Examples:
# System-wide installation
ONEMCP_INSTALL_METHOD=system-wide bash install.sh
# Install from custom branch
ONEMCP_REPO_BRANCH=develop bash install.shRuntime
ONEMCP_CONFIG_DIR- Override config directory (default:~/.onemcp)ONEMCP_HANDBOOK_DIR- Override handbooks directory (default:~/handbooks)ONEMCP_LOG_DIR- Override logs directory (default:~/.onemcp/logs)
Examples:
# Use custom config directory
ONEMCP_CONFIG_DIR=/custom/path onemcp chat
# Use custom handbooks directory
ONEMCP_HANDBOOK_DIR=/my/handbooks onemcp handbook listExit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Service startup error |
| 4 | Service health check failed |
| 5 | Handbook validation error |
| 6 | Authentication error |
| 7 | Network error |
| 8 | Missing dependency |
Best Practices
Configuration Management
- Version control: Keep handbooks in Git, exclude
state/directory - Secrets management: Never commit API keys or tokens
- Environment separation: Use separate handbooks for dev/staging/prod
Handbook Organization
- One service per handbook: Keep each API in its own handbook
- Clear naming: Use descriptive names like
customer-api, notapi1 - Documentation: Include comprehensive docs in the
docs/directory - OpenAPI specs: Keep specs up to date with API changes
Service Authentication
- Token rotation: Regularly renew tokens using
onemcp service renew - Expiration dates: Set realistic expiration dates
- Least privilege: Use tokens with minimal required permissions
- Secure storage: Configuration files contain sensitive data, protect accordingly
Troubleshooting
- Check logs first: Use
onemcp logsto diagnose issues - Verify health: Run
onemcp statusto check service health - Run doctor: Use
onemcp doctorto verify system requirements - Clean restart: Stop services with
onemcp stop, then restart withonemcp chat
See Also
- CLI Guide - Comprehensive usage guide
- Getting Started - Quick start tutorial
- Architecture - System architecture overview
- Configuration - Advanced configuration options