Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CubeCLI Preview

🧊 CubeCLI

A professional Rubik's Cube speedcubing timer for your terminal.

Python License PyPI CI Code Style PRs Welcome

WCA-compliant scrambles Β· ANSI cube color preview Β· Braille progress charts Β· OLL/PLL trainer Β· Full stats engine

Installation Β· Quick Start Β· Features Β· Screenshots Β· Contributing


✨ Why CubeCLI?

Most speedcubing timers live in your browser. CubeCLI lives in your terminal β€” where it belongs.

  • Zero browser required β€” 100% offline, keyboard-driven, distraction-free
  • The only CLI timer with a real-time ANSI color cube preview showing your exact scramble state
  • WCA-equivalent scrambles powered by the same engine that drives csTimer
  • Data you own β€” stored locally in SQLite, exportable to CSV/JSON anytime
  • Deep analytics β€” sparklines, braille charts, heatmaps, CFOP split tracking

πŸ“¦ Installation

Requirements: Python 3.11+

pip install cubecli

Or install from source (recommended for development):

git clone https://github.com/Axzo001/CubeCLI.git
cd CubeCLI
pip install -e ".[dev]"

πŸš€ Quick Start

# Launch the timer (3x3 by default)
cubecli

# Start with a specific puzzle
cubecli --puzzle 2x2
cubecli --puzzle pyraminx

# Open the stats dashboard
cubecli stats

# Open the OLL/PLL trainer
cubecli train --set OLL

# Generate and print scrambles
cubecli scramble --count 10 --puzzle 3x3

# Import from csTimer
cubecli import --from cstimer --file export.json

🎯 Features

⏱️ Timer

Feature Details
Stackmat-style input Hold SPACE β‰₯ 0.5s β†’ green light β†’ release to start
Precision Microsecond accuracy via time.perf_counter()
WCA Inspection Configurable 15s countdown with audio warnings at 8s and 12s
Penalties +2, DNF, delete, undo delete
Multi-phase CFOP split timing: tap SPACE after Cross β†’ F2L β†’ OLL β†’ PLL
BLD mode Separate Memo + Execution timers
Manual entry Type a time directly with m

πŸ”€ Scrambles

Feature Details
Library pyTwistyScrambler β€” wraps csTimer's JS engine
Events All 17 WCA events: 2x2, 3x3, 4x4, 5x5, 6x6, 7x7, Pyraminx, Megaminx, Skewb, Square-1, Clock, FTO + BLD variants
Training OLL (57), PLL (21), F2L (41), ZBLL subset filters
Utilities Copy to clipboard, view history, batch print

🎨 Cube Color Preview

Real-time ANSI 2D net β€” the scrambled cube state rendered with colored blocks:

        β”Œβ”€β”€β”€β”
        β”‚ W β”‚   ← U face (White)
    β”Œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”¬β”€β”€β”€β”
    β”‚ O β”‚ G β”‚ R β”‚ B β”‚   ← L F R B
    β””β”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”΄β”€β”€β”€β”˜
        β”‚ Y β”‚   ← D face (Yellow)
        β””β”€β”€β”€β”˜

Each sticker is rendered as β–ˆβ–ˆ with WCA-standard ANSI background colors.

πŸ“Š Statistics

  • Averages: Mo3, Ao5, Ao12, Ao50, Ao100, Ao1000
  • Records: Session best, all-time best per puzzle, best Ao5/Ao12/Ao50/Ao100
  • Advanced: Standard deviation, consistency score, sub-X count, PB streaks
  • CFOP splits: Average Cross, F2L, OLL, PLL times (with multi-phase mode)

πŸ“ˆ Terminal Charts

  • Sparkline β€” inline last-12-solves bar chart: ▁▂▃▄▃▂▁▃▅▄▂▃
  • Full line chart β€” solve times + Ao5/Ao12 trend overlays (braille-resolution via textual-plot)
  • Distribution histogram β€” solve time bucketing
  • Heatmap calendar β€” GitHub-contribution-style daily solve frequency
  • CFOP split bar chart β€” compare phase averages

πŸŽ“ Training Mode

  • OLL Trainer β€” all 57 cases with name, ASCII diagram, algorithm
  • PLL Trainer β€” all 21 cases
  • F2L Trainer β€” 41 cases
  • Case picker β€” select specific cases to drill
  • Spaced repetition β€” harder cases appear more often
  • Per-case stats β€” track your average for every case individually

πŸ’Ύ Data Management

  • Storage: SQLite (~/.cubecli/solves.db) with daily JSON backup
  • Import: csTimer JSON, TwistyTimer CSV, CubeDesk JSON, NexusTimer
  • Export: CSV, JSON
  • Sessions: Create, rename, split, merge, delete

πŸ“Έ Screenshots

Main Timer Stats Dashboard
OLL Trainer Progress Chart

⌨️ Keyboard Reference

