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
Metadata
Release files for opencode-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opencode_cli-0.1.1.tar.gz | 3.9 kB | Without provenance | Details for opencode_cli-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opencode_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for opencode_cli-0.1.1-py3-none-any.whl |
Total release size: 9.4 kB
Release files / opencode_cli-0.1.1.tar.gz
| Download URL | opencode_cli-0.1.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0acf32e6c3fc1ecc6b2a635cd48bdf6042ff5a8df5e9a25ee59fdcda905361e2
|
|
BLAKE2b-256 checksum How to use checksums |
3b01fb00c9768dd903882a71ceb4aec591f349127eee45408a4cdee3258b51b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.3
|
Release files / opencode_cli-0.1.1-py3-none-any.whl
| Download URL | opencode_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da4ddd9b79c8d06ad2db44b22339df434a31506c562bf5d4ad8e2a4f47098a33
|
|
BLAKE2b-256 checksum How to use checksums |
7e670f1f78167fc0617c21277349df7db26228a45ab9cc711cbe259642b8a9c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.3
|
Security for opencode-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.