aiblueprint-cli 1.4.29 → 1.4.31
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 +339 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33100,6 +33100,7 @@ function getPlaySoundCommand(soundPath) {
|
|
|
33100
33100
|
var KNOWN_CLAUDE_PATHS = [
|
|
33101
33101
|
/\/Users\/[^/]+\/\.claude\//,
|
|
33102
33102
|
/\/home\/[^/]+\/\.claude\//,
|
|
33103
|
+
/\/root\/\.claude\//,
|
|
33103
33104
|
/C:\\Users\\[^\\]+\\\.claude\\/i
|
|
33104
33105
|
];
|
|
33105
33106
|
function transformHookCommand(command, claudeDir) {
|
|
@@ -33108,6 +33109,13 @@ function transformHookCommand(command, claudeDir) {
|
|
|
33108
33109
|
transformed = transformed.replace(pattern, `${claudeDir}/`);
|
|
33109
33110
|
}
|
|
33110
33111
|
transformed = transformed.replace(/\\/g, "/");
|
|
33112
|
+
const isAudioCommand = /^(afplay|paplay|aplay|mpv|ffplay|powershell)\s/.test(transformed);
|
|
33113
|
+
if (isAudioCommand) {
|
|
33114
|
+
const newCommand = transformAudioCommand(transformed, claudeDir);
|
|
33115
|
+
if (newCommand) {
|
|
33116
|
+
return newCommand;
|
|
33117
|
+
}
|
|
33118
|
+
}
|
|
33111
33119
|
return transformed;
|
|
33112
33120
|
}
|
|
33113
33121
|
function transformHook(hook, claudeDir) {
|
|
@@ -33151,12 +33159,39 @@ function isTextFile(filePath) {
|
|
|
33151
33159
|
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
33152
33160
|
return TEXT_FILE_EXTENSIONS.has(ext);
|
|
33153
33161
|
}
|
|
33162
|
+
function transformAudioCommand(command, claudeDir) {
|
|
33163
|
+
const soundFileMatch = command.match(/(?:finish\.mp3|need-human\.mp3|[^'"\s]+\.(?:mp3|wav))/);
|
|
33164
|
+
if (!soundFileMatch)
|
|
33165
|
+
return null;
|
|
33166
|
+
const soundFile = soundFileMatch[0];
|
|
33167
|
+
let soundPath;
|
|
33168
|
+
if (soundFile.includes("/")) {
|
|
33169
|
+
soundPath = soundFile;
|
|
33170
|
+
} else {
|
|
33171
|
+
soundPath = `${claudeDir}/song/${soundFile}`;
|
|
33172
|
+
}
|
|
33173
|
+
return getPlaySoundCommand(soundPath);
|
|
33174
|
+
}
|
|
33154
33175
|
function transformFileContent(content, claudeDir) {
|
|
33155
33176
|
let transformed = content;
|
|
33156
33177
|
for (const pattern of KNOWN_CLAUDE_PATHS) {
|
|
33157
33178
|
transformed = transformed.replace(new RegExp(pattern.source, "g"), `${claudeDir}/`);
|
|
33158
33179
|
}
|
|
33159
33180
|
transformed = transformed.replace(/\\/g, "/");
|
|
33181
|
+
const audioPatterns = [
|
|
33182
|
+
/afplay\s+-v\s+[\d.]+\s+'[^']+'/g,
|
|
33183
|
+
/afplay\s+'[^']+'/g,
|
|
33184
|
+
/paplay\s+'[^']+'/g,
|
|
33185
|
+
/aplay\s+'[^']+'/g,
|
|
33186
|
+
/mpv\s+--no-video[^']*'[^']+'/g,
|
|
33187
|
+
/ffplay\s+-nodisp[^']*'[^']+'/g
|
|
33188
|
+
];
|
|
33189
|
+
for (const pattern of audioPatterns) {
|
|
33190
|
+
transformed = transformed.replace(pattern, (match) => {
|
|
33191
|
+
const newCommand = transformAudioCommand(match, claudeDir);
|
|
33192
|
+
return newCommand || match;
|
|
33193
|
+
});
|
|
33194
|
+
}
|
|
33160
33195
|
return transformed;
|
|
33161
33196
|
}
|
|
33162
33197
|
|
|
@@ -36046,13 +36081,283 @@ async function backupLoadCommand(options = {}) {
|
|
|
36046
36081
|
}
|
|
36047
36082
|
}
|
|
36048
36083
|
|
|
36049
|
-
// src/commands/
|
|
36084
|
+
// src/commands/openclaw-pro.ts
|
|
36085
|
+
import os18 from "os";
|
|
36050
36086
|
import path18 from "path";
|
|
36051
|
-
import { homedir } from "os";
|
|
36052
36087
|
|
|
36053
|
-
// src/lib/
|
|
36088
|
+
// src/lib/openclaw-installer.ts
|
|
36054
36089
|
var import_fs_extra12 = __toESM(require_lib4(), 1);
|
|
36090
|
+
import os16 from "os";
|
|
36055
36091
|
import path16 from "path";
|
|
36092
|
+
import { exec as exec4 } from "child_process";
|
|
36093
|
+
import { promisify as promisify3 } from "util";
|
|
36094
|
+
var execAsync3 = promisify3(exec4);
|
|
36095
|
+
var OPENCLAW_PRO_REPO = "Melvynx/openclawpro";
|
|
36096
|
+
function getCacheRepoDir2() {
|
|
36097
|
+
return path16.join(os16.homedir(), ".config", "openclaw", "pro-repos", "openclawpro");
|
|
36098
|
+
}
|
|
36099
|
+
async function execGitWithAuth2(command, token, repoUrl, cwd) {
|
|
36100
|
+
const authenticatedUrl = `https://x-access-token:${token}@${repoUrl.replace(/^https?:\/\//, "")}`;
|
|
36101
|
+
const fullCommand = `git ${command.replace(repoUrl, authenticatedUrl)}`;
|
|
36102
|
+
try {
|
|
36103
|
+
await execAsync3(fullCommand, { cwd, timeout: 120000 });
|
|
36104
|
+
} catch (error) {
|
|
36105
|
+
throw new Error(`Git command failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
36106
|
+
}
|
|
36107
|
+
}
|
|
36108
|
+
async function cloneOrUpdateRepo2(token) {
|
|
36109
|
+
const cacheDir = getCacheRepoDir2();
|
|
36110
|
+
const repoUrl = `https://github.com/${OPENCLAW_PRO_REPO}.git`;
|
|
36111
|
+
if (await import_fs_extra12.default.pathExists(path16.join(cacheDir, ".git"))) {
|
|
36112
|
+
try {
|
|
36113
|
+
await execGitWithAuth2("pull", token, repoUrl, cacheDir);
|
|
36114
|
+
} catch (error) {
|
|
36115
|
+
await import_fs_extra12.default.remove(cacheDir);
|
|
36116
|
+
await import_fs_extra12.default.ensureDir(path16.dirname(cacheDir));
|
|
36117
|
+
await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
|
|
36118
|
+
}
|
|
36119
|
+
} else {
|
|
36120
|
+
await import_fs_extra12.default.ensureDir(path16.dirname(cacheDir));
|
|
36121
|
+
await execGitWithAuth2(`clone ${repoUrl} ${cacheDir}`, token, repoUrl);
|
|
36122
|
+
}
|
|
36123
|
+
return path16.join(cacheDir, "openclaw-config");
|
|
36124
|
+
}
|
|
36125
|
+
async function copyConfigFromCache2(cacheConfigDir, targetDir, onProgress) {
|
|
36126
|
+
const walk = async (dir, baseDir = dir) => {
|
|
36127
|
+
const entries = await import_fs_extra12.default.readdir(dir, { withFileTypes: true });
|
|
36128
|
+
for (const entry of entries) {
|
|
36129
|
+
const sourcePath = path16.join(dir, entry.name);
|
|
36130
|
+
const relativePath = path16.relative(baseDir, sourcePath);
|
|
36131
|
+
const targetPath = path16.join(targetDir, relativePath);
|
|
36132
|
+
if (entry.isDirectory()) {
|
|
36133
|
+
await import_fs_extra12.default.ensureDir(targetPath);
|
|
36134
|
+
onProgress?.(relativePath, "directory");
|
|
36135
|
+
await walk(sourcePath, baseDir);
|
|
36136
|
+
} else {
|
|
36137
|
+
await import_fs_extra12.default.copy(sourcePath, targetPath, { overwrite: true });
|
|
36138
|
+
onProgress?.(relativePath, "file");
|
|
36139
|
+
}
|
|
36140
|
+
}
|
|
36141
|
+
};
|
|
36142
|
+
await walk(cacheConfigDir);
|
|
36143
|
+
}
|
|
36144
|
+
async function installOpenclawProConfigs(options) {
|
|
36145
|
+
const { githubToken, openclawFolder, onProgress } = options;
|
|
36146
|
+
const targetFolder = openclawFolder || path16.join(os16.homedir(), ".openclaw");
|
|
36147
|
+
try {
|
|
36148
|
+
const cacheConfigDir = await cloneOrUpdateRepo2(githubToken);
|
|
36149
|
+
await copyConfigFromCache2(cacheConfigDir, targetFolder, onProgress);
|
|
36150
|
+
return;
|
|
36151
|
+
} catch (error) {
|
|
36152
|
+
throw new Error(`Failed to install OpenClaw Pro configs: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
36153
|
+
}
|
|
36154
|
+
}
|
|
36155
|
+
|
|
36156
|
+
// src/lib/openclaw-token-storage.ts
|
|
36157
|
+
var import_fs_extra13 = __toESM(require_lib4(), 1);
|
|
36158
|
+
import os17 from "os";
|
|
36159
|
+
import path17 from "path";
|
|
36160
|
+
function getConfigDir2() {
|
|
36161
|
+
const platform = os17.platform();
|
|
36162
|
+
if (platform === "win32") {
|
|
36163
|
+
return path17.join(process.env.APPDATA || os17.homedir(), "openclaw");
|
|
36164
|
+
}
|
|
36165
|
+
return path17.join(os17.homedir(), ".config", "openclaw");
|
|
36166
|
+
}
|
|
36167
|
+
function getTokenPath() {
|
|
36168
|
+
return path17.join(getConfigDir2(), "token.txt");
|
|
36169
|
+
}
|
|
36170
|
+
async function saveOpenclawToken(githubToken) {
|
|
36171
|
+
const configDir = getConfigDir2();
|
|
36172
|
+
await import_fs_extra13.default.ensureDir(configDir);
|
|
36173
|
+
await import_fs_extra13.default.writeFile(getTokenPath(), githubToken, { mode: 384 });
|
|
36174
|
+
}
|
|
36175
|
+
async function getOpenclawToken() {
|
|
36176
|
+
const tokenPath = getTokenPath();
|
|
36177
|
+
if (await import_fs_extra13.default.pathExists(tokenPath)) {
|
|
36178
|
+
const token = await import_fs_extra13.default.readFile(tokenPath, "utf8");
|
|
36179
|
+
return token.trim();
|
|
36180
|
+
}
|
|
36181
|
+
return null;
|
|
36182
|
+
}
|
|
36183
|
+
function getOpenclawTokenInfo() {
|
|
36184
|
+
return {
|
|
36185
|
+
path: getTokenPath(),
|
|
36186
|
+
platform: os17.platform()
|
|
36187
|
+
};
|
|
36188
|
+
}
|
|
36189
|
+
|
|
36190
|
+
// src/commands/openclaw-pro.ts
|
|
36191
|
+
var import_fs_extra14 = __toESM(require_lib4(), 1);
|
|
36192
|
+
var API_URL2 = "https://codeline.app/api/products";
|
|
36193
|
+
var OPENCLAW_PRODUCT_ID = "prd_t2GRwX3aH1";
|
|
36194
|
+
async function openclawProActivateCommand(userToken) {
|
|
36195
|
+
Ie(source_default.blue(`\uD83D\uDD11 Activate OpenClaw Pro ${source_default.gray(`v${getVersion()}`)}`));
|
|
36196
|
+
try {
|
|
36197
|
+
if (!userToken) {
|
|
36198
|
+
const result = await he({
|
|
36199
|
+
message: "Enter your OpenClaw Pro access token:",
|
|
36200
|
+
placeholder: "Your ProductsOnUsers ID from codeline.app",
|
|
36201
|
+
validate: (value) => {
|
|
36202
|
+
if (!value)
|
|
36203
|
+
return "Token is required";
|
|
36204
|
+
if (value.length < 5)
|
|
36205
|
+
return "Token seems invalid";
|
|
36206
|
+
return;
|
|
36207
|
+
}
|
|
36208
|
+
});
|
|
36209
|
+
if (pD(result)) {
|
|
36210
|
+
xe("Activation cancelled");
|
|
36211
|
+
process.exit(0);
|
|
36212
|
+
}
|
|
36213
|
+
userToken = result;
|
|
36214
|
+
}
|
|
36215
|
+
const spinner = Y2();
|
|
36216
|
+
spinner.start("Validating token...");
|
|
36217
|
+
const response = await fetch(`${API_URL2}/${OPENCLAW_PRODUCT_ID}/have-access?token=${userToken}`);
|
|
36218
|
+
if (!response.ok) {
|
|
36219
|
+
spinner.stop("Token validation failed");
|
|
36220
|
+
M2.error("Invalid token or no access");
|
|
36221
|
+
M2.info("Get OpenClaw Pro at: https://codeline.app");
|
|
36222
|
+
Se(source_default.red("❌ Activation failed"));
|
|
36223
|
+
process.exit(1);
|
|
36224
|
+
}
|
|
36225
|
+
const data = await response.json();
|
|
36226
|
+
if (!data.hasAccess) {
|
|
36227
|
+
spinner.stop("Token validation failed");
|
|
36228
|
+
M2.error("No access to OpenClaw Pro");
|
|
36229
|
+
Se(source_default.red("❌ Activation failed"));
|
|
36230
|
+
process.exit(1);
|
|
36231
|
+
}
|
|
36232
|
+
spinner.stop("Token validated");
|
|
36233
|
+
const githubToken = data.product.metadata?.["cli-github-token"];
|
|
36234
|
+
if (!githubToken) {
|
|
36235
|
+
M2.error("No GitHub token found in product metadata. Contact support.");
|
|
36236
|
+
Se(source_default.red("❌ Activation failed"));
|
|
36237
|
+
process.exit(1);
|
|
36238
|
+
}
|
|
36239
|
+
spinner.start("Saving token...");
|
|
36240
|
+
await saveOpenclawToken(githubToken);
|
|
36241
|
+
spinner.stop("Token saved");
|
|
36242
|
+
const tokenInfo = getOpenclawTokenInfo();
|
|
36243
|
+
M2.success("✅ Token activated!");
|
|
36244
|
+
M2.info(`User: ${data.user.name} (${data.user.email})`);
|
|
36245
|
+
M2.info(`Product: ${data.product.title}`);
|
|
36246
|
+
M2.info(`Token saved to: ${tokenInfo.path}`);
|
|
36247
|
+
M2.info(source_default.cyan(`
|
|
36248
|
+
\uD83D\uDCA1 Next step: Run 'npx aiblueprint-cli@latest openclaw pro setup'`));
|
|
36249
|
+
Se(source_default.green("✅ Activation complete!"));
|
|
36250
|
+
} catch (error) {
|
|
36251
|
+
if (error instanceof Error) {
|
|
36252
|
+
M2.error(error.message);
|
|
36253
|
+
}
|
|
36254
|
+
Se(source_default.red("❌ Activation failed"));
|
|
36255
|
+
process.exit(1);
|
|
36256
|
+
}
|
|
36257
|
+
}
|
|
36258
|
+
async function openclawProStatusCommand() {
|
|
36259
|
+
Ie(source_default.blue(`\uD83D\uDCCA OpenClaw Pro Status ${source_default.gray(`v${getVersion()}`)}`));
|
|
36260
|
+
try {
|
|
36261
|
+
const token = await getOpenclawToken();
|
|
36262
|
+
if (!token) {
|
|
36263
|
+
M2.warn("No token found");
|
|
36264
|
+
M2.info("Run: npx aiblueprint-cli@latest openclaw pro activate <token>");
|
|
36265
|
+
Se(source_default.yellow("⚠️ Not activated"));
|
|
36266
|
+
process.exit(0);
|
|
36267
|
+
}
|
|
36268
|
+
const tokenInfo = getOpenclawTokenInfo();
|
|
36269
|
+
M2.success("✅ Token active");
|
|
36270
|
+
M2.info(`Token file: ${tokenInfo.path}`);
|
|
36271
|
+
Se(source_default.green("Token is saved"));
|
|
36272
|
+
} catch (error) {
|
|
36273
|
+
if (error instanceof Error) {
|
|
36274
|
+
M2.error(error.message);
|
|
36275
|
+
}
|
|
36276
|
+
Se(source_default.red("❌ Failed to check status"));
|
|
36277
|
+
process.exit(1);
|
|
36278
|
+
}
|
|
36279
|
+
}
|
|
36280
|
+
async function openclawProSetupCommand(options = {}) {
|
|
36281
|
+
Ie(source_default.blue(`⚙️ Setup OpenClaw Pro ${source_default.gray(`v${getVersion()}`)}`));
|
|
36282
|
+
try {
|
|
36283
|
+
const githubToken = await getOpenclawToken();
|
|
36284
|
+
if (!githubToken) {
|
|
36285
|
+
M2.error("No token found");
|
|
36286
|
+
M2.info("Run: npx aiblueprint-cli@latest openclaw pro activate <token>");
|
|
36287
|
+
Se(source_default.red("❌ Not activated"));
|
|
36288
|
+
process.exit(1);
|
|
36289
|
+
}
|
|
36290
|
+
const openclawDir = options.folder ? path18.resolve(options.folder) : path18.join(os18.homedir(), ".openclaw");
|
|
36291
|
+
const spinner = Y2();
|
|
36292
|
+
const onProgress = (file, type) => {
|
|
36293
|
+
spinner.message(`Installing: ${source_default.cyan(file)} ${source_default.gray(`(${type})`)}`);
|
|
36294
|
+
};
|
|
36295
|
+
spinner.start("Installing OpenClaw Pro configurations...");
|
|
36296
|
+
await installOpenclawProConfigs({
|
|
36297
|
+
githubToken,
|
|
36298
|
+
openclawFolder: openclawDir,
|
|
36299
|
+
onProgress
|
|
36300
|
+
});
|
|
36301
|
+
spinner.stop("OpenClaw Pro configurations installed");
|
|
36302
|
+
let skillCount = 0;
|
|
36303
|
+
const skillsDir = path18.join(openclawDir, "skills");
|
|
36304
|
+
if (await import_fs_extra14.default.pathExists(skillsDir)) {
|
|
36305
|
+
const items = await import_fs_extra14.default.readdir(skillsDir);
|
|
36306
|
+
const dirs = await Promise.all(items.map(async (item) => {
|
|
36307
|
+
const stat = await import_fs_extra14.default.stat(path18.join(skillsDir, item));
|
|
36308
|
+
return stat.isDirectory();
|
|
36309
|
+
}));
|
|
36310
|
+
skillCount = dirs.filter(Boolean).length;
|
|
36311
|
+
}
|
|
36312
|
+
M2.success("✅ Setup complete!");
|
|
36313
|
+
M2.info("Installed:");
|
|
36314
|
+
M2.info(` • Skills (${skillCount})`);
|
|
36315
|
+
M2.info(` • IDENTITY.md`);
|
|
36316
|
+
M2.info(source_default.cyan(`
|
|
36317
|
+
\uD83D\uDCA1 Skills installed to: ` + skillsDir));
|
|
36318
|
+
Se(source_default.green("\uD83D\uDE80 OpenClaw Pro ready!"));
|
|
36319
|
+
} catch (error) {
|
|
36320
|
+
if (error instanceof Error) {
|
|
36321
|
+
M2.error(error.message);
|
|
36322
|
+
}
|
|
36323
|
+
Se(source_default.red("❌ Setup failed"));
|
|
36324
|
+
process.exit(1);
|
|
36325
|
+
}
|
|
36326
|
+
}
|
|
36327
|
+
async function openclawProUpdateCommand(options = {}) {
|
|
36328
|
+
Ie(source_default.blue(`\uD83D\uDD04 Update OpenClaw Pro ${source_default.gray(`v${getVersion()}`)}`));
|
|
36329
|
+
try {
|
|
36330
|
+
const githubToken = await getOpenclawToken();
|
|
36331
|
+
if (!githubToken) {
|
|
36332
|
+
M2.error("No token found");
|
|
36333
|
+
M2.info("Run: npx aiblueprint-cli@latest openclaw pro activate <token>");
|
|
36334
|
+
Se(source_default.red("❌ Not activated"));
|
|
36335
|
+
process.exit(1);
|
|
36336
|
+
}
|
|
36337
|
+
const spinner = Y2();
|
|
36338
|
+
spinner.start("Updating OpenClaw Pro configurations...");
|
|
36339
|
+
await installOpenclawProConfigs({
|
|
36340
|
+
githubToken,
|
|
36341
|
+
openclawFolder: options.folder
|
|
36342
|
+
});
|
|
36343
|
+
spinner.stop("OpenClaw Pro configurations updated");
|
|
36344
|
+
Se(source_default.green("✅ Update completed"));
|
|
36345
|
+
} catch (error) {
|
|
36346
|
+
if (error instanceof Error) {
|
|
36347
|
+
M2.error(error.message);
|
|
36348
|
+
}
|
|
36349
|
+
Se(source_default.red("❌ Update failed"));
|
|
36350
|
+
process.exit(1);
|
|
36351
|
+
}
|
|
36352
|
+
}
|
|
36353
|
+
|
|
36354
|
+
// src/commands/dynamic-scripts.ts
|
|
36355
|
+
import path21 from "path";
|
|
36356
|
+
import { homedir } from "os";
|
|
36357
|
+
|
|
36358
|
+
// src/lib/script-parser.ts
|
|
36359
|
+
var import_fs_extra15 = __toESM(require_lib4(), 1);
|
|
36360
|
+
import path19 from "path";
|
|
36056
36361
|
var EXCLUDED_SCRIPTS = ["test", "lint", "format", "start"];
|
|
36057
36362
|
var EXCLUDED_SUFFIXES = [":test", ":lint", ":test-fixtures", ":start"];
|
|
36058
36363
|
function shouldIncludeScript(scriptName) {
|
|
@@ -36063,12 +36368,12 @@ function shouldIncludeScript(scriptName) {
|
|
|
36063
36368
|
return true;
|
|
36064
36369
|
}
|
|
36065
36370
|
async function readScriptsPackageJson(claudeDir) {
|
|
36066
|
-
const packageJsonPath =
|
|
36371
|
+
const packageJsonPath = path19.join(claudeDir, "scripts", "package.json");
|
|
36067
36372
|
try {
|
|
36068
|
-
if (!await
|
|
36373
|
+
if (!await import_fs_extra15.default.pathExists(packageJsonPath)) {
|
|
36069
36374
|
return null;
|
|
36070
36375
|
}
|
|
36071
|
-
const content = await
|
|
36376
|
+
const content = await import_fs_extra15.default.readFile(packageJsonPath, "utf-8");
|
|
36072
36377
|
const parsed = JSON.parse(content);
|
|
36073
36378
|
return parsed.scripts || null;
|
|
36074
36379
|
} catch (error) {
|
|
@@ -36112,14 +36417,14 @@ function groupScriptsByPrefix(commands) {
|
|
|
36112
36417
|
}
|
|
36113
36418
|
|
|
36114
36419
|
// src/commands/script-runner.ts
|
|
36115
|
-
var
|
|
36420
|
+
var import_fs_extra16 = __toESM(require_lib4(), 1);
|
|
36116
36421
|
import { spawn as spawn2 } from "child_process";
|
|
36117
36422
|
import { execSync as execSync4 } from "child_process";
|
|
36118
|
-
import
|
|
36119
|
-
import
|
|
36423
|
+
import path20 from "path";
|
|
36424
|
+
import os19 from "os";
|
|
36120
36425
|
function checkCommand(cmd) {
|
|
36121
36426
|
try {
|
|
36122
|
-
const isWindows =
|
|
36427
|
+
const isWindows = os19.platform() === "win32";
|
|
36123
36428
|
const whichCmd = isWindows ? `where ${cmd}` : `which ${cmd}`;
|
|
36124
36429
|
execSync4(whichCmd, { stdio: "ignore" });
|
|
36125
36430
|
return true;
|
|
@@ -36145,18 +36450,18 @@ async function executeScript(scriptName, claudeDir) {
|
|
|
36145
36450
|
console.error(source_default.red("Bun is not installed. Install with: npm install -g bun"));
|
|
36146
36451
|
return 1;
|
|
36147
36452
|
}
|
|
36148
|
-
const scriptsDir =
|
|
36149
|
-
if (!await
|
|
36453
|
+
const scriptsDir = path20.join(claudeDir, "scripts");
|
|
36454
|
+
if (!await import_fs_extra16.default.pathExists(scriptsDir)) {
|
|
36150
36455
|
console.error(source_default.red(`Scripts directory not found at ${scriptsDir}`));
|
|
36151
36456
|
console.log(source_default.gray("Run: aiblueprint claude-code setup"));
|
|
36152
36457
|
return 1;
|
|
36153
36458
|
}
|
|
36154
|
-
const packageJsonPath =
|
|
36155
|
-
if (!await
|
|
36459
|
+
const packageJsonPath = path20.join(scriptsDir, "package.json");
|
|
36460
|
+
if (!await import_fs_extra16.default.pathExists(packageJsonPath)) {
|
|
36156
36461
|
console.error(source_default.red(`package.json not found in ${scriptsDir}`));
|
|
36157
36462
|
return 1;
|
|
36158
36463
|
}
|
|
36159
|
-
const packageJson = await
|
|
36464
|
+
const packageJson = await import_fs_extra16.default.readJson(packageJsonPath);
|
|
36160
36465
|
if (!packageJson.scripts || !packageJson.scripts[scriptName]) {
|
|
36161
36466
|
console.error(source_default.red(`Script "${scriptName}" not found in package.json`));
|
|
36162
36467
|
return 1;
|
|
@@ -36179,7 +36484,7 @@ async function executeScript(scriptName, claudeDir) {
|
|
|
36179
36484
|
|
|
36180
36485
|
// src/commands/dynamic-scripts.ts
|
|
36181
36486
|
function getClaudeDir(parentOptions) {
|
|
36182
|
-
return parentOptions.claudeCodeFolder || parentOptions.folder ?
|
|
36487
|
+
return parentOptions.claudeCodeFolder || parentOptions.folder ? path21.resolve(parentOptions.claudeCodeFolder || parentOptions.folder) : path21.join(homedir(), ".claude");
|
|
36183
36488
|
}
|
|
36184
36489
|
async function registerDynamicScriptCommands(claudeCodeCmd, claudeDir) {
|
|
36185
36490
|
const scripts = await readScriptsPackageJson(claudeDir);
|
|
@@ -36268,6 +36573,24 @@ backupCmd.command("load").description("Load a previous backup interactively").ac
|
|
|
36268
36573
|
const claudeCodeFolder = parentOptions.claudeCodeFolder || parentOptions.folder;
|
|
36269
36574
|
backupLoadCommand({ folder: claudeCodeFolder });
|
|
36270
36575
|
});
|
|
36576
|
+
var openclawCmd = program2.command("openclaw").description("OpenClaw configuration commands").option("-f, --folder <path>", "Specify custom OpenClaw folder path (default: ~/.openclaw)");
|
|
36577
|
+
var openclawProCmd = openclawCmd.command("pro").description("Manage OpenClaw Pro features");
|
|
36578
|
+
openclawProCmd.command("activate [token]").description("Activate OpenClaw Pro with your access token").action((token) => {
|
|
36579
|
+
openclawProActivateCommand(token);
|
|
36580
|
+
});
|
|
36581
|
+
openclawProCmd.command("status").description("Check your OpenClaw Pro token status").action(() => {
|
|
36582
|
+
openclawProStatusCommand();
|
|
36583
|
+
});
|
|
36584
|
+
openclawProCmd.command("setup").description("Install OpenClaw Pro configurations (requires activation)").action((options, command) => {
|
|
36585
|
+
const parentOptions = command.parent.parent.opts();
|
|
36586
|
+
const folder = parentOptions.folder;
|
|
36587
|
+
openclawProSetupCommand({ folder });
|
|
36588
|
+
});
|
|
36589
|
+
openclawProCmd.command("update").description("Update OpenClaw Pro configurations").action((options, command) => {
|
|
36590
|
+
const parentOptions = command.parent.parent.opts();
|
|
36591
|
+
const folder = parentOptions.folder;
|
|
36592
|
+
openclawProUpdateCommand({ folder });
|
|
36593
|
+
});
|
|
36271
36594
|
try {
|
|
36272
36595
|
const claudeDir = join2(homedir2(), ".claude");
|
|
36273
36596
|
await registerDynamicScriptCommands(claudeCodeCmd, claudeDir);
|