A terminal chat client for the DeepSeek API, written in Zig 0.16.0.
- Multi-turn conversation — full message history is sent with each request
- Fenced code blocks rendered as full-width coloured rectangles using truecolor ANSI
- Terminal width detected at runtime via
ioctl(TIOCGWINSZ)for accurate padding - Model selectable at launch via CLI argument
- Zero dependencies — only the Zig standard library
- Zig 0.16.0
- A DeepSeek API key
- A truecolor terminal (kitty, alacritty, iTerm2, GNOME Terminal 3.36+, etc.)
make deploy
# or...
make runThe binary is placed at zig-out/bin/zdsk.
Export your API key, then run:
export DEEPSEEK_API_KEY="your-key-here"
./zig-out/bin/zdskTo use a different model, pass it as the first argument:
./zig-out/bin/zdsk deepseek-chatAvailable models:
| Model | Description |
|---|---|
deepseek-chat |
DeepSeek-V3.2, standard mode |
deepseek-reasoner |
DeepSeek-V3.2, thinking/reasoning mode (default) |
| Input | Action |
|---|---|
| Any text + Enter | Send message |
/exit or /quit |
Quit |
| Ctrl-D | Quit |
- The
write_buffer_sizeonstd.http.Clientis set to 8192 bytes to avoid a known hang with large HTTPS POST payloads (Zig issue #25015). - If stdout is not a TTY (e.g. piped),
termWidthfalls back to 80 columns.