Skip to content
voltsparxPublic

About

A simple CLI snake game made in Rust!

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

NailSnake

Version License: MIT Rust CI Tests Platform: Windows | Linux | macOS

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 man page.


Table of contents


Features

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

Quick start

cargo run --release

Or install globally:

cargo install --path .

Installation

Cargo

cargo install --path .

Linux

./installer/install-linux.sh

Interactive 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.

Termux

./installer/install-termux.sh

Builds a Termux-native binary, creates a .tar.gz archive, and can install it into $PREFIX/bin.

macOS

./installer/install-macos.sh

Creates a CLI-only .pkg that installs to /usr/local/bin.

Windows

.\installer\install-windows.ps1

Builds 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.

Man page

./scripts/install-man.sh
# or
make install-man

Then:

man nailsnake

Usage

Controls

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)

CLI options

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

Examples

# 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

Configuration & save files

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.


Requirements

  • Rust 1.70+ (edition 2021)
  • Terminal: full UI at 90x28; compact/minimal layouts down to 50x18
  • Interactive TTY (not a piped or scripted session)

Documentation

Detailed documentation lives in docs/.


Contributing

See CONTRIBUTING.md for development setup, pull request guidelines, and code style conventions.


Security

See SECURITY.md for supported versions and how to report vulnerabilities.


License

MIT - Copyright (c) 2026 Voltsparx

About

A simple CLI snake game made in Rust!

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages