@promptframe/cli 0.1.30 → 0.1.32
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 +51 -7
- package/dist/index.js +911 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ PromptFrame component authoring CLI.
|
|
|
4
4
|
|
|
5
5
|
Use it to inspect the public component standard, check component folders, validate manifests, inspect the local preview envelope, package source archives, upload components, check build status, rebuild evidence indexes, and rerun layout/security probes.
|
|
6
6
|
|
|
7
|
-
Current npm registry baseline is `@promptframe/cli@0.1.
|
|
7
|
+
Current npm registry baseline is `@promptframe/cli@0.1.32`, `@promptframe/contracts@0.1.13`, `@promptframe/component-kit@0.1.11`, and `create-promptframe-component@0.1.21`. The published CLI consumes the contracts AST-aware public security policy evaluator, reports `securityPolicyDigest` / `securityEvaluatorMode` in JSON output, reports `publicResources` for component-level public assets, keeps native `<img>` / `<video>` source checks case-sensitive so Remotion `<Img>` / `<Video>` remain valid, supports endpoint discovery, project list/current diagnostics, self-service CI token create/list/revoke, single-component and workspace GitHub workflow setup, `promptframe-workspace.json` validation, workspace upload source metadata headers, packages sanitized lockfile evidence for platform admission, and supports `status --fail-on-build-failed` for CI build-status gating.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -D @promptframe/cli
|
|
@@ -18,6 +18,9 @@ npx promptframe login --endpoint https://your-promptframe.example/api-proxy
|
|
|
18
18
|
npx promptframe whoami
|
|
19
19
|
npx promptframe discovery
|
|
20
20
|
npx promptframe project list
|
|
21
|
+
npx promptframe init . --endpoint https://your-promptframe.example/api-proxy
|
|
22
|
+
npx promptframe component create @project-namespace/my-component --display-name "My Component"
|
|
23
|
+
npx promptframe component list
|
|
21
24
|
npx promptframe ci-token create --name "GitHub release" --scope component.upload --scope component.status.read --upload-target marketplace_authoring
|
|
22
25
|
npx promptframe upload ./component.zip --endpoint https://your-promptframe.example/api-proxy
|
|
23
26
|
npx promptframe upload ./component.zip --target project_private_generation --endpoint https://your-promptframe.example/api-proxy
|
|
@@ -31,6 +34,7 @@ Endpoint resolution is explicit and public-safe:
|
|
|
31
34
|
2. `PROMPTFRAME_API_BASE`
|
|
32
35
|
3. `REMOTION_MEDIA_API_BASE`
|
|
33
36
|
4. local config written by `promptframe configure --endpoint <url>`
|
|
37
|
+
5. secret-free `.promptframerc` in the current directory or a parent directory
|
|
34
38
|
|
|
35
39
|
The CLI embeds no production, Tailscale, local Docker, or private PromptFrame endpoint default. `dev .` starts the component template's local Vite preview shell. `check .` runs the local public policy checks, reports standard freshness for the selected upload lane, and emits deterministic `localReusability` diagnostics so low-reuse marketplace submissions are visible before upload. If no platform endpoint is available, `dev` / `check` return `standard.freshness.offline_degraded` as a warning instead of pretending the online standard was verified. `preview .` reads `src/preview-props.json` and reports the local preview envelope; `preview . --write-local-report` also validates saved `.promptframe/local-previews/*.json` cases and writes `.promptframe/local-previews/preview-report.json` for local author evidence. Neither command runs a custom runtime or replaces the platform iframe preview/render pipeline. Upload success only means the platform accepted the source package for trust-pipeline admission; use `status`, `reindex`, and `probe` to inspect build readiness, evidence/search readiness, and layout/security diagnostics.
|
|
36
40
|
|
|
@@ -38,6 +42,23 @@ Formal platform endpoints use bearer authentication. `promptframe login --endpoi
|
|
|
38
42
|
|
|
39
43
|
The platform derives tenant, user, and project from the browser-approved CLI token or scoped CI token. External authors should not hand-enter internal IDs, and formal endpoints reject dev identity headers. `whoami --json` is the safe way to inspect the current token kind, display identity, endpoint, scopes, upload targets, and project binding without exposing the token secret. `discovery --json` reports endpoint capabilities, and `project list --json` / `project current --json` report accessible projects. Server-side project switching is not a public CLI contract yet, so the CLI does not pretend that local config can override the platform principal. CI tokens are project-scoped automation credentials; store them in secret managers such as GitHub Actions secrets, not in source files.
|
|
40
44
|
|
|
45
|
+
Project context is a source-safe convenience file, not a credential. After login, run:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx promptframe init . --endpoint "$PROMPTFRAME_API_BASE" --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This writes `.promptframerc` with schema `promptframe-project-context.v0.1.0`, endpoint, tenant/project identifiers, project namespace, default upload target, and workspace config name. It must not contain token secrets, cookies, passwords, API keys, authorization headers, Auth0 subjects, or CI token material. Tokens stay in the local CLI config or CI secret store.
|
|
52
|
+
|
|
53
|
+
Project components are explicit declarations owned by the platform Project:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx promptframe component create @project-namespace/my-component --display-name "My Component" --json
|
|
57
|
+
npx promptframe component list --json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`component create` and `component list` use bearer auth and do not send owner override fields. CI upload of an undeclared component can fail with `component_registry.not_declared`; create the component first from Admin Project Setup or with `promptframe component create`.
|
|
61
|
+
|
|
41
62
|
After browser login, authors can create and manage their own project-scoped CI tokens without asking an administrator:
|
|
42
63
|
|
|
43
64
|
```bash
|
|
@@ -69,19 +90,37 @@ The upload-to-publish lifecycle has multiple gates. `upload` returning success m
|
|
|
69
90
|
|
|
70
91
|
The default CLI workflow assumes a single component repository: the current directory is the component package and contains `manifest.json`, `package.json`, `src/`, and optional `public/`.
|
|
71
92
|
|
|
72
|
-
Monorepos are allowed only when
|
|
93
|
+
Monorepos are allowed only when component mapping is explicit. `promptframe-workspace.json` is the supported workspace SSOT; it lists each component `id` and relative `path`. `workspace validate` confirms every path exists and every selected directory's `manifest.json` declares the same id before upload. `PROMPTFRAME_CI_TOKEN` authorizes the upload; it does not map a repository, commit, or tag to a component for you.
|
|
94
|
+
|
|
95
|
+
Create a workspace scaffold:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx -y create-promptframe-component@latest ./component-workspace \
|
|
99
|
+
--workspace \
|
|
100
|
+
--component image-particle-remotion \
|
|
101
|
+
--display-name "Image Particle Remotion"
|
|
102
|
+
cd component-workspace
|
|
103
|
+
npx promptframe workspace validate . --json
|
|
104
|
+
npx promptframe check . --workspace-component @marketplace/image-particle-remotion --json
|
|
105
|
+
npx promptframe setup-ci . --provider github --workspace
|
|
106
|
+
npx promptframe upload . --workspace-component @marketplace/image-particle-remotion --endpoint "$PROMPTFRAME_API_BASE" --json
|
|
107
|
+
```
|
|
73
108
|
|
|
74
|
-
|
|
109
|
+
Add a component to an existing workspace:
|
|
75
110
|
|
|
76
111
|
```bash
|
|
77
|
-
npx promptframe
|
|
78
|
-
npx promptframe
|
|
112
|
+
npx promptframe workspace add . components/motion-intro/image-particle-remotion --id @marketplace/image-particle-remotion
|
|
113
|
+
npx promptframe workspace validate . --json
|
|
114
|
+
```
|
|
79
115
|
|
|
116
|
+
The path-explicit single-directory form remains valid if you intentionally run inside one component package:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
80
119
|
cd components/motion-intro/image-particle-remotion
|
|
81
120
|
npx promptframe upload . --endpoint "$PROMPTFRAME_API_BASE" --json
|
|
82
121
|
```
|
|
83
122
|
|
|
84
|
-
Do not run `promptframe upload .` at a monorepo root unless the root itself is a valid component package. If you use tag triggers, treat the tag only as a CI trigger or human-readable version hint; the upload mapping still comes from
|
|
123
|
+
Do not run `promptframe upload .` at a monorepo root unless the root itself is a valid component package. If you use tag triggers, treat the tag only as a CI trigger or human-readable version hint; the upload mapping still comes from `promptframe-workspace.json`, `--workspace-component`, and the uploaded manifest. Workspace uploads send source metadata headers so the platform can record the workspace config, selected component id, component path, and manifest id alongside the build record.
|
|
85
124
|
|
|
86
125
|
For external CodingAI, the feedback order is: local CLI JSON diagnostics, GitHub Check annotations, Action summary, artifact report, then platform `status` / admission diagnostics. The CLI never needs internal PromptFrame REQ/TASK/QA docs, agent boards, private endpoint defaults, Auth0 subjects, cookies, or token secrets.
|
|
87
126
|
|
|
@@ -96,10 +135,15 @@ npx promptframe upgrade . --dry-run --json
|
|
|
96
135
|
npx promptframe dev . --dry-run --json
|
|
97
136
|
npx promptframe preview . --json
|
|
98
137
|
npx promptframe preview . --write-local-report --json
|
|
138
|
+
npx promptframe workspace validate . --json
|
|
139
|
+
npx promptframe check . --workspace-component @marketplace/my-component --json
|
|
99
140
|
npx promptframe login --endpoint "$PROMPTFRAME_API_BASE" --json
|
|
100
141
|
npx promptframe whoami --json
|
|
101
142
|
npx promptframe discovery --json
|
|
102
143
|
npx promptframe project list --json
|
|
144
|
+
npx promptframe init . --json
|
|
145
|
+
npx promptframe component list --json
|
|
146
|
+
npx promptframe component create @marketplace/my-component --display-name "My Component" --json
|
|
103
147
|
npx promptframe ci-token list --status active --json
|
|
104
148
|
npx promptframe upload ./component.zip --endpoint "$PROMPTFRAME_API_BASE" --json
|
|
105
149
|
npx promptframe status <buildId> --json
|
|
@@ -108,7 +152,7 @@ npx promptframe probe <buildId> --level standard --json
|
|
|
108
152
|
npx promptframe logout --json
|
|
109
153
|
```
|
|
110
154
|
|
|
111
|
-
Every JSON response includes a stable `diagnostic.code`, for example `standard.completed`, `doctor.completed`, `validate.completed`, `check.completed`, `upgrade.dry_run`, `dev.ready`, `preview.ready`, `preview.local_report.written`, `login.completed`, `whoami.completed`, `discovery.completed`, `project.list.completed`, `project.current.completed`, `ci_token.create.completed`, `ci_token.list.completed`, `ci_token.revoke.completed`, `logout.completed`, `upload.completed`, `status.completed`, `reindex.completed`, or `probe.completed`. `standard --json`, `validate --json`, and `check --json` report the active public security policy metadata; use `securityPolicyVersion`, `securityPolicyDigest`, and `securityEvaluatorMode` to compare release cohorts instead of scraping prose. `validate --json` and `check --json` also report `checkedRuleIds` for the public policy checks they ran. `upgrade --dry-run --json` reports package floor changes without writing files. `dev --dry-run --json` reports the local preview command without starting a long-running process. JSON failures include `failureReason` and `retryable`. Missing endpoint failures exit with code `2` and use `<command>.endpoint.missing`; missing credentials use `cli.auth.login_required`.
|
|
155
|
+
Every JSON response includes a stable `diagnostic.code`, for example `standard.completed`, `doctor.completed`, `validate.completed`, `check.completed`, `upgrade.dry_run`, `dev.ready`, `preview.ready`, `preview.local_report.written`, `login.completed`, `whoami.completed`, `discovery.completed`, `project.list.completed`, `project.current.completed`, `project_context.init.completed`, `component.list.completed`, `component.create.completed`, `ci_token.create.completed`, `ci_token.list.completed`, `ci_token.revoke.completed`, `logout.completed`, `upload.completed`, `status.completed`, `reindex.completed`, or `probe.completed`. `standard --json`, `validate --json`, and `check --json` report the active public security policy metadata; use `securityPolicyVersion`, `securityPolicyDigest`, and `securityEvaluatorMode` to compare release cohorts instead of scraping prose. `validate --json` and `check --json` also report `checkedRuleIds` for the public policy checks they ran. `upgrade --dry-run --json` reports package floor changes without writing files. `dev --dry-run --json` reports the local preview command without starting a long-running process. JSON failures include `failureReason` and `retryable`. Missing endpoint failures exit with code `2` and use `<command>.endpoint.missing`; missing credentials use `cli.auth.login_required`.
|
|
112
156
|
|
|
113
157
|
`standard --json` also returns `authoringStandardRelease` and `freshness`. These fields are the public SSOT for package floors, upload targets, standard source hash, and local freshness decisions:
|
|
114
158
|
|