Christina is a terminal commit assistant for Git repositories. Stage your changes,
run christina, and it turns the staged diff into a Conventional Commit message
using your configured Azure OpenAI deployment. The generated message is shown for
review before Git writes anything, with inline editing, regeneration, dry-run, and
non-interactive modes available for different workflows.
Large commits are handled through the same flow: Christina budgets the diff locally, chunks oversized inputs when needed, includes recent commit history as style context, and reduces chunk summaries into one final message. It sends data directly to the configured provider; there is no Christina-hosted service in the middle.
- Staged-Diff Workflow: Only staged changes are considered, so the proposed message describes exactly what Git is about to commit. If the index is empty, Christina exits before contacting the model.
- Conventional Commit Validation: Generated messages are cleaned and checked against configurable validation modes (
strict,soft, ordisabled). Subject length can be bounded so the result stays compatible with conventional tooling and local commit style. - Large-Diff Chunking: Oversized diffs are budgeted with local
tiktokencounting, split into manageable chunks, summarized concurrently, and reduced into one final message. Lockfiles can be capped separately so dependency churn does not consume the whole prompt. - Commit History Context: Recent commit subjects can be included as style context for the generator. History is trimmed against the token budget, which keeps it useful without crowding out the staged diff.
- Interactive Confirmation: The generated message is shown before commit creation, with options to accept, edit inline, regenerate, or decline.
--yeskeeps the same pipeline available for non-interactive use. - Secure Profile Storage: Provider profiles support literal values, environment references (
env:NAME), and keyring references (keyring:NAME) when thekeyring-supportfeature is enabled. Secrets are resolved at runtime instead of being printed through normal config output. - Diagnostic Trace Mode:
--traceprints generation stages, budget warnings, repository stats, and commit outcome details. It is meant for understanding slow generations, provider failures, and unexpected prompt-budget behavior.
Each christina invocation runs through a fixed sequence of stages:
- Read: Christina opens the current Git repository, verifies that the index contains staged changes, and builds a staged diff. Unstaged files are ignored completely, so the generated message matches exactly what Git is about to commit.
- Configure: Runtime settings are loaded from the global config, safe local overrides, the active profile, and environment variables. Provider credentials are resolved from literal values, environment references, or keyring references before any model request is made.
- Contextualize: Staged file names, optional
--contexttext, and recent commit subjects are prepared as prompt context. User context and history are trimmed against the token budget instead of being allowed to crowd out the staged diff. - Analyze: Small diffs are sent through the direct prompt path. Large diffs are split into budgeted chunks, summarized concurrently, and reduced into a final intent summary before message generation.
- Validate: The generated message is cleaned, checked against the configured Conventional Commit validation mode, and constrained by the configured subject length. Trace mode reports budget warnings and generation stages when the pipeline needs inspection.
- Commit: The proposed message is shown for confirmation. The operator can
accept, edit inline, regenerate, decline, or use
--dry-runto stop before Git writes the commit.
Christina currently ships from source.
- Rust stable toolchain with edition 2024 support
justfor development commands- An Azure OpenAI chat deployment
git clone https://github.com/yehezkieldio/christina.git
cd christina
cargo build --release -p christinaThe binary is placed at ./target/release/christina.
To install from this checkout:
cargo install --path christinaChristina currently supports Azure OpenAI.
christina profile create azure \
--provider azure \
--model gpt-4o \
--api-key env:AZURE_OPENAI_API_KEY \
--api-url https://your-resource.openai.azure.com/openai/deployments/gpt-4o/chat/completions \
--azure-api-version 2024-12-01-preview \
--azure-deployment-id gpt-4o
christina profile switch azureThen provide the secret through the referenced environment variable:
export AZURE_OPENAI_API_KEY=your-api-keyYou can see the global config path with:
christina config pathgit add path/to/file.rschristinaUseful variants:
christina --dry-run
christina --yes
christina --context "rename the parser state machine"
christina --traceConfiguration is loaded in ascending priority:
- Global config:
~/.config/christina/config.tomlon Linux and macOS, or the platform equivalent. - Local repository override:
./christina.tomlfor safe repository-local settings. - Active profile values.
- Environment variables.
Selected environment overrides:
| Variable | Meaning |
|---|---|
CHRISTINA_MODEL_PROVIDER |
Provider kind. Currently azure. |
CHRISTINA_MODEL |
Model name sent to the provider. |
CHRISTINA_MODEL_API_KEY |
API key value. |
CHRISTINA_MODEL_API_URL |
Azure chat completions URL. |
CHRISTINA_AZURE_API_VERSION |
Azure API version. |
CHRISTINA_AZURE_DEPLOYMENT_ID |
Azure deployment id. |
CHRISTINA_TOKENS_MAX_INPUT |
Maximum input token budget. |
CHRISTINA_TOKENS_OUTPUT |
Maximum output token budget. |
CHRISTINA_MODEL_TEMPERATURE |
Sampling temperature. |
CHRISTINA_REASONING_EFFORT |
Optional provider reasoning effort. |
CHRISTINA_USE_COMMIT_HISTORY |
Enable or disable recent commit history context. |
CHRISTINA_COMMIT_HISTORY_DEPTH |
Number of recent commits to inspect, clamped to 0-50. |
CHRISTINA_CONCURRENCY_LIMIT |
Concurrent map requests, clamped to 1-20. |
CHRISTINA_MAX_FAILURE_RATE |
Allowed partial map failure rate before aborting. |
A complete example lives in config.example.toml.
Christina only reads staged changes. It does not inspect unstaged work, and it will exit before contacting the model when the index is empty.
The current provider surface is Azure OpenAI. The config model and profile CLI are provider-shaped, but this checkout only has the Azure backend wired in.
Local repository config is intentionally narrower than global config. Use
./christina.toml for safe project-level behavior such as ignored files and
validation settings; keep provider credentials in the global config, environment,
or keyring.
Additional notes live under docs/, including the generation pipeline,
design notes, benchmarks, advanced configuration, and contribution notes.
The workspace contains:
christina: CLI, Git integration, configuration loading, Azure provider calls, orchestration, and terminal UI.christina-core: provider-agnostic domain types, config file shapes, tokenizer utilities, prompt construction, chunking, and tests.ui-extractable: small terminal UI extraction experiment used by the workspace.
Common commands:
just check
just clippy
just test
just fmtjust clippy runs with -D warnings. just test expects cargo nextest to be installed.
Dual-licensed under MIT and Apache 2.0.