Skip to content

Learn by doing: your turn, practice exercises, progress - #14

Merged
Sym-jay merged 2 commits into
mainfrom
learn-by-doing
Oct 5, 2026
Merged

Sym-jay merged 2 commits into
mainfrom
learn-by-doing

Conversation

@Sym-jay

@Sym-jay Sym-jay commented Oct 5, 2026

Copy link
Copy Markdown
Owner

These features move Clishe from running commands for people to getting people to type commands themselves.

Your turn

After someone asks for the same phrase three times, the existing tip shows them the command. The fourth time, Clishe asks them to type it:

You: list files
💡 Your turn! You know this one. Type the command for "list files" (or press Enter to see it):
  $ ls -al
Clishe: ✓ That's it!
  • The check is forgiving where it should be: ls -al, ls -l -a and ls -la all match. cp notes.txt backup/ matches cp <file> <destination>. tar -czvf site.zip site does not match <archive name>.tar.gz.
  • If the answer is wrong, Clishe shows the command ("Close! Right command, different options" when it's the right program) and runs it as before, so nobody gets stuck.
  • Pressing Enter skips straight to the old behaviour.
  • After two correct answers for a phrase, it stops asking.
  • New "learn_mode" config option: gentle (the default), always (from the second ask) or off.

practice

There are 14 exercises in a mktemp folder: pwd → ls → mkdir → cd → touch → echo > → cat → cd .. → cp → mv → find → grep → rm → rm -r.

  • Every command the user types runs for real in that folder, then the exercise's check runs.
  • You can type hint, answer, skip or quit. A hint also appears automatically after two misses.
  • Clishe remembers where you stopped. When you come back, it replays the earlier answers so the folder is in the state the next exercise expects.
  • The last exercise (rm -r notes) deliberately triggers the safety check's YES prompt, so people see why it exists.
  • The folder is removed when the user finishes or quits.

progress

Shows which of 28 everyday commands you've typed yourself, which ones you still ask Clishe for, and three good ones to learn next. Commands you type directly are now counted per program.

clishe practice and clishe progress also work from the normal shell.

Tests

  • 18 new pytest tests: command matching, your-turn thresholds, learn_mode, progress. 447 pass locally.
  • 6 new shell tests: practice steps, hints, resume, cleanup, and your-turn end to end. The new ones pass, and the rest match main on macOS bash 3.2; CI runs them all on Linux.

This touches the same CHANGELOG "Unreleased" section as #11 and #12, so whichever merges second or third needs a one-line conflict fix. I can rebase them after you merge.

🤖 Generated with Claude Code

harryfrzz and others added 2 commits October 5, 2026 11:21
- After three asks for a phrase, Clishe asks you to type its command and
  checks it (flag order and placeholder values are allowed to differ).
  Stops after two right answers. "learn_mode": gentle/always/off.
- practice: 14 exercises in a mktemp sandbox, checked after each command,
  with hints, answers, skip, and resume (earlier answers are replayed
  to rebuild the folder).
- progress: everyday commands typed yourself, ones still asked for, and
  what to learn next. Typed commands are now counted per program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sym-jay
Sym-jay merged commit be3301d into main Oct 5, 2026
3 checks passed
@Sym-jay
Sym-jay deleted the learn-by-doing branch October 5, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants