@chalksurf/cli 0.3.6 → 0.4.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.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # `@chalksurf/cli`
2
2
 
3
- Publishable ChalkSurf CLI package. Expect breaking changes while the CLI is still only used internally.
3
+ ChalkSurf CLI 0.4.0 provides content generation, imports, updates, saved plans and recoverable job controls. This release intentionally breaks older command and manifest formats; see the [migration guide](./docs/migration-0.4.md).
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Run the published CLI without a global install:
8
8
 
9
9
  ```bash
10
- npx @chalksurf/cli@ --help
10
+ npx @chalksurf/cli --help
11
11
  ```
12
12
 
13
13
  Install it globally when you want a persistent local binary:
@@ -31,7 +31,6 @@ chalksurf sheet import ./fixtures/algebra.pdf --wait
31
31
  Headless or agent flow:
32
32
 
33
33
  ```bash
34
- CHALKSURF_TOKEN=cs_cli_... \
35
34
  printf '%s' "$CHALKSURF_TOKEN" | npx @chalksurf/cli auth login \
36
35
  --profile prod-codex \
37
36
  --base-url https://chalksurf-api.fly.dev \
@@ -50,8 +49,9 @@ npx @chalksurf/cli --profile prod-codex sheet copy SHEET_ID "Easier variant" \
50
49
  npx @chalksurf/cli --profile prod-codex exercise update EXERCISE_ID \
51
50
  --target-sheet-id COPIED_SHEET_ID \
52
51
  --expected-updated-at 2026-01-01T00:00:00.000Z \
53
- --patch-json '{"translations":{"english":{"exercise_text":"Find $x^2$."}}}' \
54
- --json
52
+ --input - --json <<'JSON'
53
+ {"translations":{"english":{"exercise_text":"Find $x^2$."}}}
54
+ JSON
55
55
  ```
56
56
 
57
57
  Admin sheet-series labeling:
@@ -59,26 +59,32 @@ Admin sheet-series labeling:
59
59
  ```bash
60
60
  npx @chalksurf/cli --profile prod-codex sheet list --all --result-file inventory.json --json
61
61
  npx @chalksurf/cli --profile prod-codex sheet series list --subject math --json
62
- npx @chalksurf/cli --profile prod-codex sheet bulk-update \
63
- --input batch-001.json --result-file batch-001.result.json --json
62
+ npx @chalksurf/cli --profile prod-codex sheet update \
63
+ --manifest batch-001.json --dry-run --plan-out batch-001.plan.json --json
64
+ npx @chalksurf/cli --profile prod-codex plan apply batch-001.plan.json --result-file applied.json --json
64
65
  ```
65
66
 
66
- Use the returned confirmation digest in an unchanged apply batch. `--input -` reads JSON from stdin; `--input-json` remains available for short inline payloads. If an apply response is uncertain, verify the original manifest with `sheet bulk-update verify` before considering another apply. Result files preserve complete private evidence and refuse to overwrite an existing destination.
67
+ Review the saved plan before applying it. If the apply response is uncertain, use `plan verify batch-001.plan.json` and inspect request acceptance before considering another write. `--input FILE|-` supplies one patch; `--manifest FILE|-` supplies a strict v1 repeated request. See [content operations](./docs/content-operations.md) for the complete generation, translation, import and recovery flow.
68
+
69
+ Every operational command accepts `--result-file PATH`. The CLI preflights a new destination before command execution, writes the complete success or failure JSON envelope to a private file, and refuses to overwrite existing evidence. Stdout stays compact and includes the absolute result path. If publication fails after the command finishes, stdout contains the complete envelope plus a warning and the command keeps its original exit code.
67
70
 
68
- Sheet import manifests use top-level `sheets[]`, where each sheet has one `targetFolderPath` and one or more ordered `sources[]`. See [the canonical example](./packages/cli/docs/examples/sheet-import-manifest.json).
71
+ Content manifests use `schemaVersion: "v1"`, `operation` and `items[]`. Sheet entries retain ordered sources, components or authoritative language groups. File paths resolve relative to the manifest file; stdin paths use the invocation directory. See the [manifest reference](./docs/manifest.md) and [canonical examples](./docs/examples/).
69
72
 
70
73
  ## Docs
71
74
 
72
75
  - [Public CLI and MCP documentation](https://chalksurf.com/docs)
73
- - [Manual operator guide](./packages/cli/docs/manual.md)
74
- - [Agent and Codex guide](./packages/cli/docs/agents.md)
75
- - [MCP guide](./packages/cli/docs/mcp.md)
76
- - [Manifest reference](./packages/cli/docs/manifest.md)
77
- - [Exit codes and JSON errors](./packages/cli/docs/exit-codes.md)
78
- - [Sheet import schema](./packages/cli/schemas/sheet-import-manifest.schema.json)
79
- - [Exercise import schema](./packages/cli/schemas/exercise-import-manifest.schema.json)
80
- - [Exercise solution import schema](./packages/cli/schemas/exercise-solution-import-manifest.schema.json)
81
- - [Exercise sheet solution import schema](./packages/cli/schemas/exercise-sheet-solution-import-manifest.schema.json)
76
+ - [Manual operator guide](./docs/manual.md)
77
+ - [Agent and Codex guide](./docs/agents.md)
78
+ - [MCP guide](./docs/mcp.md)
79
+ - [Content operations and saved plans](./docs/content-operations.md)
80
+ - [0.4.0 migration guide](./docs/migration-0.4.md)
81
+ - [Manifest reference](./docs/manifest.md)
82
+ - [Exit codes and JSON errors](./docs/exit-codes.md)
83
+ - [Sheet import schema](./schemas/sheet-import-manifest.schema.json)
84
+ - [Exercise import schema](./schemas/exercise-import-manifest.schema.json)
85
+ - [Exercise solution import schema](./schemas/exercise-solution-import-manifest.schema.json)
86
+ - [Exercise sheet solution import schema](./schemas/exercise-sheet-solution-import-manifest.schema.json)
87
+ - [Exercise sheet translation import schema](./schemas/exercise-sheet-translation-import-manifest.schema.json)
82
88
 
83
89
  ## Local And Staging Testing
84
90