@constraint/cli 0.3.2 → 0.3.3
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/package.json
CHANGED
|
@@ -1,44 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: constraint-skills
|
|
3
|
-
description:
|
|
3
|
+
description: Operate governed Agent Skills with the Constraint terminal CLI and report their invocations. Use when an agent needs to authenticate or diagnose Constraint access; configure agents; discover upload domains; inspect, install, update, or upload skills; query run history; or invoke any skill installed from or governed by Constraint.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Constraint Skills
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use the `constraint` command for organization-authorized skills. Do not edit its config, lockfiles, instruction blocks, installation receipts, or authorization tokens directly.
|
|
9
|
+
|
|
10
|
+
## Choose the operation
|
|
11
|
+
|
|
12
|
+
- Authenticate or diagnose: `constraint login`, `constraint whoami`, `constraint doctor`.
|
|
13
|
+
- Configure agents: `constraint setup`.
|
|
14
|
+
- Discover or inspect skills: `constraint skills list`, `constraint skills inspect`.
|
|
15
|
+
- Install or update: `constraint skills install`, `constraint skills update`.
|
|
16
|
+
- Discover upload destinations: `constraint skills domains --json`.
|
|
17
|
+
- Upload a local skill folder: `constraint skills upload`.
|
|
18
|
+
- Review runs: `constraint skills run list`, `constraint skills run get`.
|
|
19
|
+
|
|
20
|
+
Read [references/commands.md](references/commands.md) before constructing flags or handling a less common operation.
|
|
21
|
+
|
|
22
|
+
## Upload skills
|
|
23
|
+
|
|
24
|
+
Upload the skill directory, not an individual `SKILL.md`. Before every upload, run:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
constraint skills domains --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use one returned `slug` exactly as `--domain`. Never guess a slug from a display name or reuse a domain from another organization. If multiple destinations are valid and ownership is unclear, ask the user.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
constraint skills upload <skill-directory> --domain <returned-slug>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Install skills
|
|
37
|
+
|
|
38
|
+
Choose the target agent and scope explicitly. Prefer `--project`; use `--global` only when the user wants the skill across projects. Prefer managed links and use `--copy` only when independent files are required. Never overwrite locally edited installed skills.
|
|
9
39
|
|
|
10
40
|
## Start a run
|
|
11
41
|
|
|
12
|
-
Immediately after selecting and loading a skill, run:
|
|
42
|
+
Immediately after selecting and loading a governed skill, run:
|
|
13
43
|
|
|
14
44
|
```bash
|
|
15
45
|
constraint skills run start <skill-name> --client <client> --session <session-id>
|
|
16
46
|
```
|
|
17
47
|
|
|
18
|
-
Use the invoked skill's frontmatter `name`. Normalize the client to `codex` or
|
|
19
|
-
`claude-code`. Use the current client session identifier. Retain the exact run ID
|
|
20
|
-
printed by the command. If one session invokes multiple skills, start and retain
|
|
21
|
-
a distinct run ID for each invocation.
|
|
48
|
+
Use the invoked skill's frontmatter `name`. Normalize the client to `codex` or `claude-code`. Use the current client session identifier. Retain the exact run ID printed by the command. If one session invokes multiple skills, start and retain a distinct run ID for each invocation.
|
|
22
49
|
|
|
23
|
-
If the command fails, report the failure briefly and continue the user's work.
|
|
24
|
-
Do not fabricate a run ID.
|
|
50
|
+
If the command fails, report the failure briefly and continue the user's work. Do not fabricate a run ID.
|
|
25
51
|
|
|
26
52
|
## Complete a run
|
|
27
53
|
|
|
28
|
-
After finishing the
|
|
29
|
-
the current session's real JSON or JSONL transcript file and run:
|
|
54
|
+
After finishing the governed skill's work and before ending the response, locate the current session's real JSON or JSONL transcript file and run:
|
|
30
55
|
|
|
31
56
|
```bash
|
|
32
57
|
constraint skills run complete <run-id> <transcript-path>
|
|
33
58
|
```
|
|
34
59
|
|
|
35
|
-
Pass the explicit local path. The CLI uploads the whole transcript file as it
|
|
36
|
-
exists at that moment and completes only that run. Never create a replacement
|
|
37
|
-
transcript, summarize it, pass a temporary file, or guess a path.
|
|
60
|
+
Pass the explicit local path. The CLI uploads the whole transcript file as it exists at that moment and completes only that run. Never create a replacement transcript, summarize it, pass a temporary file, or guess a path.
|
|
38
61
|
|
|
39
|
-
For multiple invocations, complete each retained run separately. Overlapping
|
|
40
|
-
full-session transcript prefixes are expected. If the transcript path cannot be
|
|
41
|
-
determined, leave the run started and tell the user that reporting could not be
|
|
42
|
-
completed.
|
|
62
|
+
For multiple invocations, complete each retained run separately. Overlapping full-session transcript prefixes are expected. If the transcript path cannot be determined, leave the run started and tell the user that reporting could not be completed.
|
|
43
63
|
|
|
44
64
|
Do not run completion hooks, background flushes, or pending-run scans.
|
|
65
|
+
|
|
66
|
+
## Work safely
|
|
67
|
+
|
|
68
|
+
- Use `--json` when parsing output.
|
|
69
|
+
- Respect WorkOS authorization failures; never bypass domain permissions.
|
|
70
|
+
- Do not invent an uninstall workflow.
|
|
71
|
+
- After mutations, report the affected skill, version, agent, scope, domain, or run ID as applicable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Constraint Skills"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $constraint-skills to
|
|
3
|
+
short_description: "Operate and report governed agent skills"
|
|
4
|
+
default_prompt: "Use $constraint-skills to manage a governed skill and report its run."
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Constraint CLI command reference
|
|
2
|
+
|
|
3
|
+
## Install, authenticate, and configure
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install --global @constraint/cli
|
|
7
|
+
constraint --version
|
|
8
|
+
constraint login
|
|
9
|
+
constraint whoami
|
|
10
|
+
constraint logout
|
|
11
|
+
constraint setup
|
|
12
|
+
constraint doctor
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`login` uses WorkOS device authorization. Never request or embed an API key or client secret. `setup` detects Codex and Claude Code, installs this skill, and deterministically merges a marked global instruction block without replacing unrelated instructions.
|
|
16
|
+
|
|
17
|
+
## Discover, inspect, install, and update
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
constraint skills list
|
|
21
|
+
constraint skills list --search <text>
|
|
22
|
+
constraint skills inspect <skill> [--version <number>] [--files]
|
|
23
|
+
|
|
24
|
+
constraint skills install <skill> --agent codex --project
|
|
25
|
+
constraint skills install <skill> --agent claude-code --global
|
|
26
|
+
constraint skills list --installed --project
|
|
27
|
+
constraint skills update <skill> --project
|
|
28
|
+
constraint skills update --all --global
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The catalog is already authorization-filtered. Project installs create `skills-lock.json`. Global receipts live in Constraint's per-user configuration directory.
|
|
32
|
+
|
|
33
|
+
## Discover upload domains and upload
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
constraint skills domains
|
|
37
|
+
constraint skills domains --json
|
|
38
|
+
constraint skills upload <skill-directory> --domain <returned-slug>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`skills domains` returns only domains where the authenticated user can manage skills. JSON objects contain the exact `slug`, display `name`, and `description`. Discover first and pass one returned slug. Ask the user when multiple domains fit and ownership is unclear.
|
|
42
|
+
|
|
43
|
+
## Start, complete, and review runs
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
constraint skills run start <skill> --client codex --session <stable-session-id>
|
|
47
|
+
constraint skills run complete <run-id> <actual-transcript-path>
|
|
48
|
+
|
|
49
|
+
constraint skills run list
|
|
50
|
+
constraint skills run list --team <domain> --user <workos-user-id> --skill <skill>
|
|
51
|
+
constraint skills run get <run-id>
|
|
52
|
+
constraint skills run get <run-id> --raw --output transcript.jsonl
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Repeat `--team`, `--user`, or `--skill` to request subsets. Review visibility is permission-controlled.
|
|
56
|
+
|
|
57
|
+
## Automation and recovery
|
|
58
|
+
|
|
59
|
+
Global flags: `--json`, `--quiet`, `--no-color`, `--help`, and `--version`. Installer workflows also accept `--yes`.
|
|
60
|
+
|
|
61
|
+
- Authentication failure: run `constraint login`, then `constraint whoami`.
|
|
62
|
+
- Setup uncertainty: run `constraint doctor`.
|
|
63
|
+
- Upload denied: rerun `constraint skills domains --json` and respect the returned scope.
|
|
64
|
+
- Install conflict: preserve local edits.
|
|
65
|
+
- Missing transcript: locate the real client JSON or JSONL file before completion.
|
package/src/cli.js
CHANGED
package/src/setup.js
CHANGED
|
@@ -12,9 +12,9 @@ export const BLOCK_END = '<!-- constraint-skills:end -->';
|
|
|
12
12
|
const BLOCK = `${BLOCK_START}
|
|
13
13
|
## Constraint Skills
|
|
14
14
|
|
|
15
|
-
When invoking any installed Agent Skill, load and
|
|
16
|
-
\`constraint-skills\` companion skill. It
|
|
17
|
-
|
|
15
|
+
When using the Constraint CLI or invoking any installed Agent Skill, load and
|
|
16
|
+
follow the global \`constraint-skills\` companion skill. It contains the CLI
|
|
17
|
+
workflow and records governed runs without modifying the invoked skill.
|
|
18
18
|
${BLOCK_END}`;
|
|
19
19
|
|
|
20
20
|
export function mergeInstructionBlock(existing) {
|