How carsig/grep_learn works
Terminal Trainer is a browser-based command-line and Neovim practice environment. Learners choose a module, read lessons or reference material, enter commands or Vim keys, and have their result checked against a solution or simulated state. Its runtime combines a content registry and UI with a mock shell, command emulators, and mock files, processes, Git history, and AWS account. README statements establish the main wiring; source excerpts show shell and editor responsibilities, but not every dispatch, so unsampled links are omitted.
Main entry points: shell.js Shell runtime · app.js Navigation and task UI · git.js Git emulator · help.js Command explainer
Components 19
Learning experience
- Navigation and task UI
js/ui/app.js - Lessons and tasks
content/modules - Content registry
js/core/trainer.js - Command reference
js/ui/reference.js - Command explainer
js/ui/help.js
Terminal simulation
- Shell runtime
js/core/shell.js - Regex and glob helpers
js/core/regex.js - Text commands
js/commands/text.js - grep command
js/commands/grep.js - Git emulator
js/commands/git.js - Process commands
js/commands/procs.js - AWS emulator
js/commands/aws.js
Mock state
- Mock files
data/files.js - Mock processes
data/processes.js - Mock Git history
data/repo.js - Mock AWS account
data/aws.js
Neovim emulator
- Vim key engine
js/vim/vim.js - Editor pane
js/vim/editor.js
Other components
- Learner
Connections 21
- Learner → Navigation and task UI: uses
- Navigation and task UI → Content registry: loads content
- Lessons and tasks → Content registry: registers lessons
- Navigation and task UI → Shell runtime: runs commands
- Navigation and task UI → Editor pane: presents editor
- Navigation and task UI → Command reference: shows reference
- Navigation and task UI → Command explainer: opens help
- Shell runtime → Text commands: dispatches commands
- Shell runtime → grep command: dispatches commands
- Shell runtime → Git emulator: dispatches commands
- Shell runtime → Process commands: dispatches commands
- Shell runtime → AWS emulator: dispatches commands
- Shell runtime → Regex and glob helpers: uses glob helper
js/core/shell.js - grep command → Regex and glob helpers: builds patterns
- Git emulator → Mock files: reads worktree
js/commands/git.js - Git emulator → Mock Git history: reads history
js/commands/git.js - Process commands → Mock processes: uses process table
- AWS emulator → Mock AWS account: loads account
- Shell runtime → Mock files: uses mock files
- Editor pane → Vim key engine: renders and feeds
js/vim/editor.js - Command explainer → Command reference: reads command docs
js/ui/help.js