@useorgx/wizard 0.1.9 → 0.1.10

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 CHANGED
@@ -14,14 +14,15 @@ For local development, use `pnpm dev -- --help`.
14
14
 
15
15
  ## Commands
16
16
 
17
- - `setup` configures detected automated surfaces and, when OrgX auth is available in an interactive shell, guides workspace selection or creation, optional onboarding extras, and optional companion plugin installs for detected Claude Code, Codex, and OpenClaw hosts. The founder preset preplans plugin installs before it writes standalone skills so plugin-backed hosts do not get duplicate standalone Claude assets in the same run.
17
+ - `setup` configures detected automated surfaces and, when OrgX auth is available in an interactive shell, guides workspace selection or creation, optional onboarding extras, and optional Cursor rules or companion plugin installs for detected Cursor, Claude Code, Codex, and OpenClaw hosts. The founder preset preplans plugin installs before it writes standalone skills so plugin-backed hosts do not get duplicate standalone Claude assets in the same run.
18
18
  - `surface list` shows supported surfaces and current status.
19
19
  - `surface add <name>` patches a specific surface.
20
20
  - `surface remove <name>` removes OrgX-managed config from a specific surface.
21
21
  - `mcp add [surface]` and `mcp remove [surface]` manage Claude, Cursor, Codex, VS Code, Windsurf, and Zed MCP entries.
22
- - `plugins list` shows companion plugin availability and install status for Claude Code, Codex, and OpenClaw.
23
- - `plugins add [target...]` installs the managed OrgX companion plugins into Claude Code, Codex, and/or OpenClaw. Claude Code and Codex plugins carry their own OrgX skills, so they become the source of truth for those hosts.
24
- - `plugins remove [target...]` uninstalls the managed OrgX companion plugins from Claude Code, Codex, and/or OpenClaw.
22
+ - `plugins list` shows Cursor rules and companion plugin availability and install status for Cursor, Claude Code, Codex, and OpenClaw.
23
+ - `plugins add [target...]` installs managed Cursor OrgX rules or managed OrgX companion plugins into Claude Code, Codex, and/or OpenClaw. Claude Code and Codex plugins carry their own OrgX skills, so they become the source of truth for those hosts.
24
+ - `plugins remove [target...]` uninstalls managed Cursor OrgX rules or managed OrgX companion plugins from Claude Code, Codex, and/or OpenClaw.
25
+ - `uninstall` removes OrgX-managed surface config, Cursor rules and companion plugins, wizard-local auth, and wizard-local setup state. Use `--keep-auth`, `--keep-state`, `--skip-plugins`, or `--skip-surfaces` to preserve specific pieces.
25
26
  - `doctor` verifies local config, hosted MCP reachability, npm registry readiness, current-workspace connectivity, local OpenClaw health, and optionally the remote setup status API. Hosted MCP tools are OAuth-scoped inside the client connector, so the wizard does not preflight them with `oxk_` API keys. It exits non-zero when blocking connectivity issues remain.
26
27
  - `auth status` shows the resolved OrgX API key source and verifies it against `POST /api/client/sync`.
27
28
  - `auth login [--base-url <url>]` starts browser pairing against OrgX, waits for approval, saves the returned per-user key to the wizard auth store, and bootstraps OpenClaw auth if OpenClaw is detected. Use `--api-key <oxk_...>` for CI or blocked-browser fallback.
package/dist/cli.js CHANGED
@@ -1046,6 +1046,9 @@ function getOrCreateWizardInstallationId(statePath = ORGX_WIZARD_STATE_PATH) {
1046
1046
  writeWizardState(record, statePath);
1047
1047
  return record.installationId;
1048
1048
  }
1049
+ function clearWizardState(statePath = ORGX_WIZARD_STATE_PATH) {
1050
+ return deleteFileIfExists(statePath);
1051
+ }
1049
1052
 
1050
1053
  // src/lib/agent-roster.ts
