summaryrefslogtreecommitdiffhomepage
path: root/packages/web/src/content/docs/cli.mdx
diff options
context:
space:
mode:
authorJay V <[email protected]>2025-12-24 11:12:09 -0500
committerJay V <[email protected]>2025-12-24 11:12:09 -0500
commit4b061653f28aa16f4329013170d96658054154fc (patch)
treee73a13eb70bc7548e3f3049c1f5b13a04532a57c /packages/web/src/content/docs/cli.mdx
parenteeed89f985fdda18262076fbc91d8fb0dcb71981 (diff)
downloadopencode-4b061653f28aa16f4329013170d96658054154fc.tar.gz
opencode-4b061653f28aa16f4329013170d96658054154fc.zip
docs: add comprehensive CLI command documentation for agent, mcp, session, stats, and web commands
Diffstat (limited to 'packages/web/src/content/docs/cli.mdx')
-rw-r--r--packages/web/src/content/docs/cli.mdx224
1 files changed, 224 insertions, 0 deletions
diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx
index f104bfa00..e4e40ac7a 100644
--- a/packages/web/src/content/docs/cli.mdx
+++ b/packages/web/src/content/docs/cli.mdx
@@ -69,6 +69,16 @@ This command will guide you through creating a new agent with a custom system pr
---
+#### list
+
+List all available agents.
+
+```bash
+opencode agent list
+```
+
+---
+
### auth
Command to manage credentials and login for providers.
@@ -156,6 +166,88 @@ opencode github run
---
+### mcp
+
+Manage Model Context Protocol servers.
+
+```bash
+opencode mcp [command]
+```
+
+---
+
+#### add
+
+Add an MCP server to your configuration.
+
+```bash
+opencode mcp add
+```
+
+This command will guide you through adding either a local or remote MCP server.
+
+---
+
+#### list
+
+List all configured MCP servers and their connection status.
+
+```bash
+opencode mcp list
+```
+
+Or use the short version.
+
+```bash
+opencode mcp ls
+```
+
+---
+
+#### auth
+
+Authenticate with an OAuth-enabled MCP server.
+
+```bash
+opencode mcp auth [name]
+```
+
+If you don't provide a server name, you'll be prompted to select from available OAuth-capable servers.
+
+You can also list OAuth-capable servers and their authentication status.
+
+```bash
+opencode mcp auth list
+```
+
+Or use the short version.
+
+```bash
+opencode mcp auth ls
+```
+
+---
+
+#### logout
+
+Remove OAuth credentials for an MCP server.
+
+```bash
+opencode mcp logout [name]
+```
+
+---
+
+#### debug
+
+Debug OAuth connection issues for an MCP server.
+
+```bash
+opencode mcp debug <name>
+```
+
+---
+
### models
List all available models from configured providers.
@@ -250,6 +342,138 @@ This starts an HTTP server that provides API access to opencode functionality wi
---
+### session
+
+Manage OpenCode sessions.
+
+```bash
+opencode session [command]
+```
+
+---
+
+#### list
+
+List all OpenCode sessions.
+
+```bash
+opencode session list
+```
+
+##### Flags
+
+| Flag | Short | Description |
+| ------------- | ----- | ------------------------------------ |
+| `--max-count` | `-n` | Limit to N most recent sessions |
+| `--format` | | Output format: table or json (table) |
+
+---
+
+### stats
+
+Show token usage and cost statistics for your OpenCode sessions.
+
+```bash
+opencode stats
+```
+
+#### Flags
+
+| Flag | Description |
+| ----------- | --------------------------------------------------------------- |
+| `--days` | Show stats for the last N days (all time) |
+| `--tools` | Number of tools to show (all) |
+| `--project` | Filter by project (all projects, empty string: current project) |
+
+---
+
+### export
+
+Export session data as JSON.
+
+```bash
+opencode export [sessionID]
+```
+
+If you don't provide a session ID, you'll be prompted to select from available sessions.
+
+---
+
+### import
+
+Import session data from a JSON file or OpenCode share URL.
+
+```bash
+opencode import <file>
+```
+
+You can import from a local file or an OpenCode share URL.
+
+```bash
+opencode import session.json
+opencode import https://opncd.ai/s/abc123
+```
+
+---
+
+### web
+
+Start a headless OpenCode server with a web interface.
+
+```bash
+opencode web
+```
+
+This starts an HTTP server and opens a web browser to access OpenCode through a web interface.
+
+#### Flags
+
+| Flag | Short | Description |
+| ------------ | ----- | --------------------- |
+| `--port` | `-p` | Port to listen on |
+| `--hostname` | | Hostname to listen on |
+
+---
+
+### acp
+
+Start an ACP (Agent Client Protocol) server.
+
+```bash
+opencode acp
+```
+
+This command starts an ACP server that communicates via stdin/stdout using nd-JSON.
+
+#### Flags
+
+| Flag | Description |
+| ------------ | --------------------- |
+| `--cwd` | Working directory |
+| `--port` | Port to listen on |
+| `--hostname` | Hostname to listen on |
+
+---
+
+### uninstall
+
+Uninstall OpenCode and remove all related files.
+
+```bash
+opencode uninstall
+```
+
+#### Flags
+
+| Flag | Short | Description |
+| --------------- | ----- | ------------------------------------------- |
+| `--keep-config` | `-c` | Keep configuration files |
+| `--keep-data` | `-d` | Keep session data and snapshots |
+| `--dry-run` | | Show what would be removed without removing |
+| `--force` | `-f` | Skip confirmation prompts |
+
+---
+
### upgrade
Updates opencode to the latest version or a specific version.