pulse-framework-cli 0.4.13 → 0.4.14

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.
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
@@ -145,9 +178,34 @@ function registerInitCommand(program) {
145
178
  .option("--no-interactive", "No interactive prompts")
146
179
  .action(async (opts) => {
147
180
  const start = node_path_1.default.resolve(opts.path ?? process.cwd());
148
- const repoRoot = await (0, paths_js_1.findRepoRoot)(start);
181
+ let repoRoot = await (0, paths_js_1.findRepoRoot)(start);
149
182
  if (!repoRoot) {
150
- throw new Error(`Not in a git repository: ${start}`);
183
+ // Not a git repo - offer to initialize
184
+ console.log("⚠️ Not a git repository.\n");
185
+ console.log("Pulse uses Git for checkpoints, commits, and safeguards.\n");
186
+ console.log("💡 Tip: If you have multiple projects in subfolders,");
187
+ console.log(" open the specific project folder, not the parent.\n");
188
+ console.log(" Example: Open /projects/myapp (with .git inside)");
189
+ console.log(" Not: Open /projects (containing multiple repos)\n");
190
+ const shouldInitGit = opts.interactive !== false
191
+ ? await (0, input_js_1.promptConfirm)("Initialize Git repository now?", true)
192
+ : true; // Auto-init in non-interactive mode
193
+ if (shouldInitGit) {
194
+ const { execSync } = await Promise.resolve().then(() => __importStar(require("child_process")));
195
+ try {
196
+ execSync("git init", { cwd: start, stdio: "inherit" });
197
+ console.log("✅ Git repository initialized\n");
198
+ repoRoot = start;
199
+ }
200
+ catch {
201
+ console.log("❌ Failed to initialize Git. Continuing without Git...\n");
202
+ repoRoot = start; // Use start as fallback
203
+ }
204
+ }
205
+ else {
206
+ console.log("⚠️ Continuing without Git (limited functionality)\n");
207
+ repoRoot = start;
208
+ }
151
209
  }
152
210
  // eslint-disable-next-line no-console
153
211
  console.log("\n🎯 PULSE Init\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-framework-cli",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "description": "Pulse Framework CLI – Guardrails, checkpoints, and escalation for AI-assisted development.",
5
5
  "author": "Manuel Fuß <kontakt@manuel-fuss.de>",
6
6
  "license": "MIT",