@pugi/cli 0.1.0-beta.14 → 0.1.0-beta.15
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/bin/run.js +33 -1
- package/dist/runtime/cli.js +170 -1
- package/dist/runtime/version.js +1 -1
- package/package.json +3 -3
package/bin/run.js
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
// 2026-05-27 — silence the noisy `node:sqlite` ExperimentalWarning.
|
|
3
|
+
// Node 22.x prints a multi-line warning the first time any consumer
|
|
4
|
+
// imports `node:sqlite` (see core/repl/store/session-store.ts). CEO has
|
|
5
|
+
// pinged this surface twice now ("(node:XXXXX) ExperimentalWarning:
|
|
6
|
+
// SQLite is an experimental feature and might change at any time" +
|
|
7
|
+
// trace-warnings hint). Hiding it cleanly requires a tap on
|
|
8
|
+
// process.emitWarning BEFORE any module loads the sqlite binding —
|
|
9
|
+
// hence wiring it here in the binary entry, not deep inside the CLI.
|
|
10
|
+
//
|
|
11
|
+
// We allowlist only the exact sqlite warning + leave every other
|
|
12
|
+
// runtime warning (deprecation, security, custom code paths) intact.
|
|
13
|
+
// Operator can still re-enable the noise by exporting
|
|
14
|
+
// PUGI_SHOW_EXPERIMENTAL_WARNINGS=1 — useful when debugging a node
|
|
15
|
+
// version bump that might surface a new experimental flag we should
|
|
16
|
+
// notice.
|
|
17
|
+
if (!process.env.PUGI_SHOW_EXPERIMENTAL_WARNINGS) {
|
|
18
|
+
const originalEmit = process.emit;
|
|
19
|
+
process.emit = function patchedEmit(name, ...args) {
|
|
20
|
+
if (name === 'warning') {
|
|
21
|
+
const w = args[0];
|
|
22
|
+
const isSqliteExperimental =
|
|
23
|
+
w &&
|
|
24
|
+
typeof w === 'object' &&
|
|
25
|
+
w.name === 'ExperimentalWarning' &&
|
|
26
|
+
typeof w.message === 'string' &&
|
|
27
|
+
/SQLite is an experimental feature/i.test(w.message);
|
|
28
|
+
if (isSqliteExperimental) return false;
|
|
29
|
+
}
|
|
30
|
+
return originalEmit.call(this, name, ...args);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
import('../dist/index.js');
|
package/dist/runtime/cli.js
CHANGED
|
@@ -832,7 +832,176 @@ async function version(_args, flags, _session) {
|
|
|
832
832
|
};
|
|
833
833
|
writeOutput(flags, payload, `pugi ${payload.version}`);
|
|
834
834
|
}
|
|
835
|
-
|
|
835
|
+
/**
|
|
836
|
+
* Per-command help bodies (task #100). When the operator types
|
|
837
|
+
* `pugi <cmd> --help` the dispatcher routes here with `args = [cmd]`.
|
|
838
|
+
* If we have a focused body for that command, print it instead of the
|
|
839
|
+
* global summary. Falls back to the global summary so unknown / new
|
|
840
|
+
* commands still get a useful response.
|
|
841
|
+
*
|
|
842
|
+
* Source of truth for each entry: the comment block at the top of the
|
|
843
|
+
* command's implementation module + any flags the command declares.
|
|
844
|
+
* Keep entries short — operators want the one-liner of intent + the
|
|
845
|
+
* 2-5 most useful flags, not a tutorial. The global help still has the
|
|
846
|
+
* full per-section reference; the per-command body is the "tell me
|
|
847
|
+
* how to use this NOW" surface.
|
|
848
|
+
*/
|
|
849
|
+
const COMMAND_HELP_BODIES = {
|
|
850
|
+
init: [
|
|
851
|
+
'pugi init — bootstrap a new Pugi workspace in the current directory.',
|
|
852
|
+
'',
|
|
853
|
+
'Creates .pugi/{PUGI.md, mcp.json, index.json, artifacts/, sessions/} and',
|
|
854
|
+
'seeds the 6 default skills. Idempotent — running again only fills gaps.',
|
|
855
|
+
'',
|
|
856
|
+
'Flags:',
|
|
857
|
+
' --no-defaults Skip the bundled default-skills install.',
|
|
858
|
+
'',
|
|
859
|
+
'Env:',
|
|
860
|
+
' PUGI_INIT_NO_DEFAULTS=1 Same as --no-defaults.',
|
|
861
|
+
],
|
|
862
|
+
explain: [
|
|
863
|
+
'pugi explain "<question>" — read-only Q&A about the workspace.',
|
|
864
|
+
'',
|
|
865
|
+
'Calls the engine loop in explain mode (budget: 5 calls / 20k tokens).',
|
|
866
|
+
'No file writes; safe to run against unfamiliar code.',
|
|
867
|
+
'',
|
|
868
|
+
'Examples:',
|
|
869
|
+
' pugi explain "what does this package.json define?"',
|
|
870
|
+
' pugi explain "trace the auth flow in src/auth/"',
|
|
871
|
+
],
|
|
872
|
+
code: [
|
|
873
|
+
'pugi code "<brief>" — engineering-mode write loop (30k token budget).',
|
|
874
|
+
'',
|
|
875
|
+
'Writes files in the current workspace. Use --no-tty in CI / pipes.',
|
|
876
|
+
],
|
|
877
|
+
fix: [
|
|
878
|
+
'pugi fix "<brief>" — minimal-diff bugfix loop (30k token budget).',
|
|
879
|
+
'',
|
|
880
|
+
'Same as `pugi code` but the prompt biases toward the smallest patch',
|
|
881
|
+
'that closes the brief — refuses scope creep / refactor invitations.',
|
|
882
|
+
],
|
|
883
|
+
build: [
|
|
884
|
+
'pugi build "<brief>" — feature-build loop (200k token budget).',
|
|
885
|
+
'',
|
|
886
|
+
'Multi-turn engineering with plan-review checkpoints. Pairs with',
|
|
887
|
+
'pugi plan --decompose <idea> when the brief is bigger than one PR.',
|
|
888
|
+
],
|
|
889
|
+
plan: [
|
|
890
|
+
'pugi plan --decompose <idea> — split an idea into 3-7 components.',
|
|
891
|
+
'',
|
|
892
|
+
'Writes .pugi/plan/<session-id>/splits/NN-<name>/spec.md plus',
|
|
893
|
+
'manifest.md with the dependency DAG. Pass each split to `pugi build`.',
|
|
894
|
+
],
|
|
895
|
+
review: [
|
|
896
|
+
'pugi review — code review surfaces.',
|
|
897
|
+
'',
|
|
898
|
+
' --triple 3-model consensus via Anvil paid fleet.',
|
|
899
|
+
' --triple --commit <SHA> Review a specific commit (vs origin/main).',
|
|
900
|
+
' --consensus Customer-facing consensus review (codex + claude + deepseek).',
|
|
901
|
+
' Optional: --commit <sha> | --pr <num> | --branch <name>.',
|
|
902
|
+
'',
|
|
903
|
+
'Exit codes: 0 PASS · 1 WARN · 2 BLOCK · 5 auth_missing · 7 rate_limited.',
|
|
904
|
+
],
|
|
905
|
+
privacy: [
|
|
906
|
+
'pugi privacy — privacy-mode operations.',
|
|
907
|
+
'',
|
|
908
|
+
' show Display effective mode + source.',
|
|
909
|
+
' set <mode> Local-only legacy values (local-only|metadata|full).',
|
|
910
|
+
'',
|
|
911
|
+
'For tenant-scoped server-side modes (strict|balanced|permissive), use:',
|
|
912
|
+
' pugi config get privacy',
|
|
913
|
+
' pugi config set privacy=<mode>',
|
|
914
|
+
],
|
|
915
|
+
config: [
|
|
916
|
+
'pugi config — read / write CLI + tenant configuration.',
|
|
917
|
+
'',
|
|
918
|
+
' get <key> Local config value.',
|
|
919
|
+
' get privacy Tenant privacy snapshot (admin-api).',
|
|
920
|
+
' get routing Effective routing table.',
|
|
921
|
+
' set <key>=<value> Local config write.',
|
|
922
|
+
' set privacy=<mode> Flip tenant privacy (strict|balanced|permissive).',
|
|
923
|
+
' set routing.<tag>.<budget>=<model> Override one routing lane.',
|
|
924
|
+
' unset routing.<tag>.<budget> Revert a routing override.',
|
|
925
|
+
' mcp trust|deny|list <name> MCP server trust + visibility.',
|
|
926
|
+
],
|
|
927
|
+
sync: [
|
|
928
|
+
'pugi sync — explicit-continuation handoff bundle upload.',
|
|
929
|
+
'',
|
|
930
|
+
' --dry-run Print the bundle plan without uploading.',
|
|
931
|
+
' --privacy <mode> Override per-bundle privacy posture.',
|
|
932
|
+
],
|
|
933
|
+
whoami: [
|
|
934
|
+
'pugi whoami — show the active credential + JWT principal + plan tier.',
|
|
935
|
+
'',
|
|
936
|
+
'Reads from ~/.pugi/credentials.json. No network call unless --remote.',
|
|
937
|
+
],
|
|
938
|
+
login: [
|
|
939
|
+
'pugi login — authenticate against an api.pugi.io endpoint.',
|
|
940
|
+
'',
|
|
941
|
+
'Interactive picker by default (browser OAuth / PAT / env). Non-interactive:',
|
|
942
|
+
' --provider device Device-flow OAuth.',
|
|
943
|
+
' --provider token --token <jwt> Pass a JWT directly.',
|
|
944
|
+
' --provider env --env PUGI_API_KEY Read from an env var.',
|
|
945
|
+
],
|
|
946
|
+
accounts: [
|
|
947
|
+
'pugi accounts — manage stored credentials across endpoints.',
|
|
948
|
+
'',
|
|
949
|
+
' list Every account + its endpoint + active flag.',
|
|
950
|
+
' switch <label> Re-point the active account.',
|
|
951
|
+
' remove <label> Delete a stored credential.',
|
|
952
|
+
],
|
|
953
|
+
jobs: [
|
|
954
|
+
'pugi jobs — list, tail, or kill background dispatch jobs.',
|
|
955
|
+
'',
|
|
956
|
+
' list All jobs in the registry.',
|
|
957
|
+
' tail <id> Stream output from one job.',
|
|
958
|
+
' kill <id> Cancel a running job.',
|
|
959
|
+
],
|
|
960
|
+
delegate: [
|
|
961
|
+
'pugi delegate <slug> "<brief>" — dispatch a brief to one specialist persona.',
|
|
962
|
+
'',
|
|
963
|
+
'Slugs (Tier 1 alpha 7.5): dev qa pm devops researcher analyst designer',
|
|
964
|
+
'frontend architect. `pugi roster` lists the live set.',
|
|
965
|
+
],
|
|
966
|
+
roster: [
|
|
967
|
+
'pugi roster — list the live Tier 1 personas + roles.',
|
|
968
|
+
],
|
|
969
|
+
doctor: [
|
|
970
|
+
'pugi doctor — diagnose CLI + workspace + adapter capabilities.',
|
|
971
|
+
'',
|
|
972
|
+
'Prints CLI version, Node version, workspace state (.pugi presence,',
|
|
973
|
+
'event log, settings), permission mode, and the capability matrix per',
|
|
974
|
+
'engine adapter. Safe to run anywhere; no network calls.',
|
|
975
|
+
],
|
|
976
|
+
ask: [
|
|
977
|
+
'pugi ask "<question>" — surface a yes/no question modal locally.',
|
|
978
|
+
'',
|
|
979
|
+
'Useful in shell scripts that need a human-confirm before a destructive',
|
|
980
|
+
'step. Exits 0 on yes, 1 on no, 2 on cancel.',
|
|
981
|
+
],
|
|
982
|
+
deploy: [
|
|
983
|
+
'pugi deploy — trigger a vendor deployment from the bound Git source.',
|
|
984
|
+
'',
|
|
985
|
+
' --target vercel <vercelProject> --project <id> Vercel deploy.',
|
|
986
|
+
' --target render <renderService> --project <id> Render deploy (Sprint 2 stub).',
|
|
987
|
+
' --status <id> Vendor-agnostic status snapshot.',
|
|
988
|
+
' --logs <id> [--tail] Build-log tail.',
|
|
989
|
+
'',
|
|
990
|
+
'Optional: --target-env production|preview, --ref <ref>, --integration <id>.',
|
|
991
|
+
],
|
|
992
|
+
};
|
|
993
|
+
async function help(args, flags, _session) {
|
|
994
|
+
// 2026-05-27 task #100: per-command help bodies. When dispatcher
|
|
995
|
+
// routed `pugi <cmd> --help` here it passes `args = [cmd]`; if we
|
|
996
|
+
// have a focused body, print that. Falls through to the global
|
|
997
|
+
// summary on unknown / new commands so the dispatcher's redirect
|
|
998
|
+
// never produces a worse-than-baseline response.
|
|
999
|
+
const requested = args[0];
|
|
1000
|
+
if (requested && COMMAND_HELP_BODIES[requested]) {
|
|
1001
|
+
const body = COMMAND_HELP_BODIES[requested];
|
|
1002
|
+
writeOutput(flags, { command: requested, lines: body }, body.join('\n'));
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
836
1005
|
const commands = Object.keys(handlers).sort();
|
|
837
1006
|
writeOutput(flags, { commands }, [
|
|
838
1007
|
'Pugi CLI',
|
package/dist/runtime/version.js
CHANGED
|
@@ -44,7 +44,7 @@ export function sanitizeSemver(raw) {
|
|
|
44
44
|
* during import). When bumping the CLI version BOTH literals must be
|
|
45
45
|
* updated; the release smoke-test (`pack:smoke`) verifies they agree.
|
|
46
46
|
*/
|
|
47
|
-
export const PUGI_CLI_VERSION = sanitizeSemver('0.1.0-beta.
|
|
47
|
+
export const PUGI_CLI_VERSION = sanitizeSemver('0.1.0-beta.15');
|
|
48
48
|
/**
|
|
49
49
|
* Outbound: the CLI's installed semver. Read at request time by
|
|
50
50
|
* `version-interceptor.ts` and injected on every `fetch` call.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pugi/cli",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.15",
|
|
4
4
|
"description": "Pugi CLI - terminal-native software execution system",
|
|
5
5
|
"homepage": "https://pugi.io",
|
|
6
6
|
"repository": {
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"ink": "^5.0.1",
|
|
49
49
|
"linkedom": "^0.18.12",
|
|
50
50
|
"react": "^18.3.1",
|
|
51
|
-
"tar": "^
|
|
51
|
+
"tar": "^7.5.11",
|
|
52
52
|
"tinyglobby": "^0.2.16",
|
|
53
53
|
"turndown": "^7.2.4",
|
|
54
54
|
"undici": "^8.3.0",
|
|
55
55
|
"zod": "^3.23.0",
|
|
56
56
|
"@pugi/personas": "0.1.2",
|
|
57
|
-
"@pugi/sdk": "0.1.0-beta.
|
|
57
|
+
"@pugi/sdk": "0.1.0-beta.15"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^22.0.0",
|