1051
1054
  var AGENT_ROSTER_PROFILES = [
@@ -3281,7 +3284,7 @@ import {
3281
3284
  } from "fs";
3282
3285
  import { tmpdir } from "os";
3283
3286
  import { dirname as dirname3, join as join3, relative } from "path";
3284
- var DEFAULT_ORGX_PLUGIN_TARGETS = ["claude", "codex", "openclaw"];
3287
+ var DEFAULT_ORGX_PLUGIN_TARGETS = ["cursor", "claude", "codex", "openclaw"];
3285
3288
  var ORGX_PLUGIN_GITHUB_OWNER = "useorgx";
3286
3289
  var ORGX_PLUGIN_GITHUB_REF = "main";
3287
3290
  var ORGX_CLAUDE_PLUGIN_NAME = "orgx-claude-code-plugin";
@@ -3320,7 +3323,8 @@ function defaultPluginPaths() {
3320
3323
  claudeMarketplaceManifestPath: CLAUDE_MANAGED_MARKETPLACE_MANIFEST_PATH,
3321
3324
  claudePluginDir: CLAUDE_MANAGED_PLUGIN_DIR,
3322
3325
  codexMarketplacePath: CODEX_MARKETPLACE_PATH,
3323
- codexPluginDir: CODEX_ORGX_PLUGIN_DIR
3326
+ codexPluginDir: CODEX_ORGX_PLUGIN_DIR,
3327
+ cursorRulePath: CURSOR_ORGX_RULE_PATH
3324
3328
  };
3325
3329
  }
3326
3330
  function resolvePluginPaths(paths = {}) {
@@ -3740,6 +3744,32 @@ async function getOpenclawInstallState(runner) {
3740
3744
  installed: extractOpenclawPluginIds(result.stdout).includes(ORGX_OPENCLAW_PLUGIN_ID)
3741
3745
  };
3742
3746
  }
