Configurationπ
Brag AI offers several configuration options to customize its behavior. This guide explains the different ways to configure Brag AI.
Environment Variablesπ
Brag AI supports the following environment variables:
Authentication Tokensπ
Environment Variable | Description |
---|---|
GITHUB_API_TOKEN |
GitHub API token for authentication (required for private repositories or to increase rate limits) |
OPENAI_API_KEY |
OpenAI API key for using OpenAI models |
ANTHROPIC_API_KEY |
Anthropic API key for using Claude models |
GEMINI_API_KEY |
Google API key for using Gemini models |
You can set these environment variables in your shell profile or use a .env
file in your project directory.
Example .env
file:
Environment Variable Precedenceπ
Environment variables take precedence over command-line arguments. For example, if you set GITHUB_API_TOKEN
in your environment and also provide --github-api-token
on the command line, the environment variable will be used.
Command-Line Optionsπ
Brag AI has several command-line options that can be used to configure its behavior:
Repository Selectionπ
Option | Description |
---|---|
owner/repo |
The GitHub repository to generate the brag document from (positional argument) |
--user |
The GitHub username to generate the brag document for |
Time Rangeπ
Option | Description |
---|---|
--from |
The start date to generate the brag document for (format: YYYY-MM-DD) |
--to |
The end date to generate the brag document for (format: YYYY-MM-DD) |
--limit |
The maximum number of commits to include in the brag document |
Authenticationπ
Option | Description |
---|---|
--github-api-token |
The GitHub API token to use for authentication |
Outputπ
Option | Description |
---|---|
--output |
The path to save the generated brag document |
--overwrite |
If set, overwrites the output file if it already exists |
AI Model Configurationπ
Option | Description |
---|---|
--model |
The name of the AI model to use for generating the brag document |
--language |
The language to use for generating the brag document |
Model Selectionπ
Brag AI supports a variety of AI models through PydanticAI. You can specify which model to use with the --model
option.
The format for the model name is provider:model-name
. For example:
openai:gpt-4o
anthropic:claude-3-5-sonnet-latest
google-vertex:gemini-2.0-flash
For a full list of supported models, see the PydanticAI documentation.
Default Valuesπ
If not specified, Brag AI uses the following default values:
- User: The owner of the GitHub API token, if provided
- From date: None (no lower bound)
- To date: None (the current date)
- Limit: None (no limit)
- Output: stdout (print to console)
- Model:
google-gla:gemini-2.0-flash
- Language: English
Example Configurationsπ
Generate a brag document for contributions in 2023 using GPT-4oπ
export OPENAI_API_KEY=your-openai-api-key
brag from-repo owner/repo --user github-username --from 2023-01-01 --to 2023-12-31 --model openai:gpt-4o
Generate a brag document in Portuguese using Claudeπ
export ANTHROPIC_API_KEY=your-anthropic-api-key
brag from-repo owner/repo --user github-username --language PortuguΓͺs --model anthropic:claude-3-5-sonnet-latest