Skip to content

clnkr-ai/clnkr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

388 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Ask the model to launch a bounded JSONL process:

/delegate inspect cmd/clnkrd and summarize the JSONL contract

clnkr treats /delegate as prompt text. The built-in prompt tells the model to run clnkrd as a normal machine-facing stdio JSONL process, keep process artifacts under /tmp, read stdout/stderr or event logs, and verify important claims in the parent session.

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

Launch clnkrd directly from bash:

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.

Variable Description
CLNKR_API_KEY API key for the LLM provider (required)
CLNKR_PROVIDER Provider: anthropic or openai
CLNKR_MODEL Model name (overridden by --model)
CLNKR_BASE_URL LLM 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

About

pronounced: "CLANK-er." a coding agent CLI.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors