Developer Tool Providers

This page covers providers that integrate through local assistant tooling or CLI runtimes instead of a standard remote LLM API. They are useful when LibreFang agents need to reuse an existing coding or terminal-assistant stack.

Included Providers

  • Claude Code
  • GitHub Copilot
  • ChatGPT (Session Token)
  • Kimi Coding
  • Aider
  • Claude Code CLI
  • Codex CLI
  • Gemini CLI
  • Qwen Code

CLI logins as first-class default providers

When you have not set a provider API key but do have a working CLI login (claude, codex, gemini, qwen available on PATH and authenticated), LibreFang will pick the CLI provider as the default model for new agents. The detection runs at startup and is rechecked when the daemon refreshes provider availability.

Detection priority (in order, first match wins):

  1. claude-codeclaude binary on PATH, claude auth status reports an active session.
  2. codex-clicodex binary on PATH, with OPENAI_API_KEY (which the Codex CLI itself needs) set.
  3. gemini-cligemini binary on PATH, authenticated via gemini auth login.
  4. qwen-codeqwen binary on PATH, authenticated.

This behaviour replaced the previous "fallback when API providers fail" heuristic — CLI providers are now treated like any other remote provider. To explicitly override the auto-pick, set [default_model] provider = "anthropic" (or whichever) in config.toml.


Claude Code

Display NameClaude Code
DriverNative Anthropic (Messages API)
Env VarANTHROPIC_API_KEY
Base URLhttps://api.anthropic.com
Key RequiredYes
Free TierNo
Authx-api-key header
ModelsClaude models with extended tool use

Notes: Claude Code is an Anthropic model variant optimized for agentic coding tasks. It uses the same API key and base URL as Anthropic but targets models tuned for long-horizon tool-use workflows.


GitHub Copilot

Display NameGitHub Copilot
DriverOpenAI-compatible (via Copilot token exchange)
Env VarGITHUB_TOKEN
Base URLhttps://api.githubcopilot.com
Key RequiredYes (GitHub PAT or OAuth token)
Free TierIncluded with GitHub Copilot subscription
AuthOAuth PKCE flow; exchanges GitHub PAT for short-lived Copilot API token
ModelsGitHub Copilot-hosted models (GPT-4o, Claude, etc.)

Setup:

  1. Subscribe to GitHub Copilot
  2. Create a Personal Access Token with copilot scope
  3. export GITHUB_TOKEN="ghp_..."

Notes: The Copilot driver handles OAuth PKCE token exchange automatically — it obtains a short-lived Copilot API token from https://api.github.com/copilot_internal/v2/token and caches it with auto-refresh. The Copilot API uses OpenAI-compatible chat completions format. Tokens are refreshed 5 minutes before expiry.


ChatGPT (Session Token)

Display NameChatGPT
Provider IDchatgpt
DriverNative ChatGPT (Responses API)
Env VarCHATGPT_SESSION_TOKEN (primary), CHATGPT_REFRESH_TOKEN (optional)
Base URLhttps://chatgpt.com/backend-api
Key RequiredYes (browser session token)
Free TierSubscription-based (ChatGPT Plus / Pro / Team / Enterprise)
AuthSession token + bearer; OAuth-style refresh with ~7-day TTL

Setup:

  1. Run librefang auth chatgpt (browser-based OAuth flow). The CLI captures the session token and caches it.
  2. The token auto-refreshes 1 hour before expiry; no manual rotation needed.

Minimal config.toml:

[default_model]
provider = "chatgpt"
model = "gpt-4o"

Notes: Uses the proprietary Responses API rather than /v1/chat/completions. This lets agents reuse a paid ChatGPT subscription without a separate OpenAI API key. Tools and vision supported. Embeddings are not available via this driver — use OpenAI hosted instead.


Kimi Coding

Display NameKimi Coding
Provider IDkimi-coding
DriverAnthropic-compatible (Messages API)
Env VarKIMI_API_KEY
Base URLhttps://api.kimi.com/coding
Key RequiredYes
Free TierNo
AuthAuthorization: Bearer header

Setup:

  1. Sign up at the Kimi console and enable the Coding endpoint
  2. Generate an API key under the Coding product
  3. export KIMI_API_KEY="sk-..."