Key Action
SPACE Hold to ready β†’ release to start/stop
d Mark DNF
p / + Add +2 penalty
r New scramble
c Copy scramble to clipboard
v Toggle cube preview
Del Delete last solve
z Undo delete
m Manual time entry
n Add note to last solve
s Full stats screen
g Full graph screen
S Session manager
P Puzzle picker
T Training mode
i Toggle inspection countdown
M Metronome settings
e Export session to CSV
I Import solves
? Help overlay
q Quit

πŸ“‚ Project Structure

CubeCLI/
β”œβ”€β”€ cubecli/
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ timer.py          # Timer logic, precision timing
β”‚   β”‚   β”œβ”€β”€ scramble.py       # Scramble generation (pyTwistyScrambler)
β”‚   β”‚   β”œβ”€β”€ cube_sim.py       # 3x3 Rubik's Cube state simulator
β”‚   β”‚   └── stats.py          # Statistics engine (Ao5, Ao12, PB, etc.)
β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ app.py            # Main Textual app
β”‚   β”‚   β”œβ”€β”€ app.tcss          # Global Textual stylesheets
β”‚   β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”‚   β”œβ”€β”€ timer_screen.py   # Main timer TUI screen
β”‚   β”‚   β”‚   β”œβ”€β”€ stats_screen.py   # Statistics dashboard screen
β”‚   β”‚   β”‚   β”œβ”€β”€ train_screen.py   # OLL/PLL training screen
β”‚   β”‚   β”‚   └── case_picker.py    # Training case picker modal screen
β”‚   β”‚   └── widgets/
β”‚   β”‚       β”œβ”€β”€ cube_preview.py   # ANSI cube net widget
β”‚   β”‚       β”œβ”€β”€ timer_display.py  # Big digit timer widget
β”‚   β”‚       β”œβ”€β”€ scramble_panel.py # Scramble text rendering panel
β”‚   β”‚       β”œβ”€β”€ solve_list.py     # Solve history list widget
β”‚   β”‚       └── stats_panel.py    # Stats sidebar widget
β”‚   β”œβ”€β”€ training/
β”‚   β”‚   β”œβ”€β”€ trainer.py        # Training mode logic (inversion, weights)
β”‚   β”‚   └── data/
β”‚   β”‚       β”œβ”€β”€ oll.json      # 57 OLL cases with algorithms & diagrams
β”‚   β”‚       └── pll.json      # 21 PLL cases with algorithms & diagrams
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ db.py             # SQLite database interface & CRUD
β”‚   β”‚   └── models.py         # Solve and Session data models
β”‚   β”œβ”€β”€ config.py             # Config loader (~/.cubecli/config.json)
β”‚   └── __init__.py
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_timer.py
β”‚   β”œβ”€β”€ test_scramble.py
β”‚   β”œβ”€β”€ test_stats.py
β”‚   β”œβ”€β”€ test_cube_sim.py
β”‚   β”œβ”€β”€ test_package.py
β”‚   β”œβ”€β”€ test_trainer.py
β”‚   └── test_ui.py
β”œβ”€β”€ assets/
β”‚   └── preview.png
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ FEATURES.md
β”‚   └── KEYBOARD.md
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ bug_report.md
β”‚   β”‚   └── feature_request.md
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── ci.yml
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ pyproject.toml
└── README.md

πŸ› οΈ Tech Stack

Component Library Why
TUI Framework Textual on_key/on_key_release for hold-to-start, async, modern
Styling/Rendering Rich Panels, tables, sparklines, markup
Scramble Generation pyTwistyScrambler csTimer-source, WCA-equivalent, all puzzles
Charts textual-plot Braille-resolution line/bar charts in TUI
Storage SQLite (stdlib) Fast queries, no server needed
Clipboard pyperclip Cross-platform scramble copy
Audio (Planned) beepy Inspection beeps, metronome

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Quick start for contributors:

git clone https://github.com/Axzo001/CubeCLI.git
cd CubeCLI
pip install -e ".[dev]"
pre-commit install
pytest tests/

See CONTRIBUTING.md for a detailed guide on:

  • Setting up your dev environment
  • Code style (Ruff + Black)
  • Writing tests
  • Submitting pull requests

πŸ—ΊοΈ Roadmap

  • Project scaffold & GitHub setup
  • Phase 1: Core timer + scrambles + basic stats
  • Phase 2: ANSI cube color preview
  • Phase 3: Advanced stats + braille charts
  • Phase 4: OLL/PLL training mode
  • Phase 5: Multi-puzzle + BLD mode + metronome
  • Phase 6: Import/export + theme system
  • Phase 7: Smart cube Bluetooth (GAN/MoYu)

Track progress on the Projects board.


πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ™ Acknowledgements

  • pyTwistyScrambler β€” scramble generation
  • csTimer β€” scramble algorithm source & inspiration
  • Textual β€” the TUI framework that makes this possible
  • cubing.js β€” protocol reference for smart cube integration
  • The WCA speedcubing community ❀️

Made with ❀️ for speedcubers who live in the terminal.

⭐ Star this repo if CubeCLI helps your training!

About

🧊 Professional Rubik's Cube speedcubing timer for your terminal β€” WCA scrambles, ANSI cube preview, braille charts, OLL/PLL trainer

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages