Skip to main content

English | 中文

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 /prompt to list prompts and switch the active prompt template
  • /m or /model to list models and switch the active model
  • /q to exit the chat session
  • /help to 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.md is configured as project.readme, so PyPI renders this file on the project page.
  • README-zh.md is kept for the GitHub repository and Chinese-language documentation.
  • To update the PyPI project page content, update README.md, bump the version in pyproject.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:

  1. Check whether the version in pyproject.toml changed
  2. Build the sdist and wheel from pyproject.toml
  3. Run twine check dist/*
  4. 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.com
  • xoto@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)

Source distribution for commandchat 0.0.15
File Size Uploaded
commandchat-0.0.15.tar.gz 22.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for commandchat 0.0.15
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.0.15 This release

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page