@invertase/gitbash
v0.2.1
Published
CLI for asking questions about GitHub repos through gitbash.ai
Downloads
343
Readme
gitbash
gitbash is a terminal CLI for asking questions about GitHub repositories.
Install it globally:
npm i -g @invertase/gitbashThen use it locally:
gitbash --repo invertase/react-native-firebase "How does auth work?"Quick start
Set your defaults once:
gitbash config \
--model anthropic/claude-haiku-4-5 \
--anthropic-token "$ANTHROPIC_API_KEY"Then ask questions:
gitbash --repo invertase/react-native-firebase "How does auth work?"
gitbash --repo invertase/react-native-firebase --ref next "Summarize the Firebase app setup"
gitbash "Tell me about invertase/react-native-firebase"If --repo is omitted, gitbash will try to infer owner/repo from the prompt.
Models
--model supports provider-prefixed models such as:
anthropic/claude-haiku-4-5openai/gpt-4.1google/gemini-2.5-flashxai/grok-4localorlocal/<model-id>: OpenAI-compatible servers on your machine (LM Studio, Ollama/v1, etc.)
Examples:
gitbash --model anthropic/claude-haiku-4-5 --repo invertase/react-native-firebase "Explain auth"
gitbash --model openai/gpt-4.1 --repo invertase/react-native-firebase "Explain auth"
gitbash --model google/gemini-2.5-flash --repo invertase/react-native-firebase "Explain auth"
gitbash --model xai/grok-4 --repo invertase/react-native-firebase "Explain auth"Local LLM (example: LM Studio serving at http://localhost:1234/v1):
export GITBASH_LOCAL_BASE_URL=http://localhost:1234/v1
gitbash --model local --repo invertase/react-native-firebase "Summarize the README"
# or pin a model id your server exposes:
gitbash --model local/qwen2.5-coder-7b --local-base-url http://localhost:1234/v1 --repo invertase/react-native-firebase "Explain auth"local uses the server default model; local/<id> names a specific model. An API key is optional for most local servers; use --local-token or GITBASH_LOCAL_API_KEY if yours requires one.
Bare Anthropic model names also work:
gitbash --model claude-haiku-4-5 --repo invertase/react-native-firebase "Explain auth"That is treated as anthropic/claude-haiku-4-5.
Config
Configuration is stored in ~/.gitbash/config.json.
Set a default model and token:
gitbash config \
--model google/gemini-2.5-flash \
--google-token "$GOOGLE_GENERATIVE_AI_API_KEY"Store multiple provider tokens:
gitbash config \
--anthropic-token "$ANTHROPIC_API_KEY" \
--openai-token "$OPENAI_API_KEY" \
--google-token "$GOOGLE_GENERATIVE_AI_API_KEY" \
--xai-token "$XAI_API_KEY"Default local OpenAI-compatible base URL and model (optional --local-token if your server needs it):
gitbash config \
--model local \
--local-base-url http://localhost:1234/v1Override config for one command:
gitbash \
--model openai/gpt-4.1 \
--openai-token "$OPENAI_API_KEY" \
--repo invertase/react-native-firebase \
"How does auth work?"Flags
--repo <owner/repo>: repository to inspect--ref <ref>: git ref to mount, defaults tomain--model <provider/model>: model to use--token <token>: generic provider token--anthropic-token <token>: Anthropic API token--openai-token <token>: OpenAI API token--google-token <token>: Google API token--xai-token <token>: xAI API token--local-base-url <url>: OpenAI-compatible API base URL forlocalmodels (e.g.http://localhost:1234/v1)--local-token <token>: optional API key for local OpenAI-compatible servers--api-url <url>: override the gitbash API base URL
Environment variables
You can use environment variables instead of flags:
GITBASH_MODELGITBASH_API_URLGITBASH_API_TOKENGITBASH_ANTHROPIC_API_KEYorANTHROPIC_API_KEYGITBASH_OPENAI_API_KEYorOPENAI_API_KEYGITBASH_GOOGLE_API_KEY,GOOGLE_GENERATIVE_AI_API_KEY, orGOOGLE_API_KEYGITBASH_XAI_API_KEYorXAI_API_KEYGITBASH_LOCAL_BASE_URL: base URL forlocalmodels (no trailing slash)GITBASH_LOCAL_API_KEY: optional API key for local OpenAI-compatible servers
Resolution order:
- CLI flags
- environment variables
~/.gitbash/config.json- built-in default for
apiUrl
model must be set before a prompt can run. Cloud providers also need a matching API token; the local provider does not require a token unless your server enforces one.
