A terminal UI for Advent of Code.
Browse years/days, view the puzzle text with basic HTML styling, download your personal input, edit a solution in your $EDITOR, run it, and submit answers — all from one TUI.
This is a modular Rust rewrite of the original single-file rust-script:
https://codeberg.org/Vaishnav-Sabari-Girish/dotfiles/src/branch/main/zsh/.local/bin/aoc.rs
- Year / day picker with star progress
- Puzzle description rendered with colours (headings, code, emphasis, links)
- Personal input download (requires session cookie)
- Edit solution in
$VISUAL/$EDITOR(creates a template if missing) - Run the solution (stdin = input, stdout = answers)
- Submit part 1 / part 2 answers
- Clipboard support for puzzle / input / output (
y) - Multiple language presets (D, C, C++, Rust, Python) + custom
- Config and session stored under
~/aoc(or$AOC_DIR)
- Rust toolchain (
cargo) - A terminal that supports the usual TUI features
- Optional clipboard helpers:
wl-copy,xclip,xsel,pbcopy, orclip.exe
(falls back to OSC 52)
git clone https://github.com/craftty-org/aoc-tui
cd aoc-tui
cargo run --releaseOR
cargo install --git https://github.com/craftty-org/aoc-tuiPress S and paste your Advent of Code session cookie
(or export AOC_SESSION).
It is saved to ~/aoc/.session (or $AOC_DIR/.session).
Press L to choose a preset:
| Language | Extension | Run command |
|---|---|---|
| D | .d |
dub run --single --quiet {file} |
| C | .c |
gcc -O2 -o sol_bin {file} -lm && ./sol_bin |
| C++ | .cpp |
g++ -O2 -std=c++20 -o sol_bin {file} && ./sol_bin |
| Rust | .rs |
rust-script {file} |
| Python | .py |
python3 {file} |
| Others | custom | your own command ({file} = solution path) |
Choice is saved in ~/aoc/config.
| Key | Action |
|---|---|
| ↑ / k | Move up |
| ↓ / j | Move down |
| ← / h / Tab | Switch pane |
| → / l | Switch pane |
| Enter | Open selected day |
| L | Language picker |
| S | Set session cookie |
| q / Esc | Quit |
| Key | Action |
|---|---|
| p / i / o | Puzzle / Input / Output tab |
| Tab / ← → | Cycle tabs |
| j / k | Scroll |
| Space / PgDn | Page down |
| PgUp | Page up |
| g / G | Top / bottom |
| e | Edit solution ($EDITOR) |
| r | Run solution |
| 1 / 2 | Submit part 1 / part 2 |
| y | Copy current tab to clipboard |
| R | Refresh puzzle + stars |
| [ / ] | Previous / next day |
| L | Language picker |
| S | Set session cookie |
| q / Esc | Back to picker |
~/aoc/ # or $AOC_DIR
├── config # lang / ext / cmd
├── .session # session cookie
└── 2024/
└── day01/
├── puzzle.html
├── input.txt
└── solution.<ext>
Your program must:
- Read the puzzle input from stdin
- Print the part 1 answer on the first line
- Print the part 2 answer on the second line
Templates for each language already do this.
Original single-file rust-script implementation:
https://codeberg.org/Vaishnav-Sabari-Girish/dotfiles/src/branch/main/zsh/.local/bin/aoc.rs
This repository is a modular conversion of that script into a proper Cargo binary crate.
(c) 2026, Vaishnav-Sabari-Girish
Released under the GPL-3.0 license (See LICENSE).