Minimal config.toml:

[default_model]
provider = "kimi-coding"
model = "kimi-coder"

Notes: Coding-specialized variant of Moonshot's stack, exposed in Anthropic Messages API format (not OpenAI-compatible). Uses the same internal driver path as Anthropic, including tool-use schema conversion and vision support. Different env var from MOONSHOT_API_KEY — Kimi Coding uses its own key.


Aider

Display NameAider
TypeCLI Provider
DriverSubprocess (CLI)
Env VarNone (uses its own provider env vars)
Binaryaider (must be on PATH)
Key RequiredNo (uses Aider's own auth)
Free TierDepends on Aider's configured backend

Setup:

  1. Install Aider: pip install aider-install && aider-install
  2. Configure Aider's LLM provider via its own env vars (e.g. OPENAI_API_KEY)
  3. No additional LibreFang configuration needed

Notes: CLI Provider — LibreFang spawns the aider binary as a subprocess in non-interactive mode (--message). Aider handles its own LLM provider authentication via standard environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.). Aider's --yes-always, --no-auto-commits, and --no-git flags are applied automatically. Use AIDER_CLI_PATH to override the binary path.


Claude Code CLI

Display NameClaude Code CLI
TypeCLI Provider
DriverSubprocess (CLI)
Env VarNone (uses its own OAuth session)
Binaryclaude (must be on PATH)
Key RequiredNo (uses Claude Code's own session auth)
Free TierDepends on Claude Code subscription

Setup:

  1. Install Claude Code: npm install -g @anthropic-ai/claude-code
  2. Authenticate: claude auth login
  3. No additional LibreFang configuration needed

Notes: CLI Provider — LibreFang spawns the claude binary as a subprocess in print mode (-p). The driver strips other providers' API keys from the subprocess environment to prevent leakage. Active subprocess PIDs are tracked and message timeouts (default 5 minutes) prevent hung processes from blocking agents. Vision input is supported via base64-encoded images.


Codex CLI

Display NameCodex CLI
TypeCLI Provider
DriverSubprocess (CLI)
Env VarOPENAI_API_KEY (used by the Codex CLI itself)
Binarycodex (must be on PATH)
Key RequiredYes (OpenAI API key for Codex CLI)
Free TierNo

Setup:

  1. Install Codex CLI: npm install -g @openai/codex
  2. export OPENAI_API_KEY="sk-..."
  3. No additional LibreFang configuration needed

Notes: CLI Provider — LibreFang spawns the codex binary as a subprocess in quiet mode (-q). The driver strips other providers' API keys from the subprocess environment (preserving only OPENAI_API_KEY and CODEX_* variables). This allows users with Codex CLI installed to use it as an LLM provider without additional configuration.


Gemini CLI

Display NameGemini CLI
TypeCLI Provider
DriverSubprocess (CLI)
Env VarNone (uses Google OAuth by default)
Binarygemini (must be on PATH)
Key RequiredNo (uses Google OAuth)
Free TierYes (via Google account)

Setup:

  1. Install Gemini CLI: npm install -g @google/gemini-cli
  2. Authenticate: gemini auth login
  3. No additional LibreFang configuration needed

Notes: CLI Provider — LibreFang spawns the gemini binary as a subprocess in print mode (-p). The driver preserves GEMINI_* and GOOGLE_* environment variables while stripping other providers' secrets. No separate API key is needed when using Google OAuth authentication.


Qwen Code

Display NameQwen Code
TypeCLI Provider
DriverSubprocess (CLI)
Env VarNone (uses Qwen OAuth by default)
Binaryqwen (must be on PATH)
Key RequiredNo (uses Qwen OAuth)
Free TierYes (via Alibaba Cloud account)

Setup:

  1. Install Qwen Code: npm install -g @alibaba/qwen-code
  2. Authenticate: qwen auth login
  3. No additional LibreFang configuration needed

Notes: CLI Provider — LibreFang spawns the qwen binary as a subprocess in print mode (-p). The driver preserves QWEN_* environment variables while stripping other providers' secrets. Supports streaming JSON output from the Qwen Code CLI. No separate API key is needed when using Qwen OAuth authentication.