aiblueprint-cli 1.4.31 → 1.4.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/dist/cli.js +79 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -36191,6 +36191,40 @@ function getOpenclawTokenInfo() {
|
|
|
36191
36191
|
var import_fs_extra14 = __toESM(require_lib4(), 1);
|
|
36192
36192
|
var API_URL2 = "https://codeline.app/api/products";
|
|
36193
36193
|
var OPENCLAW_PRODUCT_ID = "prd_t2GRwX3aH1";
|
|
36194
|
+
var CLAUDE_CODE_TOOLS_INSTRUCTIONS = `
|
|
36195
|
+
## Claude Code (CLI)
|
|
36196
|
+
|
|
36197
|
+
Claude Code requires a TTY for interactive mode. When running in Docker or via exec without a PTY, use the \`script\` wrapper to simulate a TTY.
|
|
36198
|
+
|
|
36199
|
+
### Usage Pattern
|
|
36200
|
+
|
|
36201
|
+
\`\`\`bash
|
|
36202
|
+
# ALWAYS use this pattern to run Claude Code:
|
|
36203
|
+
script -q -c "claude -p 'your prompt here' --output-format json" /dev/null
|
|
36204
|
+
|
|
36205
|
+
# Examples:
|
|
36206
|
+
script -q -c "claude -p 'What is 4+4?' --output-format json" /dev/null
|
|
36207
|
+
script -q -c "claude -p 'Explain this error: connection refused' --output-format json" /dev/null
|
|
36208
|
+
\`\`\`
|
|
36209
|
+
|
|
36210
|
+
### Why?
|
|
36211
|
+
|
|
36212
|
+
Claude Code uses Ink (React for terminal) which requires \`stdin.setRawMode()\`. Without a TTY, this fails silently. The \`script\` command allocates a pseudo-TTY.
|
|
36213
|
+
|
|
36214
|
+
### Wrapper Script
|
|
36215
|
+
|
|
36216
|
+
A wrapper is available at \`/usr/local/bin/claude-run\`:
|
|
36217
|
+
|
|
36218
|
+
\`\`\`bash
|
|
36219
|
+
claude-run "your prompt here"
|
|
36220
|
+
\`\`\`
|
|
36221
|
+
|
|
36222
|
+
### Important
|
|
36223
|
+
|
|
36224
|
+
- NEVER run \`claude -p "..."\` directly - it will hang or fail silently
|
|
36225
|
+
- ALWAYS use the \`script\` wrapper or \`claude-run\`
|
|
36226
|
+
- Use \`--output-format json\` for structured output
|
|
36227
|
+
`.trim();
|
|
36194
36228
|
async function openclawProActivateCommand(userToken) {
|
|
36195
36229
|
Ie(source_default.blue(`\uD83D\uDD11 Activate OpenClaw Pro ${source_default.gray(`v${getVersion()}`)}`));
|
|
36196
36230
|
try {
|
|
@@ -36309,10 +36343,55 @@ async function openclawProSetupCommand(options = {}) {
|
|
|
36309
36343
|
}));
|
|
36310
36344
|
skillCount = dirs.filter(Boolean).length;
|
|
36311
36345
|
}
|
|
36346
|
+
spinner.start("Setting up workspace TOOLS.md...");
|
|
36347
|
+
const workspaceDir = path18.join(openclawDir, "workspace");
|
|
36348
|
+
const toolsPath = path18.join(workspaceDir, "TOOLS.md");
|
|
36349
|
+
await import_fs_extra14.default.ensureDir(workspaceDir);
|
|
36350
|
+
if (await import_fs_extra14.default.pathExists(toolsPath)) {
|
|
36351
|
+
const existingContent = await import_fs_extra14.default.readFile(toolsPath, "utf-8");
|
|
36352
|
+
if (!existingContent.includes("Claude Code (CLI)")) {
|
|
36353
|
+
await import_fs_extra14.default.appendFile(toolsPath, `
|
|
36354
|
+
|
|
36355
|
+
` + CLAUDE_CODE_TOOLS_INSTRUCTIONS);
|
|
36356
|
+
spinner.stop("TOOLS.md updated with Claude Code instructions");
|
|
36357
|
+
} else {
|
|
36358
|
+
spinner.stop("TOOLS.md already has Claude Code instructions");
|
|
36359
|
+
}
|
|
36360
|
+
} else {
|
|
36361
|
+
const defaultToolsMd = `# TOOLS.md - Local Notes
|
|
36362
|
+
|
|
36363
|
+
Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.
|
|
36364
|
+
|
|
36365
|
+
${CLAUDE_CODE_TOOLS_INSTRUCTIONS}
|
|
36366
|
+
`;
|
|
36367
|
+
await import_fs_extra14.default.writeFile(toolsPath, defaultToolsMd);
|
|
36368
|
+
spinner.stop("TOOLS.md created with Claude Code instructions");
|
|
36369
|
+
}
|
|
36370
|
+
spinner.start("Creating claude-run wrapper...");
|
|
36371
|
+
const claudeRunWrapper = `#!/bin/bash
|
|
36372
|
+
# Claude Code wrapper that handles TTY requirement
|
|
36373
|
+
# Usage: claude-run "your prompt here"
|
|
36374
|
+
|
|
36375
|
+
if [ -z "$1" ]; then
|
|
36376
|
+
echo "Usage: claude-run 'your prompt'"
|
|
36377
|
+
exit 1
|
|
36378
|
+
fi
|
|
36379
|
+
|
|
36380
|
+
script -q -c "claude -p '$1' --output-format json" /dev/null
|
|
36381
|
+
`;
|
|
36382
|
+
const binDir = "/usr/local/bin";
|
|
36383
|
+
const wrapperPath = path18.join(binDir, "claude-run");
|
|
36384
|
+
try {
|
|
36385
|
+
await import_fs_extra14.default.writeFile(wrapperPath, claudeRunWrapper, { mode: 493 });
|
|
36386
|
+
spinner.stop("claude-run wrapper created");
|
|
36387
|
+
} catch {
|
|
36388
|
+
spinner.stop("claude-run wrapper skipped (no write access to /usr/local/bin)");
|
|
36389
|
+
}
|
|
36312
36390
|
M2.success("✅ Setup complete!");
|
|
36313
36391
|
M2.info("Installed:");
|
|
36314
36392
|
M2.info(` • Skills (${skillCount})`);
|
|
36315
36393
|
M2.info(` • IDENTITY.md`);
|
|
36394
|
+
M2.info(` • TOOLS.md (Claude Code instructions)`);
|
|
36316
36395
|
M2.info(source_default.cyan(`
|
|
36317
36396
|
\uD83D\uDCA1 Skills installed to: ` + skillsDir));
|
|
36318
36397
|
Se(source_default.green("\uD83D\uDE80 OpenClaw Pro ready!"));
|