@learncode-cli/learncode
v0.1.1
Published
Interactive programming lessons in your terminal
Downloads
290
Readme
LearnCode
Interactive programming lessons in your terminal.
Write real code, get instant feedback, track your progress — all without leaving the command line. Supports JavaScript, TypeScript, Python, Rust, and C++ out of the box, with a JSON-based import system for any language.
Installation
npm install -g @learncode-cli/learncode
learncodeRequires Node.js 18 or later. Works on Windows, macOS, and Linux.
Commands
learncode Launch the interactive TUI
learncode import <url> Import a lesson pack from a URL
learncode update Update all imported lesson packs
learncode manage List and remove imported packs
learncode build Write built-in sample lessons to disk
learncode --resume Resume your last session
learncode --debug Keep terminal output visible after exitControls
Arrow keys Navigate
Enter / Space Select or interact
Esc Go back
Tab Cycle focus between panels
? or Ctrl+D Open help overlay
Ctrl+C Exit
d Open dashboard (from Home)
m Manage imported packs (from Home or Dashboard)
R Redo a completed lesson
Ctrl+E Execute code (in challenges)
Ctrl+R Reset to starter code (in challenges)Lesson types
| Type | Description | |---|---| | Theory | Markdown content with scroll support | | Quiz | Multiple-choice questions with explanation on answer | | Challenge | Write and run real code against expected output | | Drag | Ordering, matching pairs, and fill-in-the-blank exercises | | Video | External link (YouTube) with duration and watch tracking |
Storage
Everything lives in ~/.learncode/:
~/.learncode/
lessons/ Lesson JSON files, one folder per language
javascript/
typescript/
python/
rust/
cpp/
languages/ Language registration files
progress.json Progress, step history, and code drafts
imported-packs.json Imported pack metadata and checksumsProgress is saved automatically after every step. Code you submit on challenges is archived permanently — revisiting a completed challenge loads your last submission, not the blank starter.
Adding custom languages
Host a JSON manifest at any public URL and run learncode import <url>.
Manifest format:
{
"id": "java",
"name": "Java",
"version": "1.0.0",
"author": "Your Name",
"description": "Java fundamentals from Hello World to generics.",
"language": {
"id": "java",
"name": "Java",
"abbreviation": "JV",
"runner": {
"extension": ".java",
"filename": "Main.java",
"compile": { "command": "javac", "args": ["{{file}}"] },
"run": { "command": "java", "args": ["-cp", "{{dir}}", "Main"] }
}
},
"lessons": [
{ "title": "Hello, Java!", "path": "lessons/01-hello.json" },
{ "title": "Variables", "path": "lessons/02-variables.json" }
]
}path values are resolved relative to the manifest URL. The pack will appear alongside built-in languages on the next launch. See docs/lesson-format.md for the full lesson JSON specification.
Security
- Code runs in subprocess isolation with configurable timeouts
- No data leaves your machine; network access is limited to
importandupdate - Imported pack integrity is verified via SHA-256 checksums on every startup
- No telemetry, no analytics
Development
git clone https://github.com/SauloHS/LearnCode
cd LearnCode
npm install
npm run dev # Watch mode
npm run build # Production build
npm test # Test suiteContributions welcome. Bug reports and pull requests at github.com/SauloHS/LearnCode.
MIT License
