CLI
The irag CLI provides terminal access to IntelliRag’s code intelligence. Use it in scripts, CI pipelines, or as a quick alternative to the MCP tools.
Installation
Section titled “Installation”go install github.com/intellirag/intellirag.io/cli/cmd/irag@latestDownload the latest binary for your platform from the GitHub releases page. After downloading:
chmod +x iragsudo mv irag /usr/local/bin/brew install intellirag/tap/iragVerify the installation:
irag versionAuthentication
Section titled “Authentication”Browser login (recommended)
Section titled “Browser login (recommended)”Log in with your browser - supports SSO through your organization’s identity provider:
irag auth loginThis opens your browser to the IntelliRag login page. After authenticating, the browser redirects back and your credentials are stored locally at ~/.config/irag/credentials.json. Subsequent commands use these credentials automatically, refreshing the access token as needed.
Check your login status:
irag auth statusLog out and remove stored credentials:
irag auth logoutAPI key (CI/headless environments)
Section titled “API key (CI/headless environments)”For CI pipelines, Docker containers, and other non-interactive environments, use an API key instead. The CLI resolves credentials in this order:
--api-keyflag (highest priority)RAG_API_KEYenvironment variable- OAuth2 tokens from
~/.config/irag/credentials.json(fromirag auth login) - Config file at
~/.config/irag/config.yaml
Config file
Section titled “Config file”Create ~/.config/irag/config.yaml:
api_url: https://api.intellirag.ioapi_key: rag_xxxxxxxxxxxxGlobal flags
Section titled “Global flags”| Flag | Short | Description |
|---|---|---|
--api-url |
API server URL | |
--api-key |
API key (overrides env and config file) | |
--output |
-o |
Output format: table, json, yaml (default: table) |
Quick examples
Section titled “Quick examples”Search for code semantically:
irag search "authentication middleware" --repo-id abc123Look up a symbol by its fully qualified name:
irag symbols fqn "com.example.UserService.findById" --repo-id abc123Trace who calls a method:
irag graph callers "com.example.UserService.findById" --depth 3Analyze the impact of changing a class:
irag impact "com.example.User" --repo-id abc123Get JSON output for scripting:
irag debt --repo-id abc123 -o json | jq '.items[] | .file'Next steps
Section titled “Next steps”- CLI Commands - complete reference for all commands
- API Reference - the REST API the CLI wraps