@studiolxd/lxd-cli 0.1.0-next.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.
@@ -0,0 +1,56 @@
1
+ # Command reference
2
+
3
+ All commands accept global options `--cwd <dir>` (project root) and `--log-format <pretty|json>`.
4
+ User-facing output goes to stdout; structured logs (off by default) go to stderr — so
5
+ `lxd validate --json` stdout is always pure JSON. Set `LOG_LEVEL=debug` to see internal logs.
6
+
7
+ The 13-step authoring workflow (spec FR-005) maps to these commands. Order is guided but
8
+ revisitable.
9
+
10
+ | Command | Step | Purpose |
11
+ |---------|------|---------|
12
+ | `create [dir]` (alias `wizard`) | guided | Interactive, guided creation of a **new** package in one session (buffer → single commit → optional validate (default yes) / handoff (default no) → summary). Create-new only; confirm-to-replace on an existing package. |
13
+ | `init [dir] --id <id>` | scaffold | Create a package project (separated artifacts + `manifest.lock`). |
14
+ | `goal -g <text>` | 1 | Set/show the learning goal. |
15
+ | `audience -d <desc> -m <min> --tone <t> --context <c>` | 2 | Audience, duration, context, tone. |
16
+ | `structure -n <linear\|free\|guided> [--order <ids...>] [--sync]` | 3 | Navigation + experience order. |
17
+ | `experience add\|list\|remove` | 4 | Manage experiences (`add --id --purpose --scenario --mechanic`). |
18
+ | `mechanic list\|show --id <id>` | 5 | Browse official mechanics (consumed, not authored, in v1). |
19
+ | `design -l <level> [-b <brief>] [--a11y <t...>] [--from <file>]` | 6 | Design direction (brief → full constraints). |
20
+ | `evaluation -c <rule> [--assessed --pass-threshold <n>]` | 7 | Feedback + package completion/score rules. |
21
+ | `tracking [--completion-rule] [--score-rule] [--report <fields...>] [--threshold <n>]` | 8 | Experience signals + package roll-up. |
22
+ | `handoff [-t <targets...>] [-f]` | 9 | Generate `.agent/**` specs/prompts/instructions (full instructional context per experience: purpose, scenario, mechanic guidance + plugin enrichment, feedback, tracking; audience + package tone; source-of-truth instruction); scaffold `generated/`. |
23
+ | *(your agent)* | 10 | Run YOUR AI coding agent against `.agent/**` to produce `generated/`. |
24
+ | `preview [--mock-lms] [-p <port>]` | 11 | Build + serve locally; optional mock LMS/SCORM mode. |
25
+ | `validate [--json]` | 12 | Run all validation checks on demand. For SCORM-targeted packages, **fails** if `generated/` hand-rolls a SCORM runtime instead of using `@studiolxd/scorm` (`no-custom-scorm-runtime`). |
26
+ | `export --target <id...>` | 13 | Export to `web`, `scorm-1.2`, `scorm-2004`. |
27
+ | `assets show\|update [--scorm-version] [--skills-version] [--skills-ref]` | — | Explicitly update external asset versions (never silent). |
28
+
29
+ ## Notes
30
+
31
+ - **Design levels** (`-l`): `brief`, `tokens`, `patterns`, `design-system`, `full-constraints`.
32
+ Advanced levels are supplied via `--from <file>` (a YAML/JSON design-direction document); the CLI
33
+ validates it before saving. No GUI — CLI-first.
34
+ - **Overwrite safety**: `handoff` scaffolds `generated/` non-destructively. Existing files are
35
+ preserved; pass `-f/--force` (or confirm interactively) to overwrite.
36
+ - **Unknown export target** → clear error (export targets are adapters, not hardcoded).
37
+ - **Exit codes**: non-zero when `validate` overall fails or an export target is unknown.
38
+
39
+ ## Mechanics
40
+
41
+ Official mechanics live as declarative manifests in `src/mechanics/manifests/*.yml`. Adding a new
42
+ official mechanic is additive (a manifest, optionally a code plugin in `src/mechanics/plugins/`) and
43
+ requires no change to the core. v1 ships: `risk-detection`, `decision-simulation`,
44
+ `diagnostic-challenge`, `branching-narrative`.
45
+
46
+ ## Release (manual)
47
+
48
+ Published to npm as `@studiolxd/lxd-cli` under the **`next`** dist-tag (proprietary, `UNLICENSED`).
49
+ Verify locally first, then publish manually — nothing auto-publishes:
50
+
51
+ ```bash
52
+ npm run verify:pack # pack → clean-install → run installed lxd (--help/--version/mechanic list/init)
53
+ npm publish --tag next --access public # manual, after verify:pack passes
54
+ ```
55
+
56
+ `prepack` rebuilds `dist/`; `prepublishOnly` gates on typecheck + lint + tests.
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@studiolxd/lxd-cli",
3
+ "version": "0.1.0-next.0",
4
+ "description": "CLI-first authoring tool for AI-native elearning packages (agent-orchestrated, framework- and export-target-agnostic).",
5
+ "type": "module",
6
+ "license": "UNLICENSED",
7
+ "engines": {
8
+ "node": ">=20"
9
+ },
10
+ "bin": {
11
+ "lxd": "./dist/cli/index.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "docs"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public",
19
+ "tag": "next"
20
+ },
21
+ "scripts": {
22
+ "build": "esbuild src/cli/index.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/cli/index.js --banner:js=\"#!/usr/bin/env node\" && node scripts/copy-assets.mjs",
23
+ "prepack": "npm run build",
24
+ "prepublishOnly": "npm run typecheck && npm run lint && npm run test",
25
+ "verify:pack": "node scripts/verify-package.mjs",
26
+ "dev": "tsx src/cli/index.ts",
27
+ "typecheck": "tsc --noEmit",
28
+ "lint": "eslint .",
29
+ "format": "prettier --write .",
30
+ "format:check": "prettier --check .",
31
+ "test": "vitest run",
32
+ "test:watch": "vitest",
33
+ "test:coverage": "vitest run --coverage"
34
+ },
35
+ "dependencies": {
36
+ "@clack/prompts": "^0.7.0",
37
+ "ajv": "^8.17.1",
38
+ "ajv-formats": "^3.0.1",
39
+ "archiver": "^7.0.1",
40
+ "commander": "^12.1.0",
41
+ "pino": "^9.5.0",
42
+ "pino-pretty": "^13.0.0",
43
+ "yaml": "^2.6.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/archiver": "^6.0.3",
47
+ "@types/node": "^20.16.0",
48
+ "@typescript-eslint/eslint-plugin": "^8.13.0",
49
+ "@typescript-eslint/parser": "^8.13.0",
50
+ "@vitest/coverage-v8": "^2.1.4",
51
+ "esbuild": "^0.24.0",
52
+ "eslint": "^8.57.1",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "prettier": "^3.3.3",
55
+ "tsx": "^4.19.0",
56
+ "typescript": "^5.6.3",
57
+ "vitest": "^2.1.4"
58
+ }
59
+ }