aiblueprint-cli 1.4.76 → 1.4.78

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 (3) hide show
  1. package/README.md +6 -4
  2. package/dist/cli.js +165 -80
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -132,6 +132,8 @@ npx aiblueprint-cli@latest agents config unify sessions
132
132
 
133
133
  - `cc` - Claude Code with permissions skipped
134
134
  - `ccc` - Claude Code with continue mode
135
+ - `cx` - Codex
136
+ - `cxc` - Codex continue mode for the current directory
135
137
 
136
138
  ### Skills
137
139
 
@@ -169,11 +171,11 @@ npx skills add Melvynx/aiblueprint --skill skill-manager
169
171
  Unlock advanced features at [mlv.sh/claude-cli](https://mlv.sh/claude-cli)
170
172
 
171
173
  ```bash
172
- # Activate premium
173
- npx aiblueprint-cli@latest agents pro activate YOUR_TOKEN
174
-
175
- # Setup premium configs
174
+ # Setup premium configs (prompts for your token if needed)
176
175
  npx aiblueprint-cli@latest agents pro setup
176
+
177
+ # Or activate first if you prefer
178
+ npx aiblueprint-cli@latest agents pro activate YOUR_TOKEN
177
179
  ```
178
180
 
179
181
  ## 🛠️ Development
package/dist/cli.js CHANGED
@@ -32764,18 +32764,84 @@ import { dirname as dirname2 } from "path";
32764
32764
  var import_fs_extra = __toESM(require_lib4(), 1);
32765
32765
  import path2 from "path";
32766
32766
  import os3 from "os";
32767
+ var BEGIN_MARKER = "# BEGIN AIBlueprint shell shortcuts";
32768
+ var END_MARKER = "# END AIBlueprint shell shortcuts";
32769
+ var POSIX_COMMAND_LINES = [
32770
+ 'alias cc="claude --dangerously-skip-permissions"',
32771
+ 'alias ccc="claude --dangerously-skip-permissions -c"',
32772
+ 'alias cx="codex"',
32773
+ 'alias cxc="codex resume --last"'
32774
+ ];
32775
+ var POWERSHELL_COMMAND_LINES = [
32776
+ "function cc { claude --dangerously-skip-permissions $args }",
32777
+ "function ccc { claude --dangerously-skip-permissions -c $args }",
32778
+ "function cx { codex $args }",
32779
+ "function cxc { codex resume --last $args }"
32780
+ ];
32781
+ var POSIX_SHORTCUT_BLOCK = {
32782
+ legacyHeaders: [
32783
+ "# AIBlueprint Claude Code aliases",
32784
+ "# AIBlueprint Codex aliases"
32785
+ ],
32786
+ commandLines: POSIX_COMMAND_LINES,
32787
+ lines: [
32788
+ BEGIN_MARKER,
32789
+ "# Claude Code",
32790
+ POSIX_COMMAND_LINES[0],
32791
+ POSIX_COMMAND_LINES[1],
32792
+ "# Codex",
32793
+ POSIX_COMMAND_LINES[2],
32794
+ POSIX_COMMAND_LINES[3],
32795
+ END_MARKER
32796
+ ]
32797
+ };
32798
+ var POWERSHELL_SHORTCUT_BLOCK = {
32799
+ legacyHeaders: [
32800
+ "# AIBlueprint Claude Code shortcuts",
32801
+ "# AIBlueprint Codex shortcuts"
32802
+ ],
32803
+ commandLines: POWERSHELL_COMMAND_LINES,
32804
+ lines: [
32805
+ BEGIN_MARKER,
32806
+ "# Claude Code",
32807
+ POWERSHELL_COMMAND_LINES[0],
32808
+ POWERSHELL_COMMAND_LINES[1],
32809
+ "# Codex",
32810
+ POWERSHELL_COMMAND_LINES[2],
32811
+ POWERSHELL_COMMAND_LINES[3],
32812
+ END_MARKER
32813
+ ]
32814
+ };
32815
+ function escapeRegExp(value) {
32816
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
32817
+ }
32818
+ function detectEol(content) {
32819
+ return content.includes(`\r
32820
+ `) ? `\r
32821
+ ` : `
32822
+ `;
32823
+ }
32824
+ function upsertShortcutBlock(existingContent, shortcutBlock) {
32825
+ const eol = detectEol(existingContent);
32826
+ const managedBlockPattern = new RegExp(`${escapeRegExp(BEGIN_MARKER)}[\\s\\S]*?${escapeRegExp(END_MARKER)}\\r?\\n?`, "g");
32827
+ const removableLegacyLines = new Set([
32828
+ ...shortcutBlock.legacyHeaders,
32829
+ ...shortcutBlock.commandLines
32830
+ ]);
32831
+ const existingWithoutManagedBlock = existingContent.replace(managedBlockPattern, "");
32832
+ const existingLines = existingWithoutManagedBlock.split(/\r?\n/).filter((line) => !removableLegacyLines.has(line.trim()));
32833
+ const baseContent = existingLines.join(eol).trimEnd();
32834
+ const blockContent = shortcutBlock.lines.join(eol);
32835
+ return `${baseContent}${baseContent ? `${eol}${eol}` : ""}${blockContent}${eol}`;
32836
+ }
32767
32837
  async function setupShellShortcuts() {
32768
32838
  try {
32769
32839
  const platform = os3.platform();
32770
32840
  let shellConfigFile;
32771
- let aliases;
32841
+ let shortcutBlock;
32772
32842
  if (platform === "darwin") {
32773
32843
  shellConfigFile = path2.join(os3.homedir(), ".zshenv");
32774
- aliases = `
32775
- # AIBlueprint Claude Code aliases
32776
- alias cc="claude --dangerously-skip-permissions"
32777
- alias ccc="claude --dangerously-skip-permissions -c"
32778
- `;
32844
+ shortcutBlock = POSIX_SHORTCUT_BLOCK;
32779
32845
  } else if (platform === "linux") {
32780
32846
  const shell = process.env.SHELL || "";
32781
32847
  if (shell.includes("zsh")) {
@@ -32783,11 +32849,7 @@ alias ccc="claude --dangerously-skip-permissions -c"
32783
32849
  } else {
32784
32850
  shellConfigFile = path2.join(os3.homedir(), ".bashrc");
32785
32851
  }
32786
- aliases = `
32787
- # AIBlueprint Claude Code aliases
32788
- alias cc="claude --dangerously-skip-permissions"
32789
- alias ccc="claude --dangerously-skip-permissions -c"
32790
- `;
32852
+ shortcutBlock = POSIX_SHORTCUT_BLOCK;
32791
32853
  } else if (platform === "win32") {
32792
32854
  const pwshProfileDir = path2.join(os3.homedir(), "Documents", "PowerShell");
32793
32855
  const windowsPwshProfileDir = path2.join(os3.homedir(), "Documents", "WindowsPowerShell");
@@ -32801,18 +32863,15 @@ alias ccc="claude --dangerously-skip-permissions -c"
32801
32863
  await import_fs_extra.default.ensureDir(profileDir);
32802
32864
  }
32803
32865
  shellConfigFile = path2.join(profileDir, "Profile.ps1");
32804
- aliases = `
32805
- # AIBlueprint Claude Code shortcuts
32806
- function cc { claude --dangerously-skip-permissions $args }
32807
- function ccc { claude --dangerously-skip-permissions -c $args }
32808
- `;
32866
+ shortcutBlock = POWERSHELL_SHORTCUT_BLOCK;
32809
32867
  } else {
32810
32868
  console.log(source_default.yellow(`Shell shortcuts are not supported on platform: ${platform}`));
32811
32869
  return;
32812
32870
  }
32813
32871
  const existingContent = await import_fs_extra.default.readFile(shellConfigFile, "utf-8").catch(() => "");
32814
- if (!existingContent.includes("AIBlueprint Claude Code")) {
32815
- await import_fs_extra.default.appendFile(shellConfigFile, aliases);
32872
+ const nextContent = upsertShortcutBlock(existingContent, shortcutBlock);
32873
+ if (nextContent !== existingContent) {
32874
+ await import_fs_extra.default.writeFile(shellConfigFile, nextContent);
32816
32875
  }
32817
32876
  } catch (error) {
32818
32877
  console.error(source_default.red("Error setting up shell shortcuts:"), error);
@@ -34240,7 +34299,7 @@ async function setupCommand(params = {}) {
34240
34299
  choices: [
34241
34300
  {
34242
34301
  value: "shellShortcuts",
34243
- name: "Shell shortcuts (cc, ccc aliases) - Quick access to Claude Code",
34302
+ name: "Shell shortcuts (cc, ccc, cx, cxc aliases) - Quick access to Claude Code and Codex",
34244
34303
  checked: true
34245
34304
  },
34246
34305
  {
@@ -34440,6 +34499,8 @@ Next steps:`));
34440
34499
  }
34441
34500
  console.log(source_default.gray(' • Use "cc" for Claude Code with permissions skipped'));
34442
34501
  console.log(source_default.gray(' • Use "ccc" for Claude Code with permissions skipped and continue mode'));
34502
+ console.log(source_default.gray(' • Use "cx" to launch Codex'));
34503
+ console.log(source_default.gray(' • Use "cxc" to continue the latest Codex session for this directory'));
34443
34504
  }
34444
34505
  console.log(source_default.gray(' • Run "claude" to start using Claude Code with your new configuration'));
34445
34506
  console.log(source_default.blue(`
@@ -37809,6 +37870,74 @@ function getTokenInfo() {
37809
37870
  var import_fs_extra17 = __toESM(require_lib4(), 1);
37810
37871
  var API_URL = "https://codeline.app/api/products";
37811
37872
  var PRODUCT_IDS = ["prd_XJVgxVPbGG", "prd_NKabAkdOkw"];
37873
+
37874
+ class PremiumActivationError extends Error {
37875
+ code;
37876
+ constructor(code, message) {
37877
+ super(message);
37878
+ this.code = code;
37879
+ this.name = "PremiumActivationError";
37880
+ }
37881
+ }
37882
+ function isPremiumActivationError(error) {
37883
+ return error instanceof PremiumActivationError;
37884
+ }
37885
+ function logPremiumActivationError(error) {
37886
+ M2.error(error.message);
37887
+ if (error.code === "invalid-token") {
37888
+ M2.info("\uD83D\uDC8E Get AIBlueprint CLI Premium at: https://mlv.sh/claude-cli");
37889
+ }
37890
+ }
37891
+ async function promptForPremiumToken() {
37892
+ const result = await he({
37893
+ message: "Enter your Premium access token:",
37894
+ placeholder: "Your ProductsOnUsers ID from codeline.app",
37895
+ validate: (value) => {
37896
+ if (!value)
37897
+ return "Token is required";
37898
+ if (value.length < 5)
37899
+ return "Token seems invalid";
37900
+ return;
37901
+ }
37902
+ });
37903
+ if (pD(result)) {
37904
+ xe("Premium activation cancelled");
37905
+ process.exit(0);
37906
+ }
37907
+ return result;
37908
+ }
37909
+ async function fetchPremiumActivationData(userToken) {
37910
+ const encodedToken = encodeURIComponent(userToken);
37911
+ for (const productId of PRODUCT_IDS) {
37912
+ const response = await fetch(`${API_URL}/${productId}/have-access?token=${encodedToken}`);
37913
+ if (response.ok) {
37914
+ const responseData = await response.json();
37915
+ if (responseData.hasAccess) {
37916
+ return responseData;
37917
+ }
37918
+ }
37919
+ }
37920
+ return null;
37921
+ }
37922
+ async function activatePremiumToken(userToken) {
37923
+ const premiumToken = userToken ?? await promptForPremiumToken();
37924
+ const spinner = Y2();
37925
+ spinner.start("Validating token against premium products...");
37926
+ const data = await fetchPremiumActivationData(premiumToken);
37927
+ if (!data) {
37928
+ spinner.stop("Token validation failed");
37929
+ throw new PremiumActivationError("invalid-token", "Invalid token or no access to premium products");
37930
+ }
37931
+ spinner.stop("Token validated");
37932
+ const githubToken = data.product?.metadata?.["cli-github-token"];
37933
+ if (!githubToken) {
37934
+ throw new PremiumActivationError("missing-github-token", "No GitHub token found in product metadata. Please contact support.");
37935
+ }
37936
+ spinner.start("Saving token...");
37937
+ await saveToken(githubToken);
37938
+ spinner.stop("Token saved");
37939
+ return { githubToken, data };
37940
+ }
37812
37941
  async function countInstalledItems(claudeDir) {
37813
37942
  const counts = {
37814
37943
  agents: 0,
@@ -37841,60 +37970,11 @@ async function countInstalledItems(claudeDir) {
37841
37970
  async function proActivateCommand(userToken) {
37842
37971
  Ie(source_default.blue(`\uD83D\uDD11 Activate AIBlueprint CLI Premium ${source_default.gray(`v${getVersion()}`)}`));
37843
37972
  try {
37844
- if (!userToken) {
37845
- const result = await he({
37846
- message: "Enter your Premium access token:",
37847
- placeholder: "Your ProductsOnUsers ID from codeline.app",
37848
- validate: (value) => {
37849
- if (!value)
37850
- return "Token is required";
37851
- if (value.length < 5)
37852
- return "Token seems invalid";
37853
- return;
37854
- }
37855
- });
37856
- if (pD(result)) {
37857
- xe("Activation cancelled");
37858
- process.exit(0);
37859
- }
37860
- userToken = result;
37861
- }
37862
- const spinner = Y2();
37863
- spinner.start("Validating token against premium products...");
37864
- let validationSuccess = false;
37865
- let data = null;
37866
- for (const productId of PRODUCT_IDS) {
37867
- const response = await fetch(`${API_URL}/${productId}/have-access?token=${userToken}`);
37868
- if (response.ok) {
37869
- const responseData = await response.json();
37870
- if (responseData.hasAccess) {
37871
- data = responseData;
37872
- validationSuccess = true;
37873
- break;
37874
- }
37875
- }
37876
- }
37877
- if (!validationSuccess || !data) {
37878
- spinner.stop("Token validation failed");
37879
- M2.error("Invalid token or no access to premium products");
37880
- M2.info("\uD83D\uDC8E Get AIBlueprint CLI Premium at: https://mlv.sh/claude-cli");
37881
- Se(source_default.red("❌ Activation failed"));
37882
- process.exit(1);
37883
- }
37884
- spinner.stop("Token validated");
37885
- const githubToken = data.product.metadata?.["cli-github-token"];
37886
- if (!githubToken) {
37887
- M2.error("No GitHub token found in product metadata. Please contact support.");
37888
- Se(source_default.red("❌ Activation failed"));
37889
- process.exit(1);
37890
- }
37891
- spinner.start("Saving token...");
37892
- await saveToken(githubToken);
37893
- spinner.stop("Token saved");
37973
+ const { data } = await activatePremiumToken(userToken);
37894
37974
  const tokenInfo = getTokenInfo();
37895
37975
  M2.success("✅ Token activated!");
37896
- M2.info(`User: ${data.user.name} (${data.user.email})`);
37897
- M2.info(`Product: ${data.product.title}`);
37976
+ M2.info(`User: ${data.user?.name ?? "Unknown"} (${data.user?.email ?? "unknown email"})`);
37977
+ M2.info(`Product: ${data.product?.title ?? "Premium"}`);
37898
37978
  M2.info(`Token saved to: ${tokenInfo.path}`);
37899
37979
  M2.info(source_default.cyan(`
37900
37980
  \uD83D\uDCA1 Next step: Run 'npx aiblueprint-cli@latest agents pro setup' to install premium configs`));
@@ -37903,7 +37983,9 @@ async function proActivateCommand(userToken) {
37903
37983
  } catch (error) {
37904
37984
  trackError(error, { command: "pro-activate" });
37905
37985
  await flushTelemetry();
37906
- if (error instanceof Error) {
37986
+ if (isPremiumActivationError(error)) {
37987
+ logPremiumActivationError(error);
37988
+ } else if (error instanceof Error) {
37907
37989
  M2.error(error.message);
37908
37990
  }
37909
37991
  Se(source_default.red("❌ Activation failed"));
@@ -37937,12 +38019,13 @@ async function proStatusCommand() {
37937
38019
  async function proSetupCommand(options = {}) {
37938
38020
  Ie(source_default.blue(`⚙️ Setup AIBlueprint CLI Premium ${source_default.gray(`v${getVersion()}`)}`));
37939
38021
  try {
37940
- const githubToken = await getToken();
38022
+ let githubToken = await getToken();
37941
38023
  if (!githubToken) {
37942
- M2.error("No token found");
37943
- M2.info("Run: npx aiblueprint-cli@latest agents pro activate <token>");
37944
- Se(source_default.red("❌ Not activated"));
37945
- process.exit(1);
38024
+ M2.warn("No token found");
38025
+ M2.info("Enter your Premium access token to activate and continue setup.");
38026
+ const activation = await activatePremiumToken();
38027
+ githubToken = activation.githubToken;
38028
+ M2.success("✅ Token activated. Continuing setup...");
37946
38029
  }
37947
38030
  const { claudeDir } = resolveFolders(options);
37948
38031
  const spinner = Y2();
@@ -37989,13 +38072,15 @@ async function proSetupCommand(options = {}) {
37989
38072
  M2.info(` • Agents (${counts.agents})`);
37990
38073
  M2.info(` • Premium Skills (${counts.skills})`);
37991
38074
  M2.info(" • Premium statusline (advanced)");
37992
- M2.info(" • Shell shortcuts (cc, ccc)");
38075
+ M2.info(" • Shell shortcuts (cc, ccc, cx, cxc)");
37993
38076
  M2.info(" • Settings.json with statusline");
37994
38077
  Se(source_default.green("\uD83D\uDE80 Ready to use!"));
37995
38078
  } catch (error) {
37996
38079
  trackError(error, { command: "pro-setup" });
37997
38080
  await flushTelemetry();
37998
- if (error instanceof Error) {
38081
+ if (isPremiumActivationError(error)) {
38082
+ logPremiumActivationError(error);
38083
+ } else if (error instanceof Error) {
37999
38084
  M2.error(error.message);
38000
38085
  }
38001
38086
  Se(source_default.red("❌ Setup failed"));
@@ -39464,7 +39549,7 @@ function registerAgentsCommands(cmd) {
39464
39549
  proCmd.command("status").description("Check your Premium token status").action(() => {
39465
39550
  proStatusCommand();
39466
39551
  });
39467
- proCmd.command("setup").description("Install premium configurations (requires activation)").action((options, command) => {
39552
+ proCmd.command("setup").description("Install premium configurations, prompting for activation if needed").action((options, command) => {
39468
39553
  const parentOptions = command.parent.parent.opts();
39469
39554
  proSetupCommand({
39470
39555
  folder: parentOptions.folder,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiblueprint-cli",
3
- "version": "1.4.76",
3
+ "version": "1.4.78",
4
4
  "description": "AIBlueprint CLI for setting up AI coding configurations",
5
5
  "author": "AIBlueprint",
6
6
  "license": "MIT",