@tostudy-ai/cli 0.18.29 → 0.18.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -0
- package/dist/main.js +9432 -2938
- package/dist/main.js.map +4 -4
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# ToStudy CLI
|
|
2
|
+
|
|
3
|
+
Terminal study client for [ToStudy](https://tostudy.ai) — navigate courses, read lessons, get hints, and validate exercises from the command line. Published to npm as [`@tostudy-ai/cli`](https://www.npmjs.com/package/@tostudy-ai/cli). Since v0.18.0 it also carries the `creator` group, which lets a creator's own AI agent author a course and upload it as a draft.
|
|
4
|
+
|
|
5
|
+
**Requires:** Node.js >= 22 (bundle loads on >= 20.18.1 with a warning)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @tostudy-ai/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
tostudy login # Authenticate (also installs the /tostudy command for your IDE)
|
|
17
|
+
tostudy courses # List enrolled courses
|
|
18
|
+
tostudy select # Select the active course
|
|
19
|
+
tostudy lesson # Read the current lesson
|
|
20
|
+
tostudy next # Advance to the next lesson
|
|
21
|
+
tostudy validate # Validate an exercise solution
|
|
22
|
+
tostudy progress # Show study progress
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
Source of truth: `src/commands/` (one file per command). Every command supports `--json` output designed for LLM agent consumption.
|
|
28
|
+
|
|
29
|
+
| Command | Description |
|
|
30
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `login` | Authenticate with ToStudy (`--creator` requests the creator scope) |
|
|
32
|
+
| `logout` | Revoke the server session and clear local authentication |
|
|
33
|
+
| `doctor` | Diagnostic health check |
|
|
34
|
+
| `init` | Initialize course workspace |
|
|
35
|
+
| `profile` | Show or manage CLI profile |
|
|
36
|
+
| `courses` | List enrolled courses (`--mine`: courses you authored) |
|
|
37
|
+
| `select` | Select active course |
|
|
38
|
+
| `progress` | Show study progress |
|
|
39
|
+
| `grades` | Show grades and exercise scores |
|
|
40
|
+
| `review` | Review past exercise attempts |
|
|
41
|
+
| `start` | Start a module |
|
|
42
|
+
| `start-next` | Start next available module |
|
|
43
|
+
| `next` | Advance to next lesson |
|
|
44
|
+
| `lesson` | Show current lesson |
|
|
45
|
+
| `knowledge` | Show the active course's knowledge base |
|
|
46
|
+
| `hint` | Get hint for current exercise |
|
|
47
|
+
| `theory` | Request additional explanation in current lesson |
|
|
48
|
+
| `validate` | Validate exercise solution |
|
|
49
|
+
| `retry` | Revalidate a completed lesson (grade keeps the best attempt) |
|
|
50
|
+
| `level` | Adjust exercise difficulty in real time |
|
|
51
|
+
| `menu` | Interactive menu |
|
|
52
|
+
| `sync` | Regenerate instruction files (`--all-runtimes` for every supported runtime) |
|
|
53
|
+
| `brief` | Show base learner brief (T1) status |
|
|
54
|
+
| `brief-create` | Create base learner brief via interactive prompts |
|
|
55
|
+
| `brief-open` | Open the learner brief editor in the browser |
|
|
56
|
+
| `export` | Extract exercise to workspace |
|
|
57
|
+
| `export-grades` | Export exercise history in structured format |
|
|
58
|
+
| `open` | Open workspace in IDE |
|
|
59
|
+
| `workspace` | Workspace operations (`workspace setup`) |
|
|
60
|
+
| `vault` | Obsidian vault operations (`vault init`, `vault sync`) |
|
|
61
|
+
| `compact` | Save module study summary from stdin |
|
|
62
|
+
| `context` | Load session context (workspace + summaries) |
|
|
63
|
+
| `memory` | Load accumulated student memory |
|
|
64
|
+
| `insight` | Record a student insight (difficulty/breakthrough/question) |
|
|
65
|
+
| `creator` | Author a course with your AI agent (`init`, `validate`, `push`, `pull`, `audit`, `status`, `open`, `thumbnail`) |
|
|
66
|
+
|
|
67
|
+
> `tostudy setup` is deprecated — IDE detection and `/tostudy` installation are part of `tostudy login`.
|
|
68
|
+
|
|
69
|
+
## IDE Integration
|
|
70
|
+
|
|
71
|
+
`tostudy login` / `select` / `init` generate instruction files that teach AI assistants how to tutor: Claude Code slash commands, Cursor rules, AGENTS.md blocks, OpenCode/Grok commands, and Antigravity skills. See [AGENTS.md](./AGENTS.md) for the full runtime matrix.
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Run from source (no dev server — CLI tool)
|
|
77
|
+
tsx bin/tostudy.ts <command>
|
|
78
|
+
|
|
79
|
+
# Tests / lint / typecheck
|
|
80
|
+
pnpm -C apps/tostudy-cli test
|
|
81
|
+
pnpm -C apps/tostudy-cli lint
|
|
82
|
+
pnpm -C apps/tostudy-cli type-check
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Build & Publish
|
|
86
|
+
|
|
87
|
+
| Target | Command | Output |
|
|
88
|
+
| ----------- | ----------------------------------------------- | --------------------------------------------- |
|
|
89
|
+
| npm package | `pnpm -C apps/tostudy-cli build` | `dist/cli.js` + `dist/main.js` (esbuild, ESM) |
|
|
90
|
+
| Standalone | `pnpm -C apps/tostudy-cli build:standalone` | 4 binaries (macOS arm64/x64, Linux, Windows) |
|
|
91
|
+
| Publish | `pnpm -C apps/tostudy-cli build && npm publish` | `@tostudy-ai/cli` on npm (public) |
|
|
92
|
+
|
|
93
|
+
> Always build by hand right before publishing and verify `dist/main.js` holds the new version string — with `ignore-scripts=true` in `~/.npmrc`, npm silently skips `prepublishOnly` and packs a stale `dist/`.
|
|
94
|
+
|
|
95
|
+
## Related
|
|
96
|
+
|
|
97
|
+
- [AGENTS.md](./AGENTS.md) - Agent instructions (architecture, creator authoring, context pipeline)
|
|
98
|
+
- [@repo/tostudy-core](../../packages/tostudy-core/README.md) - Shared business logic (bundled at build time)
|