🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

practicode

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

practicode

Local-first coding-test practice in a Rust terminal UI with optional AI help.

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
4.3K
Maintainers
1
Weekly downloads
 
Created
Source

practicode

Rust Ratatui Local first AI ready CI

practicode terminal UI

Personal coding practice, right in your terminal.

practicode is a small Rust TUI for stdin/stdout practice: problem on the left, code on the right, judge loop in the same terminal. No browser tab shuffle, no paste dance, just solve and run.

Why It Exists

  • Fast local judging for Python, TypeScript, Java, and Rust
  • Gradual problem flow with local history
  • AI-powered /next <request> when you want a custom problem
  • Personal problem-generation notes
  • Small stack: Rust, Ratatui, Crossterm, and plain process execution

Quick Start

git clone https://github.com/baba9811/practicode.git
cd practicode
cargo run --

Want a local binary?

cargo install practicode
practicode

Prefer npm from GitHub?

npm install -g github:baba9811/practicode
practicode

Working from a local checkout?

cargo install --path .
practicode

Or with npm:

npm install -g .
practicode

The npm wrapper builds the Rust binary with Cargo, so Rust/Cargo is still required.

Daily Loop

The code editor starts focused.

write code
Esc, then /run
Esc, then /next easy string problem

Submissions are saved as you type under submissions/<problem-id>/solution.<ext>.

Commands

Press Esc, then /, to focus the command bar.

CommandAction
/runJudge the current submission
/nextOpen the next local problem, or ask AI to create one
/next easy string problemAsk AI for a custom next problem
/prevGo back through problem history
/listBrowse problems with up/down or j/k, open with Enter
/open 2Open by number, id, or slug
/giveupShow the reference answer
/ai hintAsk the selected AI about the current problem and submission
/provider codexSet AI provider: codex or claude
/model sonnetSet the model for /ai and AI-backed /next; use auto for the CLI default
/note prefer hashmap practiceAppend a standing note for future problem generation
/notesShow your local next-problem notes
/lang pythonSet language: python, ts, java, rust
/ui koSet UI language: ko, en
/themeToggle dark/light theme
/source aiPrefer AI for next-problem generation
/exitQuit

The editor owns normal typing keys. Press Esc, then /, when you want the command bar.

Custom Problem Generation

/next <request> passes your request into the selected AI problem generator. Examples:

/next a slightly harder string problem
/next hashmap practice, easy
/next sorting problem, no graph yet

AI generation reads docs/problem-authoring-notes.md every time it creates a problem. Add personal preferences from inside the TUI:

/note Prefer concise statements.
/note I want more string and hashmap practice.
/note Avoid DP until I ask for it.

Those notes are stored in .practicode/problem_notes.md, so they stay local.

AI Providers

Codex is the default:

/provider codex
/model auto

Claude Code is also supported:

/provider claude
/model sonnet
/source ai

/ai <prompt> uses the current provider for coaching. AI-backed /next uses the same provider and model. If you want a custom daemon or wrapper script, set /ai-next-command <shell command>; practicode passes PRACTICODE_NEXT_REQUEST, PRACTICODE_AI_PROVIDER, and PRACTICODE_AI_MODEL.

Generated problem banks stay local:

PathPurpose
.practicode/problem_bank.jsonLocal/custom/generated problem bank
.practicode/problem_notes.mdOptional personal problem-generation notes
.practicode/problem-state.jsonCurrent problem, history, settings
problems/Generated problem markdown/index files
submissions/Your answer files

Those paths are ignored by git, so your practice history stays yours.

Safety

/run executes your local submission as a normal process. practicode runs it from .practicode/build/<problem-id>/run, but this is not an OS sandbox. Only run code you trust.

Debug Prints

/run shows raw stdout when a case fails. If you want debug output without changing the judged answer, print to stderr:

import sys

print("debug", value, file=sys.stderr)

Development

cargo test
cargo run -- --smoke
cargo run --

The source is split by boring responsibility:

PathRole
src/core.rsProblem bank, state, rendering, judging
src/tui.rsRatatui app, editor, command parser
src/ai.rsCodex/Claude command integration and notes
src/text.rsUTF-8 cursor math and Hangul composition
src/process.rsProcess execution helpers
tests/Integration tests split by module

Discovery Notes

Recommended GitHub topics for this repo: coding-practice, competitive-programming, algorithms, ratatui, tui, rust, codex, claude-code, local-first.

References

Keywords

algorithms

FAQs

Package last updated on 05 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts