A polished, full-screen terminal Snake game written in Rust. NailSnake runs on Windows, Linux, and macOS — dropping you into the alternate screen buffer with raw keyboard input, just like vim or neovim. It feels like a lightweight GUI without ever leaving your terminal.
Inspired by nsnake, rebuilt with Rust's safety guarantees, richer colour palettes, persistent high-scores, and a proper
manpage.
- Features
- Quick start
- Installation
- Usage
- Configuration & save files
- Requirements
- Documentation
- Contributing
- Security
- License
| Capability | Detail |
|---|---|
| Cross-platform | Windows Terminal, PowerShell, cmd, Linux VTs, macOS Terminal, iTerm2 |
| Vim-like TUI | Alternate screen, hidden cursor, status bar, sidebar info panel |
| Rich colours | Truecolor, 256-colour, and basic ANSI — auto-detected or forced with --color |
| Safe terminal handling | Restores your shell on quit, panic, or Ctrl+C |
| Continue game | Saves an active session on quit/force-quit and offers Continue on next launch |
| Safe resize | Keeps the logical game intact; small windows show a resize warning |
| Difficulty presets | Chill, Normal, Hard, Insane — each with progressive speed-up |
| Arcade menu | nSnake-inspired main menu with settings, help, and an animated Rust-themed backdrop |
| Wrap mode | Optional wall-wrapping instead of instant death |
| Persistent settings | Settings, key bindings, high score, and games played survive restart |
| Manual page | man nailsnake after installing the man page |
cargo run --releaseOr install globally:
cargo install --path .cargo install --path ../installer/install-linux.shInteractive installer that detects the active package manager
(apt, pacman, dnf, zypper, xbps, yum, or apk) and can create
.deb, .pkg.tar.zst, .rpm, .xbps, or generic .tar.gz packages.
./installer/install-termux.shBuilds a Termux-native binary, creates a .tar.gz archive,
and can install it into $PREFIX/bin.
./installer/install-macos.shCreates a CLI-only .pkg that installs to /usr/local/bin.
.\installer\install-windows.ps1Builds nailsnake.exe, installs it under either the current user's local
Programs directory or Program Files, and updates PATH so both cmd.exe and
PowerShell can run nailsnake from a new terminal window.
./scripts/install-man.sh
# or
make install-manThen:
man nailsnake| Key | Action |
|---|---|
Enter |
Start from title screen |
| Configured movement keys | Move (arrow keys by default) |
Configured pause key / Esc |
Pause / resume |
R |
Restart |
Q |
Open the pause menu while playing; quit from the main menu |
Esc |
Pause, go back, or quit from the main menu depending on context |
Ctrl+C |
Force quit (terminal restored) |
nailsnake [OPTIONS]
Options:
-d, --difficulty <DIFFICULTY> chill | normal | hard | insane
-w, --wrap wrap around walls for this launch
-c, --color <COLOR> auto | truecolor | ansi256 | basic
-g, --grid show grid dots for this launch
--about print project information
-h, --help print help (see also: man nailsnake)
-V, --version print version
# Casual
nailsnake
# Bring the heat
nailsnake -d hard --wrap --grid
# Force a specific colour mode
nailsnake --color truecolor
# Print project metadata
nailsnake --about
# Read the full manual
man nailsnake| OS | Path |
|---|---|
| Linux / BSD | ~/.config/NailSnake/settings.json, stats.json |
| macOS | ~/Library/Application Support/NailSnake/settings.json, stats.json |
| Windows | %APPDATA%\NailSnake\settings.json, stats.json |
Active game resume data is stored separately as a versioned active-game.json
in the platform data directory. Saves are written through a synced temporary
file before replacement; invalid or incompatible snapshots are discarded.
NO_COLOR forces the basic palette when --color is not supplied. See
docs/persistence.md.
- Rust 1.70+ (edition 2021)
- Terminal: full UI at 90x28; compact/minimal layouts down to 50x18
- Interactive TTY (not a piped or scripted session)
Detailed documentation lives in docs/.
See CONTRIBUTING.md for development setup, pull request
guidelines, and code style conventions.
See SECURITY.md for supported versions and how to report
vulnerabilities.
MIT - Copyright (c) 2026 Voltsparx