Skip to content
clebertPublic

About

A terminal coding agent in one Zig program, with no dependencies.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Drinky

Drinky is a terminal coding agent in one Zig program, with no dependencies. The website drinky.dev shows an example session.

Why Drinky

A coding agent reads your code, runs commands, and holds your credentials. Drinky is one program that you can read, build from source, and change.

  • No dependencies. build.zig.zon names no package. The build downloads no third-party code and makes one binary.
  • A visible prompt. The fixed core of the system prompt has seven lines. /system shows the system prompt with your instructions.
  • Eight tools. The model gets read, write, edit, find, grep, bash, subagent, and describe_drinky. Drinky has no plugin system and calls no MCP server.
  • Fork it and own it. The repository holds the instructions, the skills, and the check script that a coding agent needs. Let your agent change what you do not like.
  • No history, no telemetry. Old conversations are a privacy risk, so Drinky keeps none. A quit ends the conversation. /gist carries a task into a clean conversation. Only the resume, which is off by default, keeps the open conversation in a file.
  • No vendor lock-in. Sign in with a Claude, ChatGPT, or Grok plan, or pay per token at seven providers.

Build and run

Drinky requires Zig 0.17.1 and macOS or Linux. Drinky has no prebuilt binary. Read Sandbox and security before the first run, because Drinky asks for no approval before a tool call.

git clone https://github.com/clebert/drinky
cd drinky
zig build -Doptimize=safe
./zig-out/bin/drinky

Type /login to sign in and /model to select a model. To use Drinky in another project, copy zig-out/bin/drinky to a directory on your PATH. A terminal with the Kitty keyboard protocol and grapheme cluster processing gives the best experience.

Accounts

Provider Plan Pay per token
Anthropic Claude Login or API key
OpenAI ChatGPT API key
xAI Grok API key
OpenRouter Login or API key
DeepSeek API key
Google Service account key
Thinking Machines Tinker API key

The Google account reads GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_LOCATION. It uses Gemini on Gemini Enterprise Agent Platform (Vertex AI). /model fetches the model list from the provider, so a new model needs no Drinky update.

Drinky is not affiliated with the providers. You use each account at your own risk. Make sure that the terms of your provider allow this use.

Use

Type / to list the commands. Ask Drinky about its commands, key bindings, or config. The agent reads a built-in reference and can change the config file for you.

Command Effect
/login, /model, /effort Select the account, the model, and the reasoning effort.
/gist, /gists Write a gist of the task, or continue a task from a gist.
/rewind Return to an earlier prompt. Tool changes stay.
/verbose Show or hide each tool call and the thinking text.
/system, /sources Show the system prompt, the instruction files, and the skills.
/new Clear the conversation.
  • Terminal. Drinky writes the conversation into the normal scrollback of the terminal. Search, selection, and copy work as in the shell. The layout adapts to a phone screen.
  • Instructions and skills. Drinky reads each AGENTS.md file from the Git root down to the working directory. It finds skills in ~/.agents/skills/ and in each .agents/skills/ directory on that path.
  • Required skills. The required_skills config key pairs a path pattern with a skill. The write and edit tools refuse a matching file until the conversation holds the skill.
  • Subagents. The subagent tool starts a second Drinky with a model of any signed-in account. For example, a GPT model can review the work of a Claude conversation.
  • Headless mode and MCP. The drinky run command answers one prompt from stdin. The drinky mcp command lets a local MCP client send work to a running Drinky instance. For example, you can control Drinky by voice through Codex. /mcp turns this access on or off.

The optional ~/.drinky/config.json file sets instruction files, required skills, limits, and interface settings. .agents/SYSTEM.md is an example of an instruction file.

Rex

Rex is a terminal with a built-in multiplexer. Drinky supports the Rex functions below.

  • Status. Rex shows when Drinky works, waits for you, or has a result. Drinky reports its state through the Program Status Protocol (OSC 7501). Herdr gets the same status.
  • Resume. After a reboot, Rex can start Drinky again, and the conversation continues. Drinky uses the Program Resume Protocol (OSC 7577). Resume is off by default. To turn it on, set the session.resume config key to true. Then add a trust rule for the absolute path of Drinky to the Rex config.
  • Tabs. rex skill setup installs a Rex skill that Drinky finds. The agent can then open a dev server or a preview in a separate Rex tab. The dev server continues after the turn.
  • Remote access. A Rex app on another device, such as a phone, shows the same tab.

With resume on, a conversation in Rex lives as long as its tab. Drinky keeps the open conversation in an owner-only file in ~/.drinky/sessions/. A quit deletes the file. A signal or the loss of the terminal keeps the file. A start without --resume deletes each file that is older than 7 days. The session.retention_days config key sets that number of days.

Sandbox and security

On macOS, a sandbox lets the tools write only to the project, the temporary and cache directories, and the account and config files of Drinky. Reads and the network stay open. Linux has no sandbox.

A build tool that writes to another directory, such as Cargo to ~/.cargo, fails with Operation not permitted. Add each such directory to ~/.drinky/sandbox.json, and then clear the conversation with /new. The tools cannot change this file.

{ "writable_directories": ["~/.cargo", "~/go", "~/Library/Caches/go-build"] }

The sandbox guards against mistakes of the agent, not against a hostile agent. Run Drinky in a container or a virtual machine for an untrusted repository. MCP access starts off unless the config file turns it on. While it is on, any process of the same user can submit work to the instance.

License

Drinky is available under the MIT License.

About

A terminal coding agent in one Zig program, with no dependencies.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages