Documentation

Configuration

Configure agent.yaml, pick a model provider, and set env vars.

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

  1. Environment config model_override (from config/<env>.yaml)
  2. CLI flag --model provider:model-id
  3. agent.yaml model.preferred

Identity Files

FilePurpose
SOUL.mdAgent personality, identity, core values
RULES.mdBehavioral constraints and rules
DUTIES.mdJob responsibilities and tasks
AGENTS.mdSub-agent relationships and delegation rules

Models & Providers

Supported Providers

GitClaw supports any model from the following providers out of the box:

ProviderFormatAPI Key Env Var
Anthropicanthropic:claude-sonnet-4-6ANTHROPIC_API_KEY
OpenAIopenai:gpt-4oOPENAI_API_KEY
Googlegoogle:gemini-2.0-flash-001GEMINI_API_KEY
Groqgroq:llama-3.3-70b-versatileGROQ_API_KEY
xAIxai:grok-2-1212XAI_API_KEY
Mistralmistral:mistral-large-latestMISTRAL_API_KEY
OpenRouteropenrouter:anthropic/claude-3.5-sonnetOPENROUTER_API_KEY
Cerebrascerebras:llama3.1-70bCEREBRAS_API_KEY
DeepSeekdeepseek:deepseek-chatDEEPSEEK_API_KEY
Amazon Bedrockamazon-bedrock:anthropic.claude-3-sonnetAWS credentials
Google Vertexgoogle-vertex:gemini-2.5-flashGCP ADC
Azure OpenAIazure-openai-responses:gpt-4oAZURE_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

VariableDescriptionRequired
OPENAI_API_KEYOpenAI API key (voice mode)For voice
ANTHROPIC_API_KEYAnthropic API key (agent brain)For Anthropic models
GEMINI_API_KEYGoogle Gemini keyFor Gemini voice/models
COMPOSIO_API_KEYComposio integrationsOptional
TELEGRAM_BOT_TOKENTelegram bot tokenOptional
LYZR_API_KEYLyzr AI Studio keyFor Lyzr setup
GITCLAW_LYZR_AGENT_IDLyzr agent ID (auto-created)For Lyzr setup
GITCLAW_MODEL_BASE_URLCustom LLM endpoint URLOptional
GITCLAW_PASSWORDPassword-protect the web UIOptional
GITCLAW_ENVEnvironment name (loads config/<env>.yaml)Optional
GROQ_API_KEYGroq API keyFor Groq models
XAI_API_KEYxAI/Grok keyFor xAI models
MISTRAL_API_KEYMistral keyFor Mistral models
OPENROUTER_API_KEYOpenRouter keyFor OpenRouter
DEEPSEEK_API_KEYDeepSeek keyFor DeepSeek models
E2B_API_KEYE2B sandbox keyFor sandbox mode
GITHUB_TOKENGitHub PATFor --repo mode

Built with love by the GitClaw team. MIT License.