Skip to content

Repository files navigation

Drinky

A dependency-free terminal coding agent you can read end to end.

Give Drinky a prompt in the terminal. The model can read, search, and change files or run commands in the working directory. Drinky talks to:

  • Anthropic
  • OpenAI
  • xAI
  • OpenRouter
  • DeepSeek
  • Gemini Enterprise Agent Platform (Vertex AI)
  • DwarfStar (local)

Drinky is a single Zig program. It needs no Node.js runtime or third-party package tree, so a complete review covers Drinky and the Zig standard library. Use Drinky as it is, or fork it and add the features your workflow needs.

Highlights

  1. Terminal-native: The conversation stays in the normal scrollback. A session is the process, and Drinky saves no conversation to resume.
  2. Telegram remote control: Attach a bot and drive the session from its chat, while the terminal shows the work.
  3. One job: An agent loop and seven tools, with no sub-agents and no workflow mode.
  4. Small system prompt: The compiled prompt states the mechanics. Your instruction files and skills carry every rule about how to work.
  5. Self-describing: The model can read every command, setting, and key binding of Drinky, so it can maintain your config for you.
  6. No compiled-in models: Every model, limit, and price comes from the provider at runtime.

See FEATURES.md for the complete capability overview.

Build and run

Drinky requires Zig 0.16.0, a POSIX system, and the HOME variable. A terminal with the Kitty keyboard protocol and grapheme cluster processing gives the best experience. The project uses Ghostty for development and testing.

Build and run the ReleaseSafe executable:

zig build -Doptimize=ReleaseSafe
./zig-out/bin/drinky

Sign in

An account reads vendor-product, and a model under it reads account/model, as in anthropic-plan/claude-opus-4-8. A -key suffix marks a credential that an environment variable holds or names. The local ds4 account is the exception: it has no product and no credential.

Account Credential
anthropic-plan Claude Pro or Max login
anthropic-api Anthropic Console login, which mints and stores an API key
anthropic-api-key ANTHROPIC_API_KEY
openai-plan ChatGPT login
openai-api-key OPENAI_API_KEY
xai-plan SuperGrok or X Premium login with a device code
xai-api-key XAI_API_KEY
openrouter-api OpenRouter login, which mints and stores an API key
openrouter-api-key OPENROUTER_API_KEY
deepseek-api-key DEEPSEEK_API_KEY
google-cloud-key GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_LOCATION
ds4 none

Run /login to sign in with an account that has no -key suffix. A successful sign-in opens its model or author list. The first row fetches or refreshes that list. Drinky puts the cursor on the remembered model or OpenRouter author when that row is available. Only an active model appears as current. Set the variable of a -key account by hand. For google-cloud-key, set the Agent Platform service account key file in GOOGLE_APPLICATION_CREDENTIALS. Set GOOGLE_CLOUD_LOCATION to eu, us, or global. For ds4, set DS4_BASE_URL to the local base URL, ending at /v1.

Drinky is not affiliated with Anthropic, OpenAI, xAI, OpenRouter, DeepSeek, Google, or DwarfStar.

Cost display

The status line shows the session cost as an estimate, as in ~$0.42, and the tilde marks it. Drinky prices the tokens of the session at the public rates of the model, or takes the charge that a reply states, as an OpenRouter reply does. The figure is informational, and it is not a bill. A subscription account pays no per-token price at all, and Drinky still prints the figure as an orientation about the weight of a session. Drinky never knows the real charge.

The context gauge, the quota window, and the credit pool are different. Each one reports what the provider states.

Slash commands

A line that starts with a slash runs in Drinky and reaches no model. Type / or /help to open the complete command list.

  • /effort — set the reasoning effort.
  • /login — sign in or switch the account.
  • /model — switch the model.
  • /new — clear the conversation.
  • /remote — attach a Telegram bot.
  • /skill — pick a skill.
  • /skill:name — load a skill.
  • /sources — show the loaded instruction files and skills.
  • /status — state the session.
  • /system — show the complete system prompt.

Prompt history

Set prompt_history.enabled to true in ~/.drinky/config.json to enable the history. Tab at the idle prompt opens submitted prompts from every project, newest first. Enter appends the selected prompt to the draft as editable text. Only a submitted terminal prompt without a leading slash enters the history.

Drinky keeps the 100 most recent prompts of at most 8 KiB each in the owner-only ~/.drinky/prompt_history.json, so the file can contain sensitive text. Equivalent line endings, trailing spaces or tabs, and edge blank lines share one entry. The entry keeps the latest submitted text. Delete the file to clear the history. Disabling the history leaves the file unchanged.

Recover a turn

A turn that failed or that you canceled after it committed work leaves a caption above the editor, and Ctrl+N acts on it. Under Failed turn, Ctrl+N asks the model to continue from the committed work. Under Canceled turn, Ctrl+N removes the turn from the conversation and returns your prompt and steering messages to the editor as editable text. Enter then sends the revised prompt.

The removal undoes no file change and no billed usage. A turn that ran write, edit, or bash warns first and removes on the second Ctrl+N. Esc keeps the turn, and the next turn or /new drops the offer.

Telegram remote control

Create a bot with BotFather, run /remote, and paste the token. Drinky shows a pairing code, and the private chat that sends it binds to the bot. A saved bot attaches with one pick.

While a bot is attached, the chat holds the input and the terminal shows the work. A message from the chat runs as a prompt, or queues as steering during a turn. The chat mirrors every answer and event, and one message per turn shows the state and holds a Cancel turn button. /new, /effort, /model, /help, /skill, and /status run from the chat, and the other commands run in the terminal alone. Every exit key in the terminal detaches the bot.

On macOS, run caffeinate -is so the Mac stays awake.

The bot tokens live in the owner-only ~/.drinky/remote.json, and Drinky talks to the Telegram Bot API directly.

Herdr

Inside a Herdr pane, Drinky reports its state over the Herdr socket, so Herdr can notify you when a turn ends or fails. The status line leaves the directory and the branch to the Herdr pane label. This needs no setup.

Configuration

The ~/.drinky/config.json file is optional. It controls instruction files, request and bash limits, required skills, a default effort level, interface settings, and the prompt history switch. Drinky reads the file only at startup and never writes it. You can keep it in version control.

The config file holds no secrets. Credentials, project state, the prompt history, and cached model information live in separate files under ~/.drinky/.

Security

The AGENTS.md files and the skills in a repository are model instructions. Drinky has no permission gate or sandbox. Open an untrusted repository in a container.

Name and inspiration

Drinky takes its name from Homer Simpson's drinking bird, which repeatedly presses Y on his remote nuclear plant workstation.

Drinky takes inspiration for its terminal rendering model from pi.

License

Drinky is available under the MIT License.

About

A dependency-free terminal coding agent you can read end to end.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages