@narrativetrace/cli 0.1.3 → 0.2.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 +77 -6
- package/dist/cli-bin.cjs +234 -513
- package/dist/cli-bin.cjs.map +1 -1
- package/dist/cli-bin.d.cts +1 -0
- package/dist/cli-bin.d.ts +1 -0
- package/dist/cli-bin.js +249 -13
- package/dist/cli-bin.js.map +1 -1
- package/dist/index.cjs +9 -520
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -91
- package/dist/index.d.ts +1 -91
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/skills/agents/add-narrative-tracing/SKILL.md +124 -0
- package/skills/agents/narrativetrace-doctor/SKILL.md +49 -0
- package/skills/catalogue.json +17 -0
- package/skills/claude/add-narrative-tracing/SKILL.md +126 -0
- package/skills/claude/narrativetrace-doctor/SKILL.md +51 -0
- package/dist/chunk-WUK4GWFW.js +0 -523
- package/dist/chunk-WUK4GWFW.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# @narrativetrace/cli
|
|
2
2
|
|
|
3
|
-
One `npx` command over NarrativeTrace's open artifact formats.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
One `npx` command over NarrativeTrace's open artifact formats. Three verbs: `doctor` diagnoses a
|
|
4
|
+
project, `init` installs the NarrativeTrace agent skills into it, and `uninstall` removes exactly
|
|
5
|
+
what `init` wrote. `view`, `validate`, and `diff` are planned. Licensed Apache 2.0 — this package is
|
|
6
|
+
the open, standards surface (annotation/decorator API, output-format spec, clarity rubric), distinct
|
|
7
|
+
from the Business Source License 1.1 runtime packages published from this repository.
|
|
8
|
+
|
|
9
|
+
Every verb is zero-network and every flag follows the verb:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx --yes @narrativetrace/cli doctor
|
|
13
|
+
npx --yes @narrativetrace/cli init --dry-run
|
|
14
|
+
npx --yes @narrativetrace/cli uninstall
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`--yes` skips npm's "Ok to proceed?" prompt, which is a stall for an unattended agent. Keep the
|
|
18
|
+
flags after the verb: npm claims a flag that directly follows the package spec, so
|
|
19
|
+
`npx --dry-run @narrativetrace/cli init` would install for real.
|
|
7
20
|
|
|
8
21
|
## `narrativetrace doctor`
|
|
9
22
|
|
|
@@ -12,8 +25,8 @@ against the project in the current directory, and prints a one-liner, a fix, and
|
|
|
12
25
|
each finding.
|
|
13
26
|
|
|
14
27
|
```bash
|
|
15
|
-
npx @narrativetrace/cli doctor
|
|
16
|
-
npx @narrativetrace/cli doctor --json
|
|
28
|
+
npx --yes @narrativetrace/cli doctor
|
|
29
|
+
npx --yes @narrativetrace/cli doctor --json
|
|
17
30
|
```
|
|
18
31
|
|
|
19
32
|
Exit codes: `0` clean, `1` findings, `2` could not run. Zero network — every check reads only
|
|
@@ -36,10 +49,68 @@ Mutates nothing.
|
|
|
36
49
|
| `trap.redaction-proof` | a test asserts `[REDACTED]` for a deny-listed parameter name |
|
|
37
50
|
| `trap.approval-traces` | no stale `.received.nt` file sits next to an `.approved.nt` baseline |
|
|
38
51
|
| `trap.llms-before-you-start` | a plain `.js` file using ESM `import` has `"type": "module"` in `package.json` |
|
|
52
|
+
| `config.skills-installed` | the agent skills this project's carrier ships are installed under `.agents/skills/` and stamped with the release this project resolves |
|
|
39
53
|
|
|
40
54
|
See the [`narrativetrace-doctor` skill](../skills/README.md) for the thin agent layer over this
|
|
41
55
|
command — the skill runs the same tested tool and interprets its report in context.
|
|
42
56
|
|
|
57
|
+
The checks themselves live in [`@narrativetrace/tooling`](../tooling/README.md), a zero-dependency
|
|
58
|
+
library; this package is the launcher over it, so a host that is not a command line can run the
|
|
59
|
+
same checks in-process.
|
|
60
|
+
|
|
61
|
+
## `narrativetrace init`
|
|
62
|
+
|
|
63
|
+
Copies the NarrativeTrace agent skills into `.agents/skills/` — and into `.claude/skills/` where the
|
|
64
|
+
project is one of that vendor's — and writes one marked section into `AGENTS.md`, so an agent working
|
|
65
|
+
in the project finds the skills where its own convention says to look. A `CLAUDE.md` that is already
|
|
66
|
+
there gets one `@AGENTS.md` line; none is created.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx --yes @narrativetrace/cli init --dry-run # show the plan and the unified diff, write nothing
|
|
70
|
+
npx --yes @narrativetrace/cli init # apply exactly what the preview showed
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Read the diff first: the preview is computed from the same plan the apply executes, so what you read
|
|
74
|
+
is what gets written.
|
|
75
|
+
|
|
76
|
+
| flag | what it does |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `--dry-run` | Print the plan and the unified diff. Writes nothing, always exits `0`. |
|
|
79
|
+
| `--write-existing` | Permission to touch an `AGENTS.md` or `CLAUDE.md` that is already there. |
|
|
80
|
+
| `--force` | Permission to overwrite a skill directory somebody else owns. |
|
|
81
|
+
| `--only skills\|agents-md` | One half of the install. Both halves by default. |
|
|
82
|
+
| `--vendor claude\|none` | Force the vendor flavour on or off. Detected from the project by default. |
|
|
83
|
+
| `--from <dir>` | Install from a carrier directory — a checked-out `@narrativetrace/skills`, or an unpacked tarball of one. The copy bundled in this package by default. |
|
|
84
|
+
| `--json` | The `{carrier, actions[{kind, path, status}], exitCode}` envelope instead of human text. |
|
|
85
|
+
|
|
86
|
+
Exit codes: `0` applied (or previewed), `1` something was refused, `2` could not run. A refusal names
|
|
87
|
+
the flag that would allow it and never stops the rest of the plan — one file that says no does not
|
|
88
|
+
cost a project the other nine.
|
|
89
|
+
|
|
90
|
+
Nothing is fetched. `init` installs from the carrier bundled in this package, from the
|
|
91
|
+
`@narrativetrace/skills` the project itself resolves, or from the directory `--from` names, in that
|
|
92
|
+
order. There is no build hook and nothing to schedule: **run `init` again to refresh.** On a project
|
|
93
|
+
that already carries the skills, a re-run rewrites only our own pages and our own marked section.
|
|
94
|
+
|
|
95
|
+
When the pages about to land belong to a different release than the project resolves — `npx` fetches
|
|
96
|
+
the latest CLI unless you keep it as a dev dependency — the run prints one note on stderr naming both
|
|
97
|
+
versions and the command that installs the matching pages. A note, never a refusal: an empty
|
|
98
|
+
directory has no release to match.
|
|
99
|
+
|
|
100
|
+
## `narrativetrace uninstall`
|
|
101
|
+
|
|
102
|
+
Removes exactly what `init` wrote: skill directories carrying its provenance line, the marked
|
|
103
|
+
section, and the one `@AGENTS.md` import line. Nothing beside it — a directory that still holds
|
|
104
|
+
somebody else's file is left alone and reported.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx --yes @narrativetrace/cli uninstall --dry-run
|
|
108
|
+
npx --yes @narrativetrace/cli uninstall
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Takes `--dry-run`, `--only`, `--json` and the same exit codes. It opens no carrier: what to remove is
|
|
112
|
+
read from the project itself.
|
|
113
|
+
|
|
43
114
|
## License
|
|
44
115
|
|
|
45
116
|
Apache 2.0 — see [LICENSE](LICENSE). The rest of this repository's `@narrativetrace/*` packages
|