Debian Codegraph @

/

0 files · 0 symbols
README (full)

clnkr

CI

A coding agent CLI that gives the model bash and little else.

alacritty-2026-05-09-220219

Warning: clnkr executes bash directly. There is no permission system and no sandbox. Run it only in environments you are willing to trust and break.

Quick start

Install with Homebrew:

brew install clnkr-ai/tap/clnkr

Or install the Debian package from the latest release:

curl -fsSLO https://github.com/clnkr-ai/clnkr/releases/download/v<VERSION>/clnkr_<VERSION>-1_<ARCH>.deb
sudo dpkg -i ./clnkr_<VERSION>-1_<ARCH>.deb

Install from source with Go:

go install github.com/clnkr-ai/clnkr/cmd/clnkr@latest
go install github.com/clnkr-ai/clnkr/cmd/clnkrd@latest

Set a provider and run:

export CLNKR_API_KEY=your-api-key
export CLNKR_PROVIDER=anthropic
export CLNKR_MODEL=claude-sonnet-4-6

clnkr

At the prompt, ask for a task. clnkr proposes bash commands and asks before it runs each batch.

Run unattended:

clnkr -p "find all TODO comments in this project"

Skip approvals:

clnkr --full-send

Surfaces

clnkr is the interactive terminal REPL. Use it when a human is present to approve commands, answer clarification questions, and steer the session.

clnkr -p is the unattended one-shot surface. Use it from a shell, script, or automation when a task should run to completion and exit. Single-task runs save the normal project session by default, so clnkr --continue can resume them.

clnkrd is the stdio JSONL adapter for tools that embed clnkr behavior. A frontend writes JSONL commands to stdin and reads JSONL events from stdout. It is not a daemon framework, service host, or model delegation mechanism.

Usage

Common workflows:

  • Run interactively with approval before each command batch
  • Run unattended with -p
  • Resume project sessions with --continue
  • Stream JSONL event logs with --event-log
  • Save and load transcripts with --trajectory and --load-messages

One-shot task:

clnkr -p "add tests for config loading"

Resume the latest session for the current project:

clnkr --continue

Compact older transcript history:

/compact

Inputs such as /delegate ... are ordinary prompt text, not host commands.

Emit events or reuse transcripts:

clnkr -p "fix the build" --event-log /tmp/events.jsonl
clnkr -p "investigate the bug" --trajectory /tmp/investigation.json
clnkr -p "write a fix based on the investigation" --load-messages /tmp/investigation.json

Embed clnkr through the clnkrd JSONL adapter:

workdir=$(mktemp -d /tmp/clnkr-processes.$$.XXXXXX)
printf '%s\n' '{"type":"prompt","text":"inspect README.md; do not edit","mode":"full_send"}' |
  clnkrd --event-log "$workdir/events.jsonl" > "$workdir/out.jsonl" 2> "$workdir/err"
sed -n '1,200p' "$workdir/out.jsonl"

OpenAI-compatible endpoint:

clnkr --provider openai --base-url http://gpu-host:8000/v1 --model my-model
clnkr --provider openai --base-url http://localhost:11434/v1 --model llama3
clnkr --provider openai --base-url http://proxy:4000/v1 --model gpt-4o

The endpoint must support structured outputs.

Full CLI reference: doc/clnkr.1.md.

Configuration

Set CLNKR_API_KEY. Everything else can come from flags or environment variables.

VariableDescription
CLNKR_API_KEYAPI key for the LLM provider (required)
CLNKR_PROVIDERProvider: anthropic or openai
CLNKR_MODELModel name (overridden by --model)
CLNKR_BASE_URLLLM endpoint (overridden by --base-url)

clnkr builds its system prompt from the built-in prompt plus AGENTS.md files in the user home directory, the XDG config directory, and the current working directory.

Prompt controls:

clnkr --dump-system-prompt
clnkr --dump-system-prompt -p
clnkr --system-prompt-append "Prefer targeted tests first"
clnkr --no-system-prompt

How it works

At each step, clnkr:

  1. Send the conversation to the LLM.
  2. Get back a question, command batch, or final answer.
  3. Ask the user when the model needs clarification.
  4. Ask for approval before running commands, unless --full-send or -p is set.
  5. Send command results back to the model.
  6. Print the final answer.

Architecture discussion: doc/clnkr.7.md. Library/API reference: doc/clnkr.3.md.

Development

git clone https://github.com/clnkr-ai/clnkr.git
cd clnkr

make help       # Show all targets
make build      # Build shipped binaries
make check      # Full quality suite
make test       # Tests only

License

Apache-2.0

dir .agents/
dir .claude/
dir .githooks/
dir .github/
dir cmd/
dir debian/
dir doc/
dir evaluations/
dir internal/
dir scripts/
dir site/
dir specs/
file .gitignore
file .golangci.yml
file AGENTS.md
file CHANGELOG.md
file CLAUDE.md
file LICENSE
file Makefile
file README.md
file SECURITY.md
file act_protocol.go
file act_protocol_test.go
file act_turn_executor.go
file agent.go
file agent_test.go
file compact.go
file completion_gate.go
file events.go
file executor.go
file executor_test.go
file go.mod
file prompt.go
file prompt_test.go
file protocol.go
file protocol_test.go
file run_policy.go
file turn_canonical.go
file turnschema.go
file turnschema_test.go
file types.go