Aictrl is a headless, server-side runtime for autonomous AI agent workflows. It is designed for engineers who want to automate complex tasks using agentic models in CI/CD pipelines, cron jobs, or embedded within other applications.
npm i -g @aictrl/cli# Run a one-off task
aictrl run "analyze the security of this repository"
# Use a specific model
aictrl run --model anthropic/claude-3-5-sonnet-latest "refactor the auth module"Aictrl is "headless first". When run in a non-TTY environment, it automatically switches to a mode optimized for automation.
You can pipe content directly into aictrl. This is useful for processing logs, code, or command output.
cat logs.txt | aictrl run "summarize these errors"For programmatic consumption, use --format json to get raw events.
aictrl run --format json "review this PR" | jq '.type'In headless mode, Aictrl automatically rejects all interactive permission requests (like question or plan_enter), ensuring your pipelines never hang.
Set AICTRL_HEADLESS=true in your environment to force headless behavior even in pseudo-TTYs.
Aictrl includes a specialized GitHub agent that can be installed into your repositories to automate PR reviews, issue triage, and code generation.
# Install the GitHub agent in the current repo
aictrl github install- Auto-Push: The agent can commit and push changes directly to your branches.
- PR Creation: It can automatically open Pull Requests for its changes.
- Context Aware: In GitHub Actions, it automatically fetches PR diffs, issue comments, and review history.
- Social Cards: Generates visual summaries of agent sessions.
Engineers can quickly checkout a PR and import the associated agent session:
aictrl pr 123This command will:
- Fetch and checkout PR #123.
- Detect if an Aictrl session was used to generate the PR.
- Import that session locally so you can continue the conversation.
Aictrl supports the Model Context Protocol (MCP).
# Add an MCP server
aictrl mcp add my-tool --url http://localhost:8080
# Add custom TypeScript tools
# Just drop them in .aictrl/tool/Embed Aictrl directly into your TypeScript applications.
import { createAictrlClient } from "@aictrl/sdk"
const client = createAictrlClient({
baseUrl: "http://localhost:4096"
})
const session = await client.session.create({
title: "My Automation Task"
})Aictrl implements the Agent Client Protocol, allowing other ACP-compatible agents to communicate with Aictrl headlessly.
aictrl acpAictrl is a fork of the OpenCode project and is licensed under the MIT License.