CommandChat
commandchat provides the occ CLI for chatting with OpenAI or Azure OpenAI models from your terminal.
Features
- Interactive CLI chat with
occ chat - Profile-based configuration for multiple OpenAI / Azure OpenAI accounts
- Prompt template management with built-in and custom prompts
- Prompt selection per command or as a profile default
- Experimental image generation command
Requirements
- Python 3.8+
- A terminal with
pip - An OpenAI-compatible API key or Azure OpenAI configuration
Install
pip3 install commandchat
If you manage multiple Python versions locally:
python3 -m pip install commandchat
Quick start
1. Configure your first profile
occ configure
This opens the interactive configuration flow and writes local settings under ~/.occ/.
2. Start chatting
occ chat "Hello, introduce yourself briefly."
You can also start interactive multiline input:
occ chat
Inside interactive chat, you can use slash commands:
/to open the shortcut command menu/pmp,/p, or/promptto list prompts and switch the active prompt template/mor/modelto list models and switch the active model/qto exit the chat session/helpto show the help panel again
When you switch prompts with /pmp or models with /m, the CLI will ask whether you want to keep the current context or start a fresh chat session with a new session id.
Interactive chat also shows a bottom status bar with the current prompt, model, and session id.
3. Use prompt templates
occ prompt list
occ chat -pt translate "你好世界"
occ chat -pt improve "I wants to go to school yesterday"
4. Work with multiple profiles
occ configure profile -p work
occ configure list
occ chat -p work "Summarize today's priorities"
Common commands
| Command | Description |
|---|---|
occ configure |
Open the interactive configuration menu |
occ configure profile -p <name> |
Create or update a profile |
occ configure list |
List configured profiles |
occ configure delete <name> |
Delete a profile |
occ chat "message" |
Send a one-off message |
occ chat |
Start an interactive chat session |
occ chat -p <profile> -m <model> "message" |
Use a specific profile/model |
occ chat -pt <prompt_key> "message" |
Chat with a predefined prompt |
occ chat + / |
Open the interactive shortcut menu |
occ chat + /pmp / /p / /prompt |
Switch prompt inside interactive chat |
occ chat + /m / /model |
Switch model inside interactive chat |
occ prompt list |
List prompt templates |
occ prompt show <key> |
Show prompt details |
occ prompt add <key> -n <name> -d <desc> -s <prompt> |
Add a custom prompt |
occ image -desc "..." -size m |
Generate images |
Files created locally
~/.occ/config: profile and model configuration~/.occ/prompts.json: custom prompt templates
Packaging and PyPI
This project now uses pyproject.toml as the single source of truth for packaging metadata.
README.mdis configured asproject.readme, so PyPI renders this file on the project page.README-zh.mdis kept for the GitHub repository and Chinese-language documentation.- To update the PyPI project page content, update
README.md, bump the version inpyproject.toml, and publish a new release.
Automatic publishing with GitHub Actions
The repository includes .github/workflows/publish-to-pypi.yml.
On pushes to master or manual runs, it will:
- Check whether the version in
pyproject.tomlchanged - Build the sdist and wheel from
pyproject.toml - Run
twine check dist/* - Publish to PyPI via Trusted Publishing (OIDC)
Because the package metadata points to README.md, each new PyPI release also refreshes the PyPI homepage description.
Manual build
python3 -m pip install build twine
python3 -m build
python3 -m twine check dist/*
Uninstall
pip3 uninstall commandchat
Feedback
xxx.tao.c@gmail.comxoto@outlook.be
License
MIT
Release files for commandchat 0.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commandchat-0.0.15.tar.gz | 22.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commandchat-0.0.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.7 kB
Release files / commandchat-0.0.15.tar.gz
| Download URL | commandchat-0.0.15.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7c9720d72620afdddf301b058d0624678fb951566ec8da4214d044ef0ddae71
|
|
BLAKE2b-256 checksum How to use checksums |
e97daf350c8e087f543a088bafa35bfcced05b2568b8ded2354d6c74c3d218f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.
Transparency logRelease files / commandchat-0.0.15-py3-none-any.whl
| Download URL | commandchat-0.0.15-py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d126218a1de043c2fdc8d768f3b41224a2d59fe24eaa41c2f94fba30ccc3012
|
|
BLAKE2b-256 checksum How to use checksums |
d95e86d2265e9432b04adceb58bc596bed6cf594df4b223a23019b57b51a049a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 8, 2026.
Transparency log