practicode
Personal coding practice, right in your terminal.
practicode is a small Rust TUI for syntax exercises and stdin/stdout coding-test practice. It keeps your problems, settings, and submissions local by default.
What You Get
- Syntax learning and coding-test practice from one entry screen.
- Local judging for Python, TypeScript, Java, and Rust.
- A scrollable Ratatui UI with lesson/problem text, editor, run output, result status, and command palette.
- Optional Codex or Claude Code help for hints and generated problems.
Install
npm
The npm package ships no install lifecycle script. The launcher runs the locked Cargo build on first use if the binary is missing.
Language runtimes
Install only the languages you plan to practice. Python uses python3 or python; TypeScript uses node --experimental-strip-types; Java uses javac and java; Rust uses rustc.
|
winget install -e --id Python.Python.3.12
winget install -e --id OpenJS.NodeJS.LTS
winget install -e --id EclipseAdoptium.Temurin.21.JDK
winget install -e --id Rustlang.Rustup
Restart the terminal after installing so python, node, javac, and rustc are on PATH.
|
If node --version is below v22.6.0, install a newer Node.js from the official Node.js downloads or your preferred version manager before using TypeScript practice.
Verify runtimes:
References: Python, Node.js, Rust, Eclipse Temurin.
After starting practicode, run /doctor to check these runtimes from inside the TUI.
Check the install:
Docker sandbox
If you do not want submissions to run directly on your host, use the npm launcher sandbox:
The launcher builds a local practicode-sandbox:<version> image, then runs the TUI in Docker with the current directory mounted at /workspace. The container runs without network access, with a read-only root filesystem, a writable /tmp, dropped Linux capabilities, no-new-privileges, and CPU/memory/process limits. Your current directory is still writable so .practicode/, problems/, and submissions/ can be saved.
Install Docker first if needed:
# macOS
# Windows
# Ubuntu / Debian
# Use Docker's official apt repository:
# Ubuntu: https://docs.docker.com/engine/install/ubuntu/
# Debian: https://docs.docker.com/engine/install/debian/
After starting Docker, check the sandbox:
Update
npm is the primary install path:
The app checks npm for newer releases in the background and shows /update in the status line when one is available. Disable that check with PRACTICODE_NO_UPDATE_CHECK=1.
First Run
On first run, choose a mode:
Learn syntax: study the concept, worked example, mistakes, and self-check; use /ask when stuck; edit the exercise, /run, then /next
Practice coding tests: write code, Esc, /run, then /next when it passes
Use arrow keys to move on the home screen, and Enter or Space to open the selected mode.
Commands
Type / outside the editor to open the command palette. Use up/down to move, Enter to run or complete the selected command, and Esc to cancel.
Most-used commands:
| Command | Action |
|---|---|
/home |
Return to the mode chooser |
/run |
Judge the current submission or syntax exercise |
/ask <question> |
Ask AI about the current lesson or problem without leaving the TUI |
/next |
Open the next problem or lesson |
/back |
Go to the previous problem or lesson |
/doctor |
Check local runtimes and show install hints |
/profile |
Edit language, theme, difficulty, topics, and AI settings |
See docs/COMMANDS.md for the full command list, aliases, AI generation commands, and profile settings.
Local Data
Generated problems and submissions stay local:
| Path | Purpose |
|---|---|
.practicode/problem_bank.json |
Local/custom/generated problems |
.practicode/problem_notes.md |
Optional personal problem-generation notes |
.practicode/problem-state.json |
Current problem, history, and settings |
problems/ |
Generated problem markdown/index files |
submissions/ |
Your answer files |
Those paths are ignored by git.
Safety
/runexecutes your local submission as a normal process. It is not an OS sandbox.practicode --dockerruns the TUI and judge in a restricted Docker container, but Docker is still a shared-kernel container runtime, not a guarantee against every escape./runscrubs inherited environment variables and hides case input/expected output in failure logs./hint, AI-backed/next, and/generatesend the current problem/submission context to the selected provider CLI.settings.ai_next_commandcan run a custom shell command. Save only commands you trust.- Do not commit tokens, private prompts,
.env,.npmrc,.practicode/,problems/, orsubmissions/.
Security reporting details live in SECURITY.md.
Contributing
- External contribution flow: docs/CONTRIBUTING.md
- Maintainer and release notes: docs/MAINTAINING.md
- Code layout and extension rules: docs/ARCHITECTURE.md
Local checks:
License
practicode is MIT licensed. Third-party dependency license notes are in THIRD_PARTY_LICENSES.md.