Skip to main content

CLI tool for opencode server API

Project description

opencode-cli

CLI tool for opencode server API. Built on top of the official opencode-ai Python SDK.

Installation

pip install opencode-cli

Usage

The oc command provides easy access to opencode server operations:

# List all sessions
oc sessions

# List sessions as JSON
oc sessions --json

# Get session info (by ID or title)
oc info headless-1
oc info ses_abc123

# List messages in a session
oc messages headless-1

# Send a message to a session
oc send headless-1 "hello world"

# Create a new session
oc create --title "My Session"

Features

  • Title resolution: Use session titles instead of IDs (e.g., headless-1 instead of ses_abc123)
  • Rich formatting: Beautiful tables and colored output
  • JSON output: Use --json flag for machine-readable output
  • Built on official SDK: Uses the official opencode-ai package under the hood

Environment Variables

  • OPENCODE_SERVER - Override default server URL (default: http://localhost:36000)

For Python SDK

If you need the full Python SDK (not just CLI), use the official package:

pip install opencode-ai

See official SDK docs for Python API usage.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencode_cli-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencode_cli-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file opencode_cli-0.1.1.tar.gz.

File metadata

  • Download URL: opencode_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for opencode_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0acf32e6c3fc1ecc6b2a635cd48bdf6042ff5a8df5e9a25ee59fdcda905361e2
MD5 0bb8183141ca41e01f8b9a05ef04a71f
BLAKE2b-256 3b01fb00c9768dd903882a71ceb4aec591f349127eee45408a4cdee3258b51b3

See more details on using hashes here.

File details

Details for the file opencode_cli-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opencode_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da4ddd9b79c8d06ad2db44b22339df434a31506c562bf5d4ad8e2a4f47098a33
MD5 7b716c6e1c270f85612e0909e99db5f1
BLAKE2b-256 7e670f1f78167fc0617c21277349df7db26228a45ab9cc711cbe259642b8a9c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page