please-cli 0.1.4 → 0.1.5
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 +4 -3
- package/dist/cli.js +25 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ bun install
|
|
|
25
25
|
### 2. First-time setup
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
bun run
|
|
28
|
+
bun run dev --setup
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This will prompt you to:
|
|
@@ -38,11 +38,11 @@ This will prompt you to:
|
|
|
38
38
|
```bash
|
|
39
39
|
# Build install
|
|
40
40
|
# Points to the built CLI
|
|
41
|
-
bun run
|
|
41
|
+
bun run dev --install
|
|
42
42
|
|
|
43
43
|
# Dev mode install
|
|
44
44
|
# Points to the dev CLI
|
|
45
|
-
bun run
|
|
45
|
+
bun run dev --install --dev
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
After installing, reload your shell to activate the wrapper:
|
|
@@ -75,6 +75,7 @@ Options:
|
|
|
75
75
|
-h, --help Show help
|
|
76
76
|
--setup Run configuration setup
|
|
77
77
|
--install Install shell wrapper
|
|
78
|
+
--uninstall Remove shell wrapper
|
|
78
79
|
--install --dev Install wrapper in dev mode
|
|
79
80
|
--model [name] Change the model (prompts if no name given)
|
|
80
81
|
|
package/dist/cli.js
CHANGED
|
@@ -23088,10 +23088,10 @@ function cleanupTempFile() {
|
|
|
23088
23088
|
}
|
|
23089
23089
|
}
|
|
23090
23090
|
// src/shell/wrapper.ts
|
|
23091
|
-
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
23092
23091
|
import { homedir as homedir3 } from "os";
|
|
23093
23092
|
import { dirname, join as join3 } from "path";
|
|
23094
23093
|
import { existsSync as existsSync3, readFileSync as readFileSync2, appendFileSync, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
23094
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
23095
23095
|
var POWERSHELL_WRAPPER_START = "# >>> please-cli wrapper >>>";
|
|
23096
23096
|
var POWERSHELL_WRAPPER_END = "# <<< please-cli wrapper <<<";
|
|
23097
23097
|
function escapeRegExp(value) {
|
|
@@ -23154,27 +23154,20 @@ function detectShell() {
|
|
|
23154
23154
|
}
|
|
23155
23155
|
function generateWrapperInstructions(devMode = false) {
|
|
23156
23156
|
const shell = detectShell();
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
`));
|
|
23160
|
-
console.log(`Add the following function to your shell config file:
|
|
23161
|
-
`);
|
|
23157
|
+
v2.message(import_picocolors5.default.cyan("=== please-cli Setup ==="));
|
|
23158
|
+
v2.info("Add the following function to your shell config file:");
|
|
23162
23159
|
if (shell === "powershell" || process.platform === "win32") {
|
|
23163
|
-
|
|
23164
|
-
`));
|
|
23160
|
+
v2.info(import_picocolors5.default.yellow("For PowerShell, add to your $PROFILE:"));
|
|
23165
23161
|
console.log(getPowerShellWrapper(devMode));
|
|
23166
|
-
|
|
23167
|
-
`));
|
|
23162
|
+
v2.info(import_picocolors5.default.gray("Note: You may need to run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser"));
|
|
23168
23163
|
} else {
|
|
23169
|
-
|
|
23170
|
-
`));
|
|
23164
|
+
v2.info(import_picocolors5.default.yellow("For Bash (~/.bashrc) or Zsh (~/.zshrc):"));
|
|
23171
23165
|
console.log(getBashWrapper(devMode));
|
|
23172
23166
|
}
|
|
23173
|
-
|
|
23174
|
-
|
|
23175
|
-
|
|
23176
|
-
|
|
23177
|
-
`));
|
|
23167
|
+
v2.info(import_picocolors5.default.cyan("After adding, reload your shell config:"));
|
|
23168
|
+
v2.info(import_picocolors5.default.gray(" source ~/.bashrc # or"));
|
|
23169
|
+
v2.info(import_picocolors5.default.gray(" source ~/.zshrc # or"));
|
|
23170
|
+
v2.info(import_picocolors5.default.gray(" . $PROFILE # for PowerShell"));
|
|
23178
23171
|
}
|
|
23179
23172
|
function autoInstallWrapper(devMode = false) {
|
|
23180
23173
|
try {
|
|
@@ -23186,7 +23179,7 @@ function autoInstallWrapper(devMode = false) {
|
|
|
23186
23179
|
if (!content.includes("pls()")) {
|
|
23187
23180
|
appendFileSync(bashrc, `
|
|
23188
23181
|
` + getBashWrapper(devMode));
|
|
23189
|
-
|
|
23182
|
+
v2.success(import_picocolors5.default.green("Wrapper installed to ~/.bashrc"));
|
|
23190
23183
|
return true;
|
|
23191
23184
|
}
|
|
23192
23185
|
}
|
|
@@ -23197,7 +23190,7 @@ function autoInstallWrapper(devMode = false) {
|
|
|
23197
23190
|
if (!content.includes("pls()")) {
|
|
23198
23191
|
appendFileSync(zshrc, `
|
|
23199
23192
|
` + getBashWrapper(devMode));
|
|
23200
|
-
|
|
23193
|
+
v2.success(import_picocolors5.default.green("Wrapper installed to ~/.zshrc"));
|
|
23201
23194
|
return true;
|
|
23202
23195
|
}
|
|
23203
23196
|
}
|
|
@@ -23221,18 +23214,18 @@ ${POWERSHELL_WRAPPER_END}`;
|
|
|
23221
23214
|
if (blockRegex.test(content)) {
|
|
23222
23215
|
const updated = content.replace(blockRegex, managedBlock);
|
|
23223
23216
|
writeFileSync3(profilePath, updated, "utf-8");
|
|
23224
|
-
|
|
23217
|
+
v2.success(import_picocolors5.default.green(`Wrapper updated in ${profilePath}`));
|
|
23225
23218
|
} else {
|
|
23226
23219
|
appendFileSync(profilePath, `
|
|
23227
23220
|
${managedBlock}
|
|
23228
23221
|
`);
|
|
23229
|
-
|
|
23222
|
+
v2.success(import_picocolors5.default.green(`Wrapper installed to ${profilePath}`));
|
|
23230
23223
|
}
|
|
23231
23224
|
return true;
|
|
23232
23225
|
}
|
|
23233
23226
|
return false;
|
|
23234
23227
|
} catch (error2) {
|
|
23235
|
-
|
|
23228
|
+
v2.error(import_picocolors5.default.red(`Failed to auto-install wrapper: ${error2}`));
|
|
23236
23229
|
return false;
|
|
23237
23230
|
}
|
|
23238
23231
|
}
|
|
@@ -23264,7 +23257,7 @@ function autoUninstallWrapper() {
|
|
|
23264
23257
|
}
|
|
23265
23258
|
writeFileSync3(bashrc, newLines.join(`
|
|
23266
23259
|
`), "utf-8");
|
|
23267
|
-
|
|
23260
|
+
v2.success(import_picocolors5.default.green("Wrapper removed from ~/.bashrc"));
|
|
23268
23261
|
removed = true;
|
|
23269
23262
|
}
|
|
23270
23263
|
}
|
|
@@ -23292,7 +23285,7 @@ function autoUninstallWrapper() {
|
|
|
23292
23285
|
}
|
|
23293
23286
|
writeFileSync3(zshrc, newLines.join(`
|
|
23294
23287
|
`), "utf-8");
|
|
23295
|
-
|
|
23288
|
+
v2.success(import_picocolors5.default.green("Wrapper removed from ~/.zshrc"));
|
|
23296
23289
|
removed = true;
|
|
23297
23290
|
}
|
|
23298
23291
|
}
|
|
@@ -23309,18 +23302,18 @@ function autoUninstallWrapper() {
|
|
|
23309
23302
|
if (blockRegex.test(content)) {
|
|
23310
23303
|
const updated = content.replace(blockRegex, "");
|
|
23311
23304
|
writeFileSync3(profilePath, updated, "utf-8");
|
|
23312
|
-
|
|
23305
|
+
v2.success(import_picocolors5.default.green(`Wrapper removed from ${profilePath}`));
|
|
23313
23306
|
removed = true;
|
|
23314
23307
|
}
|
|
23315
23308
|
}
|
|
23316
23309
|
}
|
|
23317
23310
|
}
|
|
23318
23311
|
if (!removed) {
|
|
23319
|
-
|
|
23312
|
+
v2.warn(import_picocolors5.default.yellow("No wrapper found to remove."));
|
|
23320
23313
|
}
|
|
23321
23314
|
return removed;
|
|
23322
23315
|
} catch (error2) {
|
|
23323
|
-
|
|
23316
|
+
v2.error(import_picocolors5.default.red(`Failed to remove wrapper: ${error2}`));
|
|
23324
23317
|
return false;
|
|
23325
23318
|
}
|
|
23326
23319
|
}
|
|
@@ -23439,7 +23432,7 @@ Flags:
|
|
|
23439
23432
|
await runOnboarding();
|
|
23440
23433
|
fe("Setup complete!");
|
|
23441
23434
|
} catch (error2) {
|
|
23442
|
-
|
|
23435
|
+
v2.error(`Setup failed: ${error2}`);
|
|
23443
23436
|
process.exit(1);
|
|
23444
23437
|
}
|
|
23445
23438
|
return;
|
|
@@ -23521,13 +23514,11 @@ Flags:
|
|
|
23521
23514
|
fe("Command executed!");
|
|
23522
23515
|
process.exit(0);
|
|
23523
23516
|
} else {
|
|
23524
|
-
|
|
23517
|
+
v2.message(`
|
|
23525
23518
|
` + import_picocolors6.default.cyan("Generated command:"));
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
console.log(import_picocolors6.default.gray(` bun run install-wrapper
|
|
23530
|
-
`));
|
|
23519
|
+
v2.message(import_picocolors6.default.yellow(result.command));
|
|
23520
|
+
v2.info(import_picocolors6.default.gray("Tip: Install the shell wrapper to execute commands automatically:"));
|
|
23521
|
+
v2.info(import_picocolors6.default.gray(" pls --install"));
|
|
23531
23522
|
fe("Done!");
|
|
23532
23523
|
process.exit(0);
|
|
23533
23524
|
}
|