# turboCommit



A CLI that uses OpenAI's GPT-5.6 family to generate conventional commit messages from Git and Jujutsu (JJ) diffs.
## Features
- GPT-5.6 Luna by default, with Terra, Sol, and the `gpt-5.6` Sol alias available
- Concise GPT-5.6 developer instruction plus strict Structured Outputs
- Conventional commit suggestions with optional explanatory bodies
- Interactive selection, direct editing, and AI revision
- Reasoning effort and output verbosity controls
- Git staged-change and amend flows
- JJ revision selection and description rewriting
- YAML configuration via `~/.turbocommit.yaml`
- Optional request, response, usage, and timing diagnostics
## Installation
```bash
cargo install turbocommit
```
Optional alias:
```bash
alias tc='turbocommit'
```
## Usage
Stage changes in Git or make changes in a JJ working copy, then run:
```bash
turbocommit
```
The CLI generates suggestions and lets you select, edit, revise, or apply one.
### Options
- `-n <number>`: suggestions to generate; default `3`
- `-m, --model <model>`: `gpt-5.6-luna`, `gpt-5.6-terra`, `gpt-5.6-sol`, or `gpt-5.6`
- `-e, --reasoning-effort <level>`: `none`, `low`, `medium`, `high`, `xhigh`, or `max`
- `-v, --verbosity <level>`: `low`, `medium`, or `high`
- `-a, --auto-commit`: apply one generated message without interactive selection
- `--amend`: regenerate the last Git commit message from its diff
- `-r, --revision <rev>`: describe a specific JJ revision
- `--rw`: toggle the configured JJ rewrite behavior
- `-c, --config <path>`: load another config file
- `--api-key <key>`: provide the API key directly
- `--api-endpoint <url>`: override the API endpoint
- `--system-msg-file <path>`: load a custom developer instruction; the legacy option name is retained for compatibility
- `-d, --debug`: show request and usage details
- `--debug-file <path>`: write detailed diagnostics to a file, or `-` for stdout
- `--debug-context`: include message contents in diagnostics
- `--select-files`: always prompt for diff file selection
- `--disable-auto-update-check`: skip automatic version checks
Any remaining arguments are sent as a user instruction:
```bash
turbocommit focus on why the cache policy changed
```
## Models and API behavior
The default is `gpt-5.6-luna`, OpenAI's efficient high-volume tier. Use Terra when the diff needs stronger judgment at moderate cost, or Sol for the hardest changes. The `gpt-5.6` alias routes to Sol.
All supported models have a 1,050,000-token context window and support Chat Completions plus Structured Outputs. turboCommit intentionally keeps the bounded `v1/chat/completions` workflow: it sends the application instruction as a `developer` message and constrains results with a strict JSON schema.
The default reasoning effort remains `low` for this latency-sensitive task. The default verbosity is `medium`; output length is primarily controlled through the API parameter rather than repeated prompt instructions.
### Current GPT-5.6 pricing
Per 1M text tokens:
| GPT-5.6 Luna | $1.00 | $0.10 | $6.00 |
| GPT-5.6 Terra | $2.50 | $0.25 | $15.00 |
| GPT-5.6 Sol | $5.00 | $0.50 | $30.00 |
Prompts above 272K input tokens use OpenAI's higher long-context rates. Check OpenAI's model pages for current pricing before relying on these figures.
## Configuration
On first run turboCommit creates `~/.turbocommit.yaml`:
```yaml
model: gpt-5.6-luna
api_endpoint: https://api.openai.com/v1/chat/completions
api_key_env_var: OPENAI_API_KEY
default_number_of_choices: 3
disable_auto_update_check: false
reasoning_effort: low
verbosity: medium
jj_rewrite_default: true
# Omit system_msg to use the built-in developer instruction.
```
`system_msg` is the legacy configuration key for the developer instruction and remains supported to avoid breaking existing configs. Omit it to use the built-in instruction. Missing configuration fields inherit application defaults.
Existing GPT-5.4 configs are not silently rewritten. When upgrading, change `model` to `gpt-5.6-luna` (or another supported tier) and remove the old `system_msg` field to adopt the shorter GPT-5.6 instruction. Help and explicit `-c` configs remain usable while the default config needs migration.
Set the API key in the configured environment variable:
```bash
export OPENAI_API_KEY='...'
```
### Multiple configs
```bash
turbocommit -c ./local-config.yaml
turbocommit -c ~/.turbocommit-azure.yaml
```
## Git amend flow
`--amend` analyzes the previous commit diff and changes only its message. It rejects staged changes so they are not accidentally mixed into the operation.
```bash
turbocommit --amend
turbocommit --amend --auto-commit
```
## Development
A disposable Dev Container is included for Git and JJ integration testing:
```bash
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash
```
## License
MIT. See [LICENSE](LICENSE).