Automation, Exit Codes, and Environment Variables
Command Chaining
gcop-rs commands can be combined with standard git commands:
bash
# Review then stage + commit
gcop-rs review changes && git add -A && gcop-rs commit
# Commit then push (if using full commands)
gcop-rs commit --yes && git push
# Or use alias
git acp # Equivalent to: add -A && commit && pushExit Codes
gcop-rs uses standard exit codes:
| Code | Meaning |
|---|---|
| 0 | Success (also used when you cancel from interactive menus) |
| 1 | Runtime error (API error, git error, config error, etc.) |
| 2 | CLI usage error (invalid flags/args; generated by clap) |
Usage in scripts:
bash
if gcop-rs commit --yes; then
echo "Commit successful"
git push
else
echo "Commit failed or cancelled"
fiEnvironment Variables
These environment variables affect gcop-rs behavior:
CI Mode (simplified configuration)
| Variable | Description |
|---|---|
CI=1 | Enable CI mode with simplified provider configuration |
GCOP_CI_PROVIDER | Provider type: claude, openai, ollama, or gemini (required in CI mode) |
GCOP_CI_API_KEY | API key for the provider (required in CI mode) |
GCOP_CI_MODEL | Model name (optional, has defaults) |
GCOP_CI_ENDPOINT | Custom API endpoint (optional) |
CI Mode Example:
bash
export CI=1
export GCOP_CI_PROVIDER=claude
export GCOP_CI_API_KEY="sk-ant-..."
export GCOP_CI_MODEL="claude-sonnet-4-5-20250929" # optional
gcop-rs commitGeneral Configuration
| Variable | Description |
|---|---|
GCOP__* | Override config values (use double underscores for nesting, e.g., GCOP__UI__COLORED=false) |
GCOP__UI__LANGUAGE | Force UI language early in startup (double underscores, same as other nested keys) |
VISUAL / EDITOR | Editor for commit message editing and gcop-rs config edit |
Config Override Example:
bash
export GCOP__UI__COLORED=false
export GCOP__LLM__DEFAULT_PROVIDER=openai
export EDITOR="vim"
gcop-rs commitSee Also
- Git Aliases Guide - Detailed guide to git aliases
- Configuration Reference - All configuration options
- Provider Setup - Configure LLM providers
- Troubleshooting - Common issues