pan-stack-cli 0.1.4 → 0.2.1

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.
Files changed (64) hide show
  1. package/README.md +572 -23
  2. package/bin/pan.js +206 -20
  3. package/lib/ai-skills.js +829 -0
  4. package/lib/create.js +22 -4
  5. package/lib/discover.js +69 -2
  6. package/lib/git/git-checkout.js +395 -0
  7. package/lib/git/git-clone.js +163 -28
  8. package/lib/git/git-fetch-all.js +100 -33
  9. package/lib/git/git-grv.js +68 -37
  10. package/lib/git/git-gst.js +97 -26
  11. package/lib/git/git-mr.js +546 -0
  12. package/lib/git/git-pull.js +104 -43
  13. package/lib/git/git-push.js +150 -41
  14. package/lib/git/git-sync-main.js +334 -0
  15. package/lib/git/helpers/bulk-report.js +202 -0
  16. package/lib/git/helpers/cli.js +41 -5
  17. package/lib/git/helpers/colors.js +19 -0
  18. package/lib/git/helpers/git.js +74 -0
  19. package/lib/git/helpers/manifest.js +93 -0
  20. package/lib/git/helpers/repo-select.js +416 -0
  21. package/lib/git/helpers/repo-summary.js +161 -0
  22. package/lib/i18n.js +61 -0
  23. package/lib/inquirer-theme.js +20 -0
  24. package/lib/language.js +121 -0
  25. package/lib/languages.js +14 -0
  26. package/lib/manifest.js +115 -14
  27. package/lib/menu-prompt.js +201 -0
  28. package/lib/menu.js +134 -0
  29. package/lib/messages.js +647 -0
  30. package/lib/run-command.js +173 -52
  31. package/lib/select.js +0 -0
  32. package/lib/serve.js +75 -0
  33. package/lib/skill-registry-client.js +173 -0
  34. package/lib/stats/aggregate.js +51 -0
  35. package/lib/stats/identity.js +20 -0
  36. package/lib/stats/index.js +189 -0
  37. package/lib/stats/parse.js +46 -0
  38. package/lib/stats/range.js +38 -0
  39. package/lib/stats/report.js +264 -0
  40. package/lib/stats/review.js +157 -0
  41. package/lib/stats/scan.js +92 -0
  42. package/lib/stats/serve.js +25 -0
  43. package/lib/ui/api.js +202 -0
  44. package/lib/ui/clone.js +115 -0
  45. package/lib/ui/config.js +182 -0
  46. package/lib/ui/diff.js +128 -0
  47. package/lib/ui/export-gate.js +79 -0
  48. package/lib/ui/gen-react-mobile-code.js +6 -0
  49. package/lib/ui/gen-react-web-code.js +75 -0
  50. package/lib/ui/index.js +89 -0
  51. package/lib/ui/init.js +252 -0
  52. package/lib/ui/login.js +128 -0
  53. package/lib/ui/logout.js +22 -0
  54. package/lib/ui/palettes.js +103 -0
  55. package/lib/ui/published-html.js +24 -0
  56. package/lib/ui/sync.js +137 -0
  57. package/lib/ui/workspace.js +213 -0
  58. package/package.json +10 -3
  59. package/templates/workspace/.claude/skills/writing-guidelines/SKILL.md +0 -48
  60. package/templates/workspace/.codex/skills/writing-guidelines/SKILL.md +0 -48
  61. package/templates/workspace/.cursor/skills/writing-guidelines/SKILL.md +0 -48
  62. package/templates/workspace/.pan.yaml +0 -25
  63. package/templates/workspace/.project.yaml +0 -15
  64. package/templates/workspace/README.md +0 -35
@@ -2,11 +2,13 @@
2
2
  /*
3
3
  * Git status for PAN Stack project repositories.
4
4
  *
5
- * oh-my-zsh-style alias for gst — git status on workspace + child repos.
5
+ * Default: compact summary — only repos with changes and file counts.
6
+ * Use --verbose or pass git status args for full git status output.
6
7
  */
7
8
 
8
9
  const { parseCommonArgs, loadManifestRepos, printCommonOptions } = require("./helpers/cli");
9
10
  const { ensureRepoExists, isGitRepo, runGitStatus } = require("./helpers/git");
11
+ const { getRepoStatusSummary, printChangeSummary } = require("./helpers/repo-summary");
10
12
 
