@learnaltitude/cli 0.3.0 → 0.5.0

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.
Files changed (3) hide show
  1. package/README.md +72 -29
  2. package/dist/cli.js +44 -45
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,9 +14,21 @@ Supported agents are Claude Code and Codex.
14
14
 
15
15
  ## Connect, bind, and inspect a project
16
16
 
17
- Use the installed agent adapter's connect command to complete the browser device flow. Connecting
18
- stores a scoped bearer token in the CLI data directory (by default, `~/.altitude/token.json`) with
19
- owner-only permissions; it does not activate hooks in every directory.
17
+ From a terminal, name the agent this computer will use and complete the browser device flow:
18
+
19
+ ```sh
20
+ altitude connect --agent claude-code
21
+ altitude connect --agent codex
22
+ ```
23
+
24
+ Use one command, not both. Codex must meet the current compatibility floor documented on the
25
+ [W2 card](../../docs/BUILD-PLAN.md#w2--codex-adapter-config-only-by-mandate). Adapter-native
26
+ connect declares the detected version; the server refuses a parseable version below its floor
27
+ with server-authored remediation. The raw terminal command stamps the version as `"unknown"`,
28
+ which deliberately remains pairable. Other JSON connection failures likewise print the server's
29
+ message; non-JSON failures retain the HTTP status line. Connecting stores a scoped bearer token
30
+ in the CLI data directory (by default, `~/.altitude/token.json`) with owner-only permissions; it
31
+ does not activate hooks in every directory.
20
32
 
21
33
  A directory declares WHICH journey it works. From the root of the project, pick from your
22
34
  journey list:
@@ -30,6 +42,8 @@ altitude bind # binds directly when exactly one journey is bin
30
42
  Binding writes a `.altitude` marker in that directory. Hooks discover the nearest marker while
31
43
  walking upward, so the project and its subdirectories are active; invocations without a working
32
44
  directory or valid marker are dormant and produce no capture, down-sync, context, or gate work.
45
+ Binding during a running agent session takes effect on its next learner turn or tool lifecycle;
46
+ you do not need to restart the agent.
33
47
  Gate failures in a bound project still fail open. Several directories may bind the same journey
34
48
  (git worktrees are the normal case); each directory holds exactly one journey, and its down-synced
35
49
  working set is cached per journey in an owner-only file for offline sessions. An abandoned journey
@@ -48,45 +62,74 @@ the marker with `altitude bind --force`.
48
62
  Use `altitude task --json` for a network-first snapshot of the BOUND journey with local-cache
49
63
  fallback; its `source` field says which was used, `journey_status` carries the journey's
50
64
  last-known status, and `journey_miss` carries the server's refusal when the bound journey was not
51
- served. `altitude status` is a local snapshot that includes the nearest binding plus the bound
52
- journey's cached working-set summaries. Binding requires a connected device token; the command
53
- tells unconnected users to connect and directs users without a bindable journey back to Altitude.
65
+ served. Its full shape is the
66
+ [`taskEnvelopeSchema`](../shared/src/workshop.ts) contract. `altitude status` is a local snapshot
67
+ that includes the nearest binding plus the bound journey's cached working-set summaries. Binding
68
+ requires a connected device token; the command tells unconnected users to connect and directs
69
+ users without a bindable journey back to Altitude.
54
70
 
55
- ## Copied skills installs and updates
71
+ The envelope also carries `update_available`, a client-local boolean that is true when the CLI is
72
+ behind the latest npm version seen by the last background version check. It is read from the local
73
+ update-check cache only — `altitude task` never makes a version request, so a lesson never waits on
74
+ one. Skills update separately through the agent's plugin system.
75
+
76
+ Tutor flows can attach the learner's verbatim answer to its canonical concepts. The tutor does
77
+ not grade the answer; grading and any resulting mastery update are server-side:
78
+
79
+ ```sh
80
+ altitude emit quiz-moment --session <id> --question <q> --answer <a> \
81
+ --concepts <id,...>
82
+ ```
83
+
84
+ `--concepts` accepts comma-separated IDs or repeated flags. The CLI trims empty entries, removes
85
+ duplicates in first-seen order, and omits `concept_ids` when no non-empty ID is supplied.
86
+
87
+ ## Plugin marketplace installs and updates
88
+
89
+ Install the Altitude plugin exclusively through the marketplace built into your coding agent. In
90
+ Claude Code, run:
91
+
92
+ ```text
93
+ /plugin marketplace add jasonku09/altitude-skills
94
+ /plugin install altitude@altitude
95
+ ```
56
96
 
57
- Claude Code marketplace installs remain the recommended Claude path and update through that
58
- marketplace. For Codex or a manual Claude Code copy, install the public skills through the target
59
- declaration shipped by the relevant adapter:
97
+ For Codex, run these commands in a terminal:
60
98
 
61
99
  ```sh
62
- altitude skills install --adapter-config /path/to/adapter/skills-install.json
100
+ codex plugin marketplace add jasonku09/altitude-skills
101
+ codex plugin add altitude@altitude
63
102
  ```
64
103
 
65
- The first install remembers the resolved target in the CLI data directory (by default,
66
- `~/.altitude/skills-manifest.json`), including the exact `jasonku09/altitude-skills` commit and a
67
- SHA-256 content hash for every managed file. Later updates need no adapter flag:
104
+ On the first Codex launch after installation, accept the one-time
105
+ `Hooks need review -> Trust all and continue` prompt. Skills update with the agent's plugin system.
106
+ To update only the globally installed Altitude CLI, run:
68
107
 
69
108
  ```sh
70
109
  altitude update
71
110
  ```
72
111
 
73
- Use `--ref <commit-sha>` with either command to pin or roll back to a particular public-repository
74
- commit. Updates change only manifest-managed files plus new upstream paths; unrelated skills in a
75
- shared target are left alone, while managed files removed upstream are removed locally. An edited
76
- managed file or colliding pre-CLI copy is backed up in the CLI data directory (by default,
77
- `~/.altitude/skills-backups/`) before the upstream version replaces or removes it. Backups never
78
- live in an agent skills directory. If no copied install is configured, the skills step is an
79
- informative no-op because marketplace or plugin-managed skills update through the agent.
80
- After the skills step completes or is skipped, `altitude update` asks the detected global package
81
- manager to update `@learnaltitude/cli`; if detection or execution fails, it prints the exact manual
82
- command instead. A genuine copied-skills sync failure stops before the CLI self-update.
112
+ The command prints a one-line reminder that skills update with the agent, then asks the detected
113
+ global package manager to update `@learnaltitude/cli`. If detection or execution fails, it prints
114
+ the exact manual command instead.
83
115
 
84
116
  ## Network disclosure
85
117
 
86
118
  The distributed client uses the user's own agent subscription and no Altitude-held API key.
87
119
  Interactive `connect`, `diagnostics`, and `update` commands make anonymous, direct version checks
88
- to GitHub (the public skills repository's `main` commit) and the npm registry (the CLI's latest
89
- version). Results are cached in the CLI data directory for about 24 hours. Skills downloads also
90
- come directly from GitHub. These requests do not pass through the Altitude service and carry no
91
- Altitude credentials. Hooks, gates, queue flushers, and other non-interactive paths never perform
92
- the version check; all check failures are silent and cannot change a command's exit code.
120
+ with a single request to `registry.npmjs.org` for the CLI's latest version. Check attempts are
121
+ throttled for 24 hours; the latest usable result remains cached until a later successful check
122
+ replaces it. The request does not pass through the Altitude service and carries no Altitude
123
+ credentials.
124
+
125
+ A bound SessionStart schedules the same anonymous check without awaiting it, and the detached
126
+ flusher daemon keeps doing so in the background. The SessionStart process exits roughly 250 ms
127
+ after its command completes, so this scheduling improves spawn-fallback coverage only when the npm
128
+ request settles inside that remaining budget; it does not guarantee fallback coverage. An
129
+ interrupted attempt writes no marker and therefore cannot suppress a later daemon or command
130
+ attempt. Because unbound directories keep hooks dormant, they do not start a flusher or receive
131
+ background refreshes; their cache is refreshed only by `connect`, `diagnostics`, or `update`.
132
+ `altitude task --json` only reads the cache and never makes a request itself. Gates and other hooks
133
+ never perform the version check. Set `ALTITUDE_DISABLE_UPDATE_CHECK=1` to disable every version
134
+ check. All check failures are silent and cannot change a command's exit code or discard a
135
+ previously usable cache result.