CLI Reference
Complete reference for all Gentoro OneMCP CLI commands, configuration files, and options.
Command Overview
onemcp [command] [options]Quick Reference
| Command | Description |
|---|---|
chat | Start interactive chat mode |
status | Show server and configuration status |
stop | Stop the OneMCP server |
logs | View server logs |
doctor | Check system requirements |
update | Update to latest version |
reset | Reset all configuration |
provider list | Show configured AI providers |
provider set | Configure provider and API key |
provider switch | Switch between providers |
handbook init <name> | Create new handbook |
handbook list | List all handbooks |
handbook use [name] | Set active handbook |
handbook current | Show current handbook |
handbook validate [name] | Validate handbook |
service auth | Configure service authentication |
service list | List configured services |
service renew | Renew service token |
completion bash|zsh|fish|powershell | Generate completion script |
Global Flags
Available for all commands:
--config string- Config file (default:~/.onemcp/config.yaml)-h, --help- Help for any command
Core Commands
chat
Open interactive chat mode with MCP server.
Usage:
onemcp chatBehavior:
- Starts Docker container if not running
- Waits for server to be ready
- Opens interactive chat session
- Displays ACME example prompts (if using acme-analytics)
In-Chat Commands:
| Command | Description |
|---|---|
help | Show available in-chat commands |
clear | Clear chat history for current session |
switch | Switch to different handbook |
exit, quit | Exit chat mode |
Example:
onemcp chat
# Output:
# ╔══════════════════════════════════════╗
# ║ Gentoro OneMCP - Chat Mode ║
# ╚══════════════════════════════════════╝
#
# Handbook: acme-analytics
# Provider: gemini
#
# You: Show total sales for 2024
# Agent: {...}status
Show OneMCP server and configuration status.
Usage:
onemcp statusOutput:
- Docker container status
- Server health
- Current handbook
- Active AI provider
- Configuration file path
Example:
onemcp status
# Output:
# Docker container: running
# Server health: healthy
# Current handbook: acme-analytics
# Active provider: gemini
# Config: /Users/you/.onemcp/config.yamlstop
Stop the OneMCP server.
Usage:
onemcp stopBehavior:
- Gracefully stops Docker container
- Preserves configuration and logs
Example:
onemcp stop
# Output:
# Stopping OneMCP server...
# Container stoppedlogs
View OneMCP server logs.
Usage:
onemcp logs [flags]Flags:
-n, --lines int- Number of lines to show (default: 50)-f, --follow- Follow log output in real-time
Examples:
# Show last 50 lines
onemcp logs
# Show last 100 lines
onemcp logs -n 100
# Follow logs in real-time
onemcp logs -f
# Follow last 200 lines
onemcp logs -n 200 -fUse Cases:
- Debugging connection issues
- Monitoring server performance
- Viewing API call traces
- Troubleshooting errors
doctor
Check system requirements and configuration.
Usage:
onemcp doctorChecks:
- Docker installed
- Docker daemon running
- Network connectivity
- Configuration file validity
- Required permissions
Example:
onemcp doctor
# Output:
# ✓ Docker is installed
# ✓ Docker daemon is running
# ✓ Network connectivity OK
# ✓ Configuration file valid
# ✓ All requirements metupdate
Update OneMCP Docker image and display CLI update instructions.
Usage:
onemcp updateBehavior:
- Detects installation method (Homebrew, Scoop, or Manual)
- Displays appropriate update instructions for the CLI binary
- Pulls latest
admingentoro/gentoro:latestDocker image
Example:
onemcp update
# Output:
# 📌 To update the OneMCP CLI:
#
# Homebrew:
# brew upgrade onemcp
#
# 📦 Updating OneMCP Docker image...
# latest: Pulling from admin gent oro/gentoro
# Digest: sha256:...
# ✅ Docker image updated successfully!Installation Detection:
The command automatically detects how the CLI was installed:
- Homebrew: Checks for Cellar path or
brew list onemcp - Scoop: Checks for Scoop apps path or
scoop list onemcp - Manual: Falls back if neither package manager is detected
Note: This command only updates the Docker image. To update the CLI binary itself, use your package manager or download manually.
version
Show the OneMCP CLI version.
Usage:
onemcp version
# or
onemcp --versionExample:
onemcp version
# Output:
# OneMCP CLI v0.0.3Note: Version is set at build time via ldflags during the release process.
reset
Reset all OneMCP configuration.
Usage:
onemcp resetWarning: This deletes all configuration files. Handbooks are preserved.
What gets deleted:
~/.onemcp/config.yaml- All provider configurations
- All cached data
What is preserved:
- Handbooks in
~/onemcp-handbooks/ - Service authentication files
Example:
onemcp reset
# Output:
# ⚠️ This will delete all configuration.
# Handbooks will be preserved.
# Continue? (y/N): y
# Configuration reset successfullyProvider Management
provider set
Configure an AI provider and API key.
Usage:
onemcp provider setInteractive Prompts:
- Select provider (OpenAI, Google Gemini, Anthropic)
- Enter API key
- Configuration saved
Supported Providers:
- OpenAI - GPT-4, GPT-3.5-turbo
- Google Gemini - Gemini Pro, Gemini Flash
- Anthropic - Claude 3 Opus, Sonnet, Haiku
Example:
onemcp provider set
# Interactive:
# ? Select AI provider: Google Gemini
# ? Enter your Gemini API key: **********************
# ✓ Provider configured successfullyprovider list
Show all configured AI providers.
Usage:
onemcp provider listOutput:
- Provider name
- Masked API key (first 6 and last 3 chars)
- Current provider indicator
Example:
onemcp provider list
# Output:
# Configured Providers:
# ✓ gemini: AIza************************ (active)
# ✓ openai: sk-proj-********************
# - anthropic: (not configured)provider switch
Switch between configured providers.
Usage:
onemcp provider switchInteractive Prompts:
- Shows list of configured providers
- Select provider to activate
- No need to re-enter API keys
Example:
onemcp provider switch
# Interactive:
# ? Select provider to use:
# > gemini (AIza...abc) [current]
# openai (sk-proj...xyz)
# anthropic (sk-ant...123)Handbook Management
handbook init
Create a new handbook.
Usage:
onemcp handbook init <name>Arguments:
name(required) - Name for the new handbook
Behavior:
- Creates handbook directory at
~/onemcp-handbooks/<name> - Generates template files
- Creates standard directory structure
Directory Structure Created:
~/onemcp-handbooks/<name>/
├── Agent.yaml # AI instructions template
├── README.md # Handbook overview template
├── getting-started.md # Quick start template
└── openapi/ # OpenAPI specs directory
└── README.md # Instructions for adding specsExample:
onemcp handbook init customer-api
# Output:
# ✓ Created handbook: customer-api
# ✓ Directory: ~/onemcp-handbooks/customer-api
#
# Next steps:
# 1. Add OpenAPI spec to openapi/ directory
# 2. Customize Agent.yaml with instructions
# 3. Run: onemcp handbook validate customer-apihandbook list
List all available handbooks.
Usage:
onemcp handbook listOutput:
- Handbook name
- Location (built-in or custom)
- Current handbook indicator
Example:
onemcp handbook list
# Output:
# Available Handbooks:
# - acme-analytics (built-in)
# * customer-api (current)
# - analytics-service
# - payment-apihandbook use
Set the active handbook.
Usage:
onemcp handbook use [name]Arguments:
name(optional) - Handbook to activate. If omitted, shows interactive selection.
Behavior:
- Updates
currenthandbookin~/.onemcp/config.yaml - Subsequent
onemcp chatcommands use this handbook
Examples:
# Interactive selection
onemcp handbook use
# Direct selection
onemcp handbook use customer-api
# Output:
# ✓ Switched to handbook: customer-apihandbook current
Show the current active handbook.
Usage:
onemcp handbook currentOutput:
- Current handbook name
- Location path
Example:
onemcp handbook current
# Output:
# Current Handbook: acme-analytics
# Location: Built-inhandbook validate
Validate handbook structure.
Usage:
onemcp handbook validate [name]Arguments:
name(optional) - Handbook to validate. If omitted, validates current handbook.
Checks:
- Handbook directory exists
openapi/directory exists- At least one
.yamlfile inopenapi/ - Valid YAML syntax
Example:
onemcp handbook validate customer-api
# Output:
# ✓ Handbook structure valid
# ✓ OpenAPI directory found
# ✓ 2 OpenAPI specifications found
# ✓ No validation errorsService Management
service auth
Configure authentication for external services.
Usage:
onemcp service authInteractive Prompts:
- Service name
- Authentication header (e.g.,
Authorization) - Token pattern (e.g.,
Bearer {token}) - Token value
- Expiration date
Creates:
~/onemcp-handbooks/{current-handbook}/service.yaml
Example:
onemcp service auth
# Interactive:
# ? Service name: my-api
# ? Header name: Authorization
# ? Token pattern: Bearer {token}
# ? Token value: **********************
# ? Expires at (YYYY-MM-DD): 2025-12-31
# ✓ Service authentication configuredGenerated service.yaml:
service: my-api
header: Authorization
pattern: Bearer {token}
token: eyJhbGc...
expiresAt: 2025-12-31T23:59:59Zservice list
List all configured services.
Usage:
onemcp service listOutput:
- Service name
- Handbook
- Expiration date
- Status (valid/expired)
Example:
onemcp service list
# Output:
# Configured Services:
# - customer-api (expires: 2025-12-31) [valid]
# - payment-api (expires: 2025-06-30) [expired]service renew
Renew service authentication token.
Usage:
onemcp service renewInteractive Prompts:
- Select service to renew
- New token value
- New expiration date
Updates:
tokenfield inservice.yamlexpiresAtfield inservice.yaml
Example:
onemcp service renew
# Interactive:
# ? Select service: customer-api
# ? New token value: **********************
# ? Expires at (YYYY-MM-DD): 2026-01-31
# ✓ Token renewed successfullyShell Completion
completion
Generate autocompletion scripts for your shell.
Sub commands:
bash- Bash completionzsh- Zsh completionfish- Fish completionpowershell- PowerShell completion
Usage:
onemcp completion <shell>Examples:
Bash:
# Generate completion script
onemcp completion bash > /etc/bash_completion.d/onemcp
# Or add to ~/.bashrc
source <(onemcp completion bash)Zsh:
# Add to ~/.zshrc
source <(onemcp completion zsh)Fish:
onemcp completion fish > ~/.config/fish/completions/onemcp.fishPowerShell:
onemcp completion powershell | Out-String | Invoke-ExpressionSee Shell Completion Guide for detailed setup.
Configuration
Global Configuration File
Location: ~/.onemcp/config.yaml
Structure:
provider: gemini # Active AI provider
apikeys:
gemini: YOUR_GEMINI_KEY
openai: YOUR_OPENAI_KEY
anthropic: YOUR_ANTHROPIC_KEY
currenthandbook: acme-analytics # Active handbook
defaultport: 8080 # Server port
handbookdir: /path/to/handbooks # Handbooks directory
chattimeout: 240 # Chat timeout (seconds)Fields:
- provider (string) - Active AI provider (
gemini,openai,anthropic) - apikeys (object) - API keys for each provider
- currenthandbook (string) - Name of active handbook
- defaultport (integer) - Server port (default: 8080)
- handbookdir (string) - Path to handbooks directory
- chattimeout (integer) - Chat timeout in seconds (default: 240)
Manual Editing:
nano ~/.onemcp/config.yamlHandbook Structure
Location: ~/onemcp-handbooks/{handbook-name}/
Structure:
handbook/
├── Agent.yaml # AI instructions
├── README.md # Handbook overview
├── getting-started.md # Quick start guide
├── openapi/ # OpenAPI specs (REQUIRED)
│ └── api.yaml
├── docs/ # Additional docs (optional)
└── data/ # Data files (optional, not used by server)Required:
openapi/directory with at least one.yamlfile
Recommended:
Agent.yaml- Instructions for the AI agent
Optional:
README.md,getting-started.md- Documentationdocs/- Additional markdown filesdata/- Data files (not processed by server)
Service Authentication File
Location: ~/onemcp-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 identifier
- header - HTTP header for authentication
- pattern - Token pattern with
{token}placeholder - token - Actual token value
- expiresAt - ISO 8601 timestamp for 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
Runtime Configuration
ONEMCP_CONFIG- Override config file pathONEMCP_PORT- Override server portONEMCP_HANDBOOK_DIR- Override handbooks directory
Examples:
# Use custom config
ONEMCP_CONFIG=/custom/config.yaml onemcp chat
# Use custom port
ONEMCP_PORT=9090 onemcp chat
# Use custom handbook directory
ONEMCP_HANDBOOK_DIR=/my/handbooks onemcp handbook listBest Practices
Configuration Management
- Version control: Keep handbooks in Git, exclude
service.yaml - Secrets management: Never commit API keys or tokens to version control
- Environment separation: Use separate handbooks for dev/staging/prod
Handbook Organization
- One handbook per service: Keep each API separate
- Descriptive names: Use clear names like
customer-api, notapi1 - Documentation: Include comprehensive docs
- Validation: Run
validateafter changes
Service Authentication
- Token rotation: Regularly renew tokens using
service renew - Expiration dates: Set realistic expiration dates
- Least privilege: Use tokens with minimal permissions
- Secure storage: Protect configuration files
Troubleshooting
- Check logs first:
onemcp logsto diagnose issues - Verify health:
onemcp statusto check service health - Run doctor:
onemcp doctorto verify requirements - Clean restart:
onemcp stopthenonemcp chat
See Also
- CLI Guide - Comprehensive usage guide
- CLI Installation - Installation methods
- Shell Completion - Tab completion setup
- Development CLI - Local development tools