11
13
  function printRepoStatus({ label, destination, dryRun, gitArgs }) {
12
14
  const statusArgs = gitArgs.length > 0 ? gitArgs.join(" ") : "";
@@ -21,37 +23,61 @@ function printRepoStatus({ label, destination, dryRun, gitArgs }) {
21
23
  console.log("");
22
24
  }
23
25
 
24
- function showWorkspaceRootStatus({ workspaceRoot, dryRun, gitArgs }) {
25
- if (!isGitRepo(workspaceRoot)) {
26
- return;
26
+ function collectRepoStatus({ name, destination, dryRun }) {
27
+ if (dryRun) {
28
+ return {
29
+ name,
30
+ destination,
31
+ branch: "",
32
+ total: 0,
33
+ staged: 0,
34
+ unstaged: 0,
35
+ untracked: 0,
36
+ dryRun: true,
37
+ };
27
38
  }
28
39
 
29
- printRepoStatus({
30
- label: "workspace",
31
- destination: workspaceRoot,
32
- dryRun,
33
- gitArgs,
34
- });
40
+ const summary = getRepoStatusSummary(destination);
41
+ return {
42
+ name,
43
+ destination,
44
+ ...summary,
45
+ };
46
+ }
47
+
48
+ function printSummaryDryRun({ totalRepos, includeWorkspace, repoCount }) {
49
+ console.log("");
50
+ console.log("[dry-run] gst summary");
51
+ console.log(
52
+ `[dry-run] would scan ${totalRepos} repo(s)` +
53
+ (includeWorkspace ? " (workspace + manifest)" : " (manifest only)")
54
+ );
55
+ console.log(`[dry-run] manifest repos: ${repoCount}`);
35
56
  }
36
57
 
37
58
  function printHelp() {
38
- console.log(`usage: git-gst.js [--base-dir BASE_DIR] [--dry-run] [--no-workspace] [manifest] [git status args...]
59
+ console.log(`usage: git-gst.js [--base-dir BASE_DIR] [--dry-run] [--no-workspace] [--verbose] [manifest] [git status args...]
39
60
 
40
- Run git status for workspace root and each repository in the manifest.
41
- Extra args are forwarded to git status (e.g. -s, -sb).
61
+ Show a compact summary of repos with uncommitted changes (default).
62
+ Only dirty repos are listed with file counts; clean repos are hidden.
42
63
 
43
64
  ${printCommonOptions()}
44
- --no-workspace Skip workspace root (manifest repos only)`);
65
+ --no-workspace Skip workspace root (manifest repos only)
66
+ --verbose Full git status for every repo (legacy output)
67
+ [git status args] Implies --verbose (e.g. pan gst -sb)`);
45
68
  }
46
69
 
47
70
  function main() {
48
71
  const args = parseCommonArgs(process.argv.slice(2), {
49
- defaults: { noWorkspace: false, gitArgs: [] },
72
+ defaults: { noWorkspace: false, verbose: false, gitArgs: [] },
50
73
  passthrough: true,
51
74
  handlers: {
52
75
  "--no-workspace": (parsed) => {
53
76
  parsed.noWorkspace = true;
54
77
  },
78
+ "--verbose": (parsed) => {
79
+ parsed.verbose = true;
80
+ },
55
81
  },
56
82
  });
57
83
  if (args.help) {
@@ -60,30 +86,75 @@ function main() {
60
86
  }
61
87
 
62
88
  const gitArgs = args.gitArgs || [];
89
+ const verbose = args.verbose || gitArgs.length > 0;
63
90
  const { repos, workspaceRoot } = loadManifestRepos({
64
91
  manifestPath: args.manifest,
65
92
  baseDir: args.baseDir,
66
93
  });
67
94
 
68
- if (!args.noWorkspace) {
69
- showWorkspaceRootStatus({
70
- workspaceRoot,
71
- dryRun: args.dryRun,
72
- gitArgs,
73
- });
95
+ if (verbose) {
96
+ if (!args.noWorkspace && isGitRepo(workspaceRoot)) {
97
+ printRepoStatus({
98
+ label: "workspace",
99
+ destination: workspaceRoot,
100
+ dryRun: args.dryRun,
101
+ gitArgs,
102
+ });
103
+ }
104
+
105
+ for (const repo of repos) {
106
+ if (!ensureRepoExists({ name: repo.name, destination: repo.destination })) {
107
+ continue;
108
+ }
109
+ printRepoStatus({
110
+ label: repo.name,
111
+ destination: repo.destination,
112
+ dryRun: args.dryRun,
113
+ gitArgs,
114
+ });
115
+ }
116
+ return;
117
+ }
118
+
119
+ const results = [];
120
+
121
+ if (!args.noWorkspace && isGitRepo(workspaceRoot)) {
122
+ results.push(
123
+ collectRepoStatus({
124
+ name: "workspace",
125
+ destination: workspaceRoot,
126
+ dryRun: args.dryRun,
127
+ })
128
+ );
74
129
  }
75
130
 
76
131
  for (const repo of repos) {
77
132
  if (!ensureRepoExists({ name: repo.name, destination: repo.destination })) {
78
133
  continue;
79
134
  }
80
- printRepoStatus({
81
- label: repo.name,
82
- destination: repo.destination,
83
- dryRun: args.dryRun,
84
- gitArgs,
135
+ results.push(
136
+ collectRepoStatus({
137
+ name: repo.name,
138
+ destination: repo.destination,
139
+ dryRun: args.dryRun,
140
+ })
141
+ );
142
+ }
143
+
144
+ if (args.dryRun) {
145
+ printSummaryDryRun({
146
+ totalRepos: results.length,
147
+ includeWorkspace: !args.noWorkspace && isGitRepo(workspaceRoot),
148
+ repoCount: repos.length,
85
149
  });
150
+ return;
86
151
  }
152
+
153
+ printChangeSummary({
154
+ title: "gst summary",
155
+ results,
156
+ totalRepos: results.length,
157
+ });
87
158
  }
88
159
 
89
160
  try {