Agent Configuration
GitClaw agents are configured via agent.yaml in the agent directory.
Full Schema
spec_version: "0.1.0"
name: my-agent
version: 1.0.0
description: A description of what this agent does
model:
preferred: "anthropic:claude-sonnet-4-6"
fallback:
- "openai:gpt-4o"
- "google:gemini-2.0-flash-001"
constraints:
temperature: 0.7
max_tokens: 4096
top_p: 0.9
top_k: 40
stop_sequences: ["---"]
tools:
- cli
- read
- write
- memory
- capture_photo
- task_tracker
- skill_learner
skills:
- code-review
- deployment
runtime:
max_turns: 50
timeout: 300 # seconds per tool call
# Inheritance (optional)
extends: https://github.com/user/parent-agent.git
# Dependencies (optional)
dependencies:
- name: shared-skills
source: https://github.com/team/shared-skills
version: main
mount: deps/shared
# Sub-agents (optional)
agents:
researcher:
model: "anthropic:claude-haiku-4-5-20251001"
tools: [read, cli]
delegation:
mode: auto # auto | explicit | router
# Plugins (optional)
plugins:
my-plugin:
enabled: true
config:
api_key: "${MY_PLUGIN_KEY}"
# Compliance (optional — for enterprise)
compliance:
risk_level: high
human_in_the_loop: true
data_classification: "confidential"
regulatory_frameworks: [SOX, GLBA]
recordkeeping:
audit_logging: true
retention_days: 2555
review:
required_approvers: 2
auto_review: false
# Serve mode (optional)
serve:
port: 8080
allowed_tools: [lookup_account, get_policy]
constraints:
temperature: 0
max_tokens: 4000
Model Resolution Order
- Environment config
model_override(fromconfig/<env>.yaml) - CLI flag
--model provider:model-id agent.yamlmodel.preferred
Identity Files
| File | Purpose |
|---|---|
SOUL.md | Agent personality, identity, core values |
RULES.md | Behavioral constraints and rules |
DUTIES.md | Job responsibilities and tasks |
AGENTS.md | Sub-agent relationships and delegation rules |
Models & Providers
Supported Providers
GitClaw supports any model from the following providers out of the box:
| Provider | Format | API Key Env Var |
|---|---|---|
| Anthropic | anthropic:claude-sonnet-4-6 | ANTHROPIC_API_KEY |
| OpenAI | openai:gpt-4o | OPENAI_API_KEY |
google:gemini-2.0-flash-001 | GEMINI_API_KEY | |
| Groq | groq:llama-3.3-70b-versatile | GROQ_API_KEY |
| xAI | xai:grok-2-1212 | XAI_API_KEY |
| Mistral | mistral:mistral-large-latest | MISTRAL_API_KEY |
| OpenRouter | openrouter:anthropic/claude-3.5-sonnet | OPENROUTER_API_KEY |
| Cerebras | cerebras:llama3.1-70b | CEREBRAS_API_KEY |
| DeepSeek | deepseek:deepseek-chat | DEEPSEEK_API_KEY |
| Amazon Bedrock | amazon-bedrock:anthropic.claude-3-sonnet | AWS credentials |
| Google Vertex | google-vertex:gemini-2.5-flash | GCP ADC |
| Azure OpenAI | azure-openai-responses:gpt-4o | AZURE_OPENAI_API_KEY |
Custom / OpenAI-Compatible Endpoints
Any endpoint that implements the OpenAI Chat Completions API:
Inline URL:
gitclaw --model "ollama:llama3@http://localhost:11434/v1" --voice --dir ~/assistant
Environment variable:
export GITCLAW_MODEL_BASE_URL=http://localhost:11434/v1
gitclaw --model "ollama:llama3" --voice --dir ~/assistant
In agent.yaml:
model:
preferred: "custom:my-model@https://my-proxy.com/v1"
Supported custom endpoints:
- Ollama (
http://localhost:11434/v1) - LM Studio (
http://localhost:1234/v1) - vLLM (
http://localhost:8000/v1) - LiteLLM (
http://localhost:4000/v1) - Lyzr AI Studio (
https://agent-prod.studio.lyzr.ai/v4/chat) - Any OpenAI-compatible proxy
Lyzr Integration
GitClaw integrates with Lyzr AI Studio as an agent brain. The Lyzr completions endpoint is fully OpenAI-compatible.
Via installer (easiest):
curl -fsSL https://raw.githubusercontent.com/open-gitagent/gitclaw/main/install.sh | bash
# Pick option 1: "Install with LYZR"
# Enter your Lyzr API key — agent is created automatically
Via CLI flag:
export OPENAI_API_KEY="your-lyzr-api-key" # Lyzr uses standard Bearer auth
gitclaw --model "lyzr:<agent-id>@https://agent-prod.studio.lyzr.ai/v4" --voice --dir ~/assistant
Via SDK (programmatic):
import { query } from "gitclaw";
// Set OPENAI_API_KEY to your Lyzr API key (uses standard Bearer auth)
process.env.OPENAI_API_KEY = process.env.LYZR_API_KEY;
const result = query({
prompt: "Hello! What can you help me with?",
dir: "/path/to/agent",
model: `lyzr:${LYZR_AGENT_ID}@https://agent-prod.studio.lyzr.ai/v4`,
constraints: { temperature: 0.7, maxTokens: 2000 },
});
for await (const msg of result) {
if (msg.type === "assistant") console.log(msg.content);
}
How it works:
- Base URL:
https://agent-prod.studio.lyzr.ai/v4(OpenAI SDK appends/chat/completions) - Auth:
Authorization: Bearer <LYZR_API_KEY>(standard OpenAI-compatible) - Model field: your Lyzr agent ID (e.g.,
69d52b90a011dc91d7877bfd) - Full example:
examples/lyzr-sdk.ts
Environment Variables
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY | OpenAI API key (voice mode) | For voice |
ANTHROPIC_API_KEY | Anthropic API key (agent brain) | For Anthropic models |
GEMINI_API_KEY | Google Gemini key | For Gemini voice/models |
COMPOSIO_API_KEY | Composio integrations | Optional |
TELEGRAM_BOT_TOKEN | Telegram bot token | Optional |
LYZR_API_KEY | Lyzr AI Studio key | For Lyzr setup |
GITCLAW_LYZR_AGENT_ID | Lyzr agent ID (auto-created) | For Lyzr setup |
GITCLAW_MODEL_BASE_URL | Custom LLM endpoint URL | Optional |
GITCLAW_PASSWORD | Password-protect the web UI | Optional |
GITCLAW_ENV | Environment name (loads config/<env>.yaml) | Optional |
GROQ_API_KEY | Groq API key | For Groq models |
XAI_API_KEY | xAI/Grok key | For xAI models |
MISTRAL_API_KEY | Mistral key | For Mistral models |
OPENROUTER_API_KEY | OpenRouter key | For OpenRouter |
DEEPSEEK_API_KEY | DeepSeek key | For DeepSeek models |
E2B_API_KEY | E2B sandbox key | For sandbox mode |
GITHUB_TOKEN | GitHub PAT | For --repo mode |
Built with love by the GitClaw team. MIT License.
