No description
  • TypeScript 97.7%
  • Shell 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maxim Slipenko 2e07f64af8
All checks were successful
ci / test (push) Successful in 44s
release / release (push) Successful in 41s
ci: add release workflow
2026-10-16 18:42:46 +03:00
.forgejo/workflows ci: add release workflow 2026-10-16 18:42:46 +03:00
scripts init 2026-10-16 17:10:07 +03:00
src init 2026-10-16 17:10:07 +03:00
test init 2026-10-16 17:10:07 +03:00
.gitignore init 2026-10-16 17:10:07 +03:00
.pre-commit-config.yaml init 2026-10-16 17:10:07 +03:00
bun.lock init 2026-10-16 17:10:07 +03:00
LICENSE init 2026-10-16 17:10:07 +03:00
mise.toml init 2026-10-16 17:10:07 +03:00
package.json ci: add release workflow 2026-10-16 18:42:46 +03:00
README.md init 2026-10-16 17:10:07 +03:00
tsconfig.json init 2026-10-16 17:10:07 +03:00

agent-action-harness

Runs an LLM agent in Forgejo Actions. Configured via environment variables.

export ANTHROPIC_API_KEY=...
export AGENT_PROMPT="Review this PR"
export AGENT_MODEL=anthropic/claude-sonnet-4
./agent-action-harness

Provider keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...) are picked up automatically. For an OpenAI-compatible endpoint (vLLM, Ollama, ...):

export AGENT_PROVIDER_NAME=ollama
export AGENT_PROVIDER_BASE_URL=http://localhost:11434/v1
export AGENT_PROVIDER_API=openai-completions
export AGENT_PROVIDER_MODELS='[{"id":"llama3.1:8b"}]'
export AGENT_MODEL=ollama/llama3.1:8b

Exits with 1 on configuration, model or timeout errors.

Environment

Variable Description Default
AGENT_PROMPT Prompt
AGENT_PROMPT_FILE Prompt file, instead of AGENT_PROMPT
AGENT_SYSTEM_PROMPT System prompt
AGENT_SYSTEM_PROMPT_FILE System prompt file
AGENT_MODEL Model, e.g. anthropic/claude-sonnet-4
AGENT_THINKING_LEVEL Thinking level: off, minimal, low, medium, high, xhigh, max off
AGENT_API_KEY API key for AGENT_API_KEY_PROVIDER
AGENT_API_KEY_PROVIDER Provider for AGENT_API_KEY
AGENT_PROVIDER_BASE_URL Custom provider endpoint
AGENT_PROVIDER_NAME Custom provider name openai
AGENT_PROVIDER_API_KEY Custom provider API key
AGENT_PROVIDER_API Custom provider API: openai-completions, anthropic-messages, ...
AGENT_PROVIDER_MODELS Custom provider models, JSON array
AGENT_MCP_URL MCP server URL
AGENT_MCP_SERVER_NAME Name of the AGENT_MCP_URL server mcp
AGENT_MCP_INCLUDE_TOOLS Tools to expose from AGENT_MCP_URL, comma-separated
AGENT_MCP_LIFECYCLE When to connect to MCP servers: eager, lazy eager
AGENT_MCP_CONFIG MCP config, JSON ({"mcpServers": {...}})
AGENT_FORGEJO_MCP Run the built-in forgejo-mcp false
AGENT_FORGEJO_MCP_URL External forgejo-mcp URL
FORGEJO_SERVER_URL Forgejo URL, set by Forgejo Runner
FORGEJO_TOKEN Token for forgejo-mcp, set by Forgejo Runner
AGENT_BUILTIN_TOOLS Built-in tools to enable, comma-separated
AGENT_DISABLE_BUILTIN_TOOLS Disable built-in tools false
AGENT_EXCLUDE_TOOLS Tools to disable, comma-separated
AGENT_CWD Working directory, defaults to the current one
AGENT_TIMEOUT_MS Timeout, ms 300000
AGENT_MAX_RETRIES Retries on model errors 2
AGENT_COMPACTION_ENABLED Compact context when it overflows false
AGENT_OUTPUT_FILE File to write the result to
AGENT_OUTPUT_MODE Result format: text, json text
AGENT_DEBUG Debug logging false

Build

Requires bun, go and git (see mise.toml).

bun install
bun run build   # also builds forgejo-mcp from source and embeds it
bun test
bun run docs    # regenerate the table above

License

GPL-3.0-or-later. The binary embeds forgejo-mcp (GPL-3.0).