Required API keys
GitHub Personal Access Token
The GitHub Personal Access Token is required to authenticate with GitHub’s API and fetch repository files. RepoRAGX uses this token with LangChain’sGithubFileLoader (src/rag/github_codebase_loader.py:37) to access repository contents.
Navigate to GitHub settings
Go to github.com/settings/tokens and click “Generate new token”
Configure permissions
Grant the token read-only access with the
content:read permission. This allows RepoRAGX to read repository files without write access.Groq API Key
The Groq API Key provides access to Groq’s high-speed LLM inference service. RepoRAGX uses this for generating context-aware answers based on retrieved code chunks.Sign up for Groq
Visit console.groq.com and create a free account
Navigate to API keys
Go to console.groq.com/keys in the Groq console
Providing API keys
RepoRAGX supports two methods for providing API keys:Interactive prompt (recommended)
When you runpython -m src.main, you’ll be prompted to enter your API keys securely:
getpass module (src/main.py:25-26) to securely read the keys without displaying them in your terminal.
Environment variables
You can also set environment variables using a.env file:
If keys are provided both via environment variables and interactive prompts, the interactive prompt values will override environment variables (src/main.py:27-28).
Security best practices
Protecting your keys
- Never hardcode API keys directly in source code
- Use .gitignore to exclude
.envfiles from version control - Rotate keys regularly if you suspect they may have been exposed
- Use fine-grained tokens with minimal required permissions
- Set expiration dates on GitHub tokens when possible
- Store keys securely using password managers or secret management services