3747
+ function buildCursorStatus(paths) {
3748
+ const existingRules = readTextIfExists(paths.cursorRulePath);
3749
+ const available = detectSurface("cursor").detected || existingRules !== null;
3750
+ if (existingRules === CURSOR_RULES_CONTENT) {
3751
+ return {
3752
+ target: "cursor",
3753
+ available: true,
3754
+ installed: true,
3755
+ message: "Cursor OrgX rules are installed."
3756
+ };
3757
+ }
3758
+ if (existingRules !== null) {
3759
+ return {
3760
+ target: "cursor",
3761
+ available: true,
3762
+ installed: false,
3763
+ message: "Cursor OrgX rules file exists, but differs from the managed rules."
3764
+ };
3765
+ }
3766
+ return {
3767
+ target: "cursor",
3768
+ available,
3769
+ installed: false,
3770
+ message: available ? "Cursor is available and ready for OrgX rules install." : "Cursor was not detected."
3771
+ };
3772
+ }
3743
3773
  async function buildClaudeStatus(paths, runner) {
3744
3774
  const state = await getClaudeInstallState(runner);
3745
3775
  if (state.installed) {
@@ -3855,6 +3885,30 @@ async function resolveOpenclawTarball(fetchImpl) {
3855
3885
  version: latestVersion
3856
3886
  };
3857
3887
  }
3888
+ function installCursorPlugin(paths) {
3889
+ const existingRules = readTextIfExists(paths.cursorRulePath);
3890
+ const available = detectSurface("cursor").detected || existingRules !== null;
3891
+ if (!available) {
3892
+ return {
3893
+ target: "cursor",
3894
+ changed: false,
3895
+ message: "Cursor is not available on this machine."
3896
+ };
3897
+ }
3898
+ if (existingRules === CURSOR_RULES_CONTENT) {
3899
+ return {
3900
+ target: "cursor",
3901
+ changed: false,
3902
+ message: "Cursor OrgX rules are already installed."
3903
+ };
3904
+ }
3905
+ writeTextFile(paths.cursorRulePath, CURSOR_RULES_CONTENT);
3906
+ return {
3907
+ target: "cursor",
3908
+ changed: true,
3909
+ message: "Installed the managed Cursor OrgX rules."
3910
+ };
3911
+ }
3858
3912
  async function installClaudePlugin(paths, fetchImpl, runner) {
3859
3913
  const state = await getClaudeInstallState(runner);
3860
3914
  if (!state.available) {
@@ -3961,6 +4015,29 @@ async function installOpenclawPlugin(fetchImpl, runner) {
3961
4015
  message: `Installed OpenClaw plugin ${ORGX_OPENCLAW_PLUGIN_ID} from ${ORGX_OPENCLAW_PLUGIN_PACKAGE_NAME}@${version}.`
3962
4016
  };
3963
4017
  }
4018
+ function uninstallCursorPlugin(paths) {
4019
+ const existingRules = readTextIfExists(paths.cursorRulePath);
4020
+ if (existingRules === null) {
4021
+ return {
4022
+ target: "cursor",
4023
+ changed: false,
4024
+ message: "Cursor OrgX rules were not installed."
4025
+ };
4026
+ }
4027
+ if (existingRules !== CURSOR_RULES_CONTENT) {
4028
+ return {
4029
+ target: "cursor",
4030
+ changed: false,
4031
+ message: "Cursor rules file differs from the managed OrgX rules, so it was left in place."
4032
+ };
4033
+ }
4034
+ const changed = deleteFileIfExists(paths.cursorRulePath);
4035
+ return {
4036
+ target: "cursor",
4037
+ changed,
4038
+ message: changed ? "Removed the managed Cursor OrgX rules." : "Cursor OrgX rules were not installed."
4039
+ };
4040
+ }
3964
4041
  async function uninstallClaudePlugin(paths, runner) {
3965
4042
  const state = await getClaudeInstallState(runner);
3966
4043
  let changed = false;
@@ -4056,6 +4133,7 @@ async function listOrgxPluginStatuses(options = {}) {
4056
4133
  const paths = resolvePluginPaths(options.paths);
4057
4134
  const runner = resolveCommandRunner(options.commandRunner);
4058
4135
  return await Promise.all([
4136
+ buildCursorStatus(paths),
4059
4137
  buildClaudeStatus(paths, runner),
4060
4138
  buildCodexStatus(paths, runner),
4061
4139
  buildOpenclawStatus(runner)
@@ -4072,6 +4150,9 @@ async function installOrgxPlugins(options = {}) {
4072
4150
  const results = [];
4073
4151
  for (const target of targets) {
4074
4152
  switch (target) {
4153
+ case "cursor":
4154
+ results.push(installCursorPlugin(paths));
4155
+ break;
4075
4156
  case "claude":
4076
4157
  results.push(await installClaudePlugin(paths, fetchImpl, runner));
4077
4158
  break;
@@ -4092,6 +4173,9 @@ async function uninstallOrgxPlugins(options = {}) {
4092
4173
  const results = [];
4093
4174
  for (const target of targets) {
4094
4175
  switch (target) {
4176
+ case "cursor":
4177
+ results.push(uninstallCursorPlugin(paths));
4178
+ break;
4095
4179
  case "claude":
4096
4180
  results.push(await uninstallClaudePlugin(paths, runner));
4097
4181
  break;
@@ -4558,6 +4642,8 @@ function formatAuthSource(source) {
4558
4642
  }
4559
4643
  function formatPluginTargetLabel(target) {
4560
4644
  switch (target) {
4645
+ case "cursor":
4646
+ return "Cursor rules";
4561
4647
  case "claude":
4562
4648
  return "Claude Code";
4563
4649
  case "codex":
@@ -4602,6 +4688,16 @@ function printPluginMutationReport(report) {
4602
4688
  );
4603
4689
  }
4604
4690
  }
4691
+ async function printPluginStatusSection() {
4692
+ const spinner = createOrgxSpinner("Checking OrgX plugin and Cursor rules status");
4693
+ spinner.start();
4694
+ const statuses = await listOrgxPluginStatuses();
4695
+ spinner.succeed("OrgX plugin and Cursor rules status checked");
4696
+ console.log("");
4697
+ console.log(pc3.dim(" plugins"));
4698
+ printPluginStatusReport(statuses);
4699
+ return statuses;
4700
+ }
4605
4701
  function printSkillInstallReport(report) {
4606
4702
  for (const write of report.writes) {
4607
4703
  const icon = write.changed ? ICON.ok : ICON.skip;
@@ -4704,8 +4800,9 @@ async function textPrompt(input) {
4704
4800
  }
4705
4801
  async function multiselectPrompt(input) {
4706
4802
  const promptInput = {
4707
- message: input.message,
4803
+ message: `${input.message} ${pc3.dim("Space selects items; Enter continues.")}`,
4708
4804
  options: input.options,
4805
+ ...input.initialValues ? { initialValues: input.initialValues } : {},
4709
4806
  ...input.required !== void 0 ? { required: input.required } : {}
4710
4807
  };
4711
4808
  return normalizePromptResult(await clack.multiselect(promptInput));
@@ -4854,10 +4951,11 @@ async function maybeConfigureOptionalWorkspaceAddOns(input) {
4854
4951
  const hasAgentRoster = refreshedState?.agentRoster?.workspaceId === input.workspace.id;
4855
4952
  if (!hasAgentRoster) {
4856
4953
  const rosterChoice = await selectPrompt({
4954
+ initialValue: "default",
4857
4955
  message: `Set up an OrgX agent roster for ${input.workspace.name}?`,
4858
4956
  options: [
4859
- { value: "guided", label: "Choose agents and domains", hint: "recommended" },
4860
- { value: "default", label: "Install the full default roster" },
4957
+ { value: "default", label: "Install the full default roster", hint: "recommended" },
4958
+ { value: "guided", label: "Choose agents and domains" },
4861
4959
  { value: "no", label: "Skip roster setup" }
4862
4960
  ]
4863
4961
  });
@@ -4912,7 +5010,13 @@ async function promptOptionalCompanionPluginTargets(input) {
4912
5010
  if (!input.interactive) {
4913
5011
  return [];
4914
5012
  }
4915
- const statuses = await listOrgxPluginStatuses();
5013
+ let statuses = input.statuses;
5014
+ if (!statuses) {
5015
+ const spinner = createOrgxSpinner("Checking optional OrgX plugin and Cursor rules status");
5016
+ spinner.start();
5017
+ statuses = await listOrgxPluginStatuses();
5018
+ spinner.succeed("Optional OrgX plugin and Cursor rules status checked");
5019
+ }
4916
5020
  const installable = statuses.filter((status) => status.available && !status.installed);
4917
5021
  if (installable.length === 0) {
4918
5022
  return [];
@@ -4963,7 +5067,8 @@ async function installSelectedCompanionPlugins(input) {
4963
5067
  }
4964
5068
  async function maybeInstallOptionalCompanionPlugins(input) {
4965
5069
  const selection = await promptOptionalCompanionPluginTargets({
4966
- interactive: input.interactive
5070
+ interactive: input.interactive,
5071
+ ...input.statuses ? { statuses: input.statuses } : {}
4967
5072
  });
4968
5073
  if (selection === "cancelled") {
4969
5074
  return "cancelled";
@@ -5051,7 +5156,7 @@ function printDoctorReport(report, assessment) {
5051
5156
  async function main() {
5052
5157
  const program = new Command();
5053
5158
  program.name("orgx-wizard").description("One-line CLI onboarding for OrgX surfaces.").showHelpAfterError();
5054
- const pkgVersion = true ? "0.1.9" : void 0;
5159
+ const pkgVersion = true ? "0.1.10" : void 0;
5055
5160
  program.version(pkgVersion ?? "unknown", "-V, --version");
5056
5161
  program.hook("preAction", () => {
5057
5162
  console.log(renderBanner(pkgVersion));
@@ -5162,6 +5267,7 @@ async function main() {
5162
5267
  const results = await setupDetectedSurfaces();
5163
5268
  spinner.succeed("Detected surfaces configured");
5164
5269
  printMutationResults(results);
5270
+ const pluginStatuses = await printPluginStatusSection();
5165
5271
  await safeTrackWizardTelemetry("mcp_injected", {
5166
5272
  changed_count: results.filter((result) => result.changed).length,
5167
5273
  preset: "standard",
@@ -5250,6 +5356,7 @@ async function main() {
5250
5356
  }
5251
5357
  const pluginInstallResult = await maybeInstallOptionalCompanionPlugins({
5252
5358
  interactive,
5359
+ statuses: pluginStatuses,
5253
5360
  telemetry: { command: "setup", preset: "standard" }
5254
5361
  });
5255
5362
  if (pluginInstallResult === "cancelled") {
@@ -5420,6 +5527,51 @@ async function main() {
5420
5527
  );
5421
5528
  }
5422
5529
  });
5530
+ program.command("uninstall").description("Remove OrgX-managed surfaces, companion plugins/rules, auth, and wizard state from this machine.").option("--keep-auth", "Keep the wizard-local saved OrgX API key.").option("--keep-state", "Keep wizard-local setup state.").option("--skip-plugins", "Skip companion plugin and Cursor rules removal.").option("--skip-surfaces", "Skip MCP surface config removal.").action(async (options) => {
5531
+ await safeTrackWizardTelemetry("wizard_uninstalled", {
5532
+ keep_auth: Boolean(options.keepAuth),
5533
+ keep_state: Boolean(options.keepState),
5534
+ skip_plugins: Boolean(options.skipPlugins),
5535
+ skip_surfaces: Boolean(options.skipSurfaces)
5536
+ });
5537
+ console.log(pc3.bold("Removing OrgX wizard-managed configuration"));
5538
+ if (options.skipSurfaces) {
5539
+ console.log(` ${ICON.skip} ${pc3.bold("surfaces".padEnd(10))} ${pc3.dim("skipped")}`);
5540
+ } else {
5541
+ console.log("");
5542
+ console.log(pc3.dim(" surfaces"));
5543
+ const surfaceResults = removeSurface(["all"]);
5544
+ printMutationResults(surfaceResults);
5545
+ }
5546
+ if (options.skipPlugins) {
5547
+ console.log(` ${ICON.skip} ${pc3.bold("plugins".padEnd(12))} ${pc3.dim("skipped")}`);
5548
+ } else {
5549
+ console.log("");
5550
+ console.log(pc3.dim(" plugins"));
5551
+ const spinner = createOrgxSpinner("Removing OrgX companion plugins and rules");
5552
+ spinner.start();
5553
+ const pluginReport = await uninstallOrgxPlugins({ targets: ["all"] });
5554
+ spinner.succeed("OrgX companion plugins and rules processed");
5555
+ printPluginMutationReport(pluginReport);
5556
+ }
5557
+ console.log("");
5558
+ if (options.keepAuth) {
5559
+ console.log(` ${ICON.skip} ${pc3.bold("auth".padEnd(12))} ${pc3.dim("kept")}`);
5560
+ } else {
5561
+ const removedAuth = await clearWizardAuth();
5562
+ const state = removedAuth ? pc3.green("updated ") : pc3.dim("unchanged");
5563
+ const message = removedAuth ? "Removed the wizard-local OrgX API key." : "No wizard-local OrgX API key was stored.";
5564
+ console.log(` ${removedAuth ? ICON.ok : ICON.skip} ${pc3.bold("auth".padEnd(12))} ${state} ${pc3.dim(message)}`);
5565
+ }
5566
+ if (options.keepState) {
5567
+ console.log(` ${ICON.skip} ${pc3.bold("state".padEnd(12))} ${pc3.dim("kept")}`);
5568
+ } else {
5569
+ const removedState = clearWizardState();
5570
+ const state = removedState ? pc3.green("updated ") : pc3.dim("unchanged");
5571
+ const message = removedState ? "Removed wizard-local setup state." : "No wizard-local setup state was stored.";
5572
+ console.log(` ${removedState ? ICON.ok : ICON.skip} ${pc3.bold("state".padEnd(12))} ${state} ${pc3.dim(message)}`);
5573
+ }
5574
+ });
5423
5575
  const surface = program.command("surface").description("Manage supported OrgX surfaces.");
5424
5576
  surface.command("list").description("Show supported surfaces and their current status.").action(() => {
5425
5577
  printSurfaceTable(listSurfaceStatuses());
@@ -5441,15 +5593,15 @@ async function main() {
5441
5593
  const results = removeMcpSurface(names);
5442
5594
  printMutationResults(results);
5443
5595
  });
5444
- const plugins = program.command("plugins").description("Install or remove companion OrgX plugins for Claude Code, Codex, and OpenClaw.");
5596
+ const plugins = program.command("plugins").description("Install or remove Cursor rules and companion OrgX plugins for Claude Code, Codex, and OpenClaw.");
5445
5597
  plugins.command("list").description("Show companion plugin availability and install status.").action(async () => {
5446
- const spinner = createOrgxSpinner("Checking companion plugin status");
5598
+ const spinner = createOrgxSpinner("Checking OrgX plugin and Cursor rules status");
5447
5599
  spinner.start();
5448
5600
  const statuses = await listOrgxPluginStatuses();
5449
- spinner.stop();
5601
+ spinner.succeed("OrgX plugin and Cursor rules status checked");
5450
5602
  printPluginStatusReport(statuses);
5451
5603
  });
5452
- plugins.command("add").description("Install OrgX companion plugins into Claude Code, Codex, or OpenClaw.").argument("[targets...]", "claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
5604
+ plugins.command("add").description("Install Cursor OrgX rules or companion plugins into Claude Code, Codex, and OpenClaw.").argument("[targets...]", "cursor, claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
5453
5605
  const spinner = createOrgxSpinner("Installing OrgX companion plugins");
5454
5606
  spinner.start();
5455
5607
  const report = await installOrgxPlugins({ targets });
@@ -5463,7 +5615,7 @@ async function main() {
5463
5615
  target_count: report.results.length
5464
5616
  });
5465
5617
  });
5466
- plugins.command("remove").description("Uninstall managed OrgX companion plugins from Claude Code, Codex, or OpenClaw.").argument("[targets...]", "claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
5618
+ plugins.command("remove").description("Uninstall managed Cursor OrgX rules or companion plugins from Claude Code, Codex, and OpenClaw.").argument("[targets...]", "cursor, claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
5467
5619
  const spinner = createOrgxSpinner("Removing OrgX companion plugins");
5468
5620
  spinner.start();
5469
5621
  const report = await uninstallOrgxPlugins({ targets });