Skip to content

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 && push

Exit Codes

gcop-rs uses standard exit codes:

CodeMeaning
0Success (also used when you cancel from interactive menus)
1Runtime error (API error, git error, config error, etc.)
2CLI 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"
fi

Environment Variables

These environment variables affect gcop-rs behavior:

CI Mode (simplified configuration)

VariableDescription
CI=1Enable CI mode with simplified provider configuration
GCOP_CI_PROVIDERProvider type: claude, openai, ollama, or gemini (required in CI mode)
GCOP_CI_API_KEYAPI key for the provider (required in CI mode)
GCOP_CI_MODELModel name (optional, has defaults)
GCOP_CI_ENDPOINTCustom 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 commit

General Configuration

VariableDescription
GCOP__*Override config values (use double underscores for nesting, e.g., GCOP__UI__COLORED=false)
GCOP__UI__LANGUAGEForce UI language early in startup (double underscores, same as other nested keys)
VISUAL / EDITOREditor 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 commit

See Also