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-1instead ofses_abc123) - Rich formatting: Beautiful tables and colored output
- JSON output: Use
--jsonflag for machine-readable output - Built on official SDK: Uses the official
opencode-aipackage 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0acf32e6c3fc1ecc6b2a635cd48bdf6042ff5a8df5e9a25ee59fdcda905361e2
|
|
| MD5 |
0bb8183141ca41e01f8b9a05ef04a71f
|
|
| BLAKE2b-256 |
3b01fb00c9768dd903882a71ceb4aec591f349127eee45408a4cdee3258b51b3
|
File details
Details for the file opencode_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: opencode_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da4ddd9b79c8d06ad2db44b22339df434a31506c562bf5d4ad8e2a4f47098a33
|
|
| MD5 |
7b716c6e1c270f85612e0909e99db5f1
|
|
| BLAKE2b-256 |
7e670f1f78167fc0617c21277349df7db26228a45ab9cc711cbe259642b8a9c7
|