@harnesspm/cli 0.17.0 → 0.18.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/CHANGELOG.md +6 -0
- package/README.md +10 -7
- package/dist/cli.js +26 -14
- package/dist/commands.d.ts +16 -6
- package/dist/commands.js +299 -157
- package/dist/exec-outputs.d.ts +2 -0
- package/dist/exec-outputs.js +5 -4
- package/dist/run.js +1 -1
- package/dist/start.d.ts +18 -0
- package/dist/start.js +136 -0
- package/docs/spec/01-overview.md +13 -6
- package/docs/spec/04-outputs.md +5 -5
- package/docs/spec/06-trust.md +1 -1
- package/docs/spec/07-added.md +1 -1
- package/docs/spec/09-cloud.md +1 -1
- package/docs/spec/10-cli.md +57 -29
- package/harness/dev.harnesspm/rules/harnesspm-config.md +1 -1
- package/harness/skills/harnesspm-export/SKILL.md +1 -1
- package/harness/skills/harnesspm-import/SKILL.md +10 -18
- package/package.json +1 -1
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: harnesspm-import
|
|
3
|
-
description:
|
|
3
|
+
description: Work with the harness a project takes from its dependencies, after setup, or add one on top. Covers trusting a package that ships tools, a cloned repository's harness with -C, a folder above several repositories, telemetry, and adding a harness such as the user's team's or their own. Use when the user asks about a package's agent rules or tools, to trust a package, to add a harness in this project or session, or to set up harnesspm.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Using harness in a project
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Setup is one command: `npx -y @harnesspm/cli init`. Do what it prints, and commit what it lists. In any folder, `npx -y @harnesspm/cli` says what the folder is and which command starts each task. In a project, it prints the report: packages, checks, and what waits for a person.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
npm i -D @harnesspm/cli
|
|
12
|
-
npx -y @harnesspm/cli init
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
`init` adds `harnesspm sync` to the `postinstall` script of a private package, or to `prepare` otherwise, so every full install updates the agent files. The `node -e` check in front of it skips the sync when harnesspm is not installed, as in `npm ci --omit=dev`. Keep it: a plain `harnesspm sync` fails such installs. When `doctor` reports the plain form, run `npx -y @harnesspm/cli init` again. After `npm install <pkg>` or `pnpm add`, run `npx -y @harnesspm/cli sync` yourself. Commit `package.json` and the package manager's lockfile, `harnesspm.json`, `harnesspm.lock.json`, the `AGENTS.md` block and the `CLAUDE.md` files that import `AGENTS.md`, also the ones next to nested `AGENTS.md` files.
|
|
16
|
-
|
|
17
|
-
In CI, run `npx -y @harnesspm/cli sync --check` after the install. With `CI=true`, `sync` leaves committed files as they are, so the check sees a missed sync. A job that commits them runs `npx -y @harnesspm/cli sync --write`.
|
|
10
|
+
## Trust and permissions
|
|
18
11
|
|
|
19
|
-
|
|
12
|
+
- **Tools of a package that is not trusted stay off.** Ask the user before you add a package to `trust` in `harnesspm.json`. Say what each tool does and whether it runs without a prompt: `npx -y @harnesspm/cli help <package>` lists them.
|
|
13
|
+
- **You cannot grant permissions.** When you run harnesspm, new allow rules, hooks and MCP servers wait for a person, unless the default branch already records them. Ask the user to run `npx -y @harnesspm/cli approve` in their own terminal. In a Claude Code cloud session, where the user has no terminal, give them the line that harnesspm prints for the environment's setup script instead. Do not edit agent settings files to work around it.
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
## Other tasks
|
|
22
16
|
|
|
23
|
-
- **Pending tools** come from packages the project does not trust yet. Ask the user before adding a package to `trust` in `harnesspm.json`, and say what each tool does: `harness/plugin.json` of its package has each script's `description`, and `"allow": true` when it asks to run without a prompt.
|
|
24
|
-
- **You cannot grant permissions.** When you run harnesspm, new allow rules, hooks and MCP servers stay pending, unless the default branch already records them. The held-back line says what differs. Ask the user to run `npx -y @harnesspm/cli approve` in their own terminal. In a Claude Code cloud session, where the user has no terminal, give them the line that harnesspm prints for the environment's setup script instead. Do not edit agent settings files to work around it.
|
|
25
17
|
- **One upstream rule does not fit** the project: run `npx -y @harnesspm/cli new patch <rule ID>` and edit only the sections that differ. Use a `replace` entry in `harnesspm.json` to change a whole rule or skill, or an `exclude` entry to drop a unit.
|
|
26
18
|
- **A job that does not install dependencies**, such as a review bot, runs `npx -y @harnesspm/cli fetch` first.
|
|
27
19
|
- **You work in a clone below your session's folder**, such as `work/app`: run `npx -y @harnesspm/cli -C work/app help` to list its tools, rules and skills, and add `-C work/app` to each tool command. Nothing in your own repository changes. Without the clone's install, self-contained scripts run from the fetched packages; a script that needs the install says so.
|
|
28
|
-
- **Sessions start in a folder above several repositories**, such as `/home/user` in a cloud session with more than one, or `~/work`: ask the user to run `npx -y @harnesspm/cli sync` in that folder, after the installs (in a cloud session, in the environment's setup script). It writes each repository's hooks there and a block in that folder's `AGENTS.md` that names each repository. If you run it, the block appears and the hooks
|
|
29
|
-
- **The team wants to see how agents use the harness:** add `"telemetry": { "send": { "file": ".harnesspm/events.jsonl" } }` to `harnesspm.json`, or a command as `send`, and ask the user to run `npx -y @harnesspm/cli
|
|
20
|
+
- **Sessions start in a folder above several repositories**, such as `/home/user` in a cloud session with more than one, or `~/work`: ask the user to run `npx -y @harnesspm/cli sync` in that folder, after the installs (in a cloud session, in the environment's setup script). It writes each repository's hooks there and a block in that folder's `AGENTS.md` that names each repository. If you run it, the block appears and the hooks wait for a person.
|
|
21
|
+
- **The team wants to see how agents use the harness:** add `"telemetry": { "send": { "file": ".harnesspm/events.jsonl" } }` to `harnesspm.json`, or a command as `send`, and ask the user to run `npx -y @harnesspm/cli approve`. A person opts out with `DO_NOT_TRACK=1`. The spec's telemetry chapter, in the docs index, has the events and a rule template for reporting harness problems.
|
|
30
22
|
|
|
31
|
-
##
|
|
23
|
+
## Add a harness on top
|
|
32
24
|
|
|
33
25
|
```bash
|
|
34
26
|
npx -y @harnesspm/cli add <source> # every repository on this machine
|
|
@@ -37,4 +29,4 @@ npx -y @harnesspm/cli add <source> --local # this repository only
|
|
|
37
29
|
|
|
38
30
|
The source is `github:<owner>/<repo>`, `git:<url>`, `npm:<package>` or a folder path. Add a team's harness before the user's own, so the user's wins. The command prints the added rules. Follow them from now on in this session.
|
|
39
31
|
|
|
40
|
-
Outputs of added harnesses never go into the project's repository. Do not commit them.
|
|
32
|
+
Outputs of added harnesses never go into the project's repository. Do not commit them. `npx -y @harnesspm/cli doctor` finds a per-machine file that git could commit, and names the fix. Ask the user before you untrack a file.
|