replicas-cli 0.2.777 → 0.2.778

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 (2) hide show
  1. package/dist/index.cjs +118 -12
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7362,7 +7362,7 @@ var require_dist = __commonJS({
7362
7362
  });
7363
7363
 
7364
7364
  // src/index.ts
7365
- var import_config23 = require("dotenv/config");
7365
+ var import_config24 = require("dotenv/config");
7366
7366
  var import_node_child_process3 = require("child_process");
7367
7367
  var import_commander = require("commander");
7368
7368
  var import_chalk25 = __toESM(require("chalk"));
@@ -25217,6 +25217,7 @@ Take action *with* Replicas itself \u2014 manage automations, environments (vari
25217
25217
 
25218
25218
  Use this when:
25219
25219
  - The user asks you to create, edit, run, or delete an automation
25220
+ - The user asks you to come back to something later ("check back on this in a week", "remind me tomorrow", "tell me when CI is green") \u2014 schedule a follow-up (see *Follow-ups and reminders*)
25220
25221
  - The user asks you to manage environments, environment variables, or environment files
25221
25222
  - The user asks "what envs / repos / automations do I have?"
25222
25223
  - The user asks you to scaffold a \`replicas.json\` / \`replicas.yaml\` in a repo
@@ -25277,6 +25278,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
25277
25278
  | "Create a new env for my \`acme/web\` repo" | \`replicas environment create <name> -r acme/web\` |
25278
25279
  | "What automations do I have?" | \`replicas automation list\` |
25279
25280
  | "Run my nightly automation now" | \`replicas automation run <id>\` |
25281
+ | "Check back on this in a week" | \`replicas automation create ... --in 1w --background --personal\` |
25280
25282
  | "Make an automation that runs every weekday at 9am" | \`replicas automation create\` (interactive) or \`--trigger-cron "0 9 * * 1-5"\` |
25281
25283
  | "Make an automation that runs when a PR opens on \`acme/web\`" | \`replicas automation create ... --trigger-github pull_request.opened --trigger-github-repos acme/web\` |
25282
25284
  | "Make an automation that runs when an MR opens on \`acme/web\`" | \`replicas automation create ... --trigger-gitlab merge_request.opened --trigger-gitlab-repos acme/web\` |
@@ -25388,6 +25390,26 @@ replicas automation create ... --lifecycle default --auto-stop-minutes 30
25388
25390
 
25389
25391
  When the user says "make me an automation that...", default to **picking the environment for them by listing the available envs** and asking only when the user hasn't already pinned one. Same for repos in GitHub triggers. Don't pepper the user with questions you can answer by reading the existing config.
25390
25392
 
25393
+ ### Follow-ups and reminders
25394
+
25395
+ You cannot wait days yourself. When the user asks you to come back to something later, schedule a one-time automation that delivers a prompt back into **this workspace's conversation** at that time, then deletes itself:
25396
+
25397
+ \`\`\`bash
25398
+ replicas automation create "Re-check PR #142 CI" \\
25399
+ --in 1w \\
25400
+ --background --personal \\
25401
+ --prompt "A week ago the user asked me to re-check CI on https://github.com/acme/web/pull/142 (flaky e2e job 'checkout'). Check the latest run, fix it if it is still failing, and summarize the result for the user."
25402
+ \`\`\`
25403
+
25404
+ - \`--in <duration>\` (\`30m\`, \`2h\`, \`3d\`, \`1w\`, \`1d12h\`) or \`--at <ISO-8601 with offset>\` (e.g. "tomorrow at 9am" \u2192 \`--at 2026-10-08T09:00:00-07:00\`, using the user's timezone if you know it; otherwise say which timezone you assumed).
25405
+ - Inside a workspace, one-time follow-ups default to \`--workspace current\`, so you resume with this conversation's context. Inside a workspace, \`--environment\` defaults to this workspace's environment (same repositories), including for \`--workspace new\` and \`reuse\`.
25406
+ - Write \`--prompt\` as instructions to your future self: the links, what to check, what "done" looks like, and how to report back (e.g. reply in the original Slack thread). It runs with no memory of why it was scheduled beyond what you write.
25407
+ - \`--background\` keeps offhand reminders out of the user's main automations list (they are still visible under **Background**). Omit it for things the user should see and manage, such as ongoing monitoring they asked for.
25408
+ - \`--personal\` makes the automation the user's own. Omit it only when the follow-up belongs to the organization.
25409
+ - Recurring with an end: \`--trigger-cron "0 9 * * *" --max-runs 5 --workspace current\` runs daily five times, then deletes itself. \`--workspace reuse\` creates one new workspace on the first run and sends every later run to it; \`--workspace new\` (the default for non-one-time automations) creates a fresh workspace per run.
25410
+ - Only schedule when the user asked for a follow-up or clearly agreed to one; not for "maybe I'll look at this later".
25411
+ - Confirm using the **Next Run** time the CLI prints, not your own arithmetic. Cancel with \`replicas automation delete <id> --force\`; find them with \`replicas automation list --background true\`.
25412
+
25391
25413
  ### Edit
25392
25414
 
25393
25415
  \`\`\`bash
@@ -27928,7 +27950,7 @@ var headlessAgentRequestSchema = external_exports.object({
27928
27950
  });
27929
27951
 
27930
27952
  // ../shared/src/cli-version.ts
27931
- var CLI_VERSION = "0.2.777";
27953
+ var CLI_VERSION = "0.2.778";
27932
27954
 
27933
27955
  // ../shared/src/version.ts
27934
27956
  function compareVersions(v1, v2) {
@@ -31265,6 +31287,56 @@ function parseExcludedActorsOption(value) {
31265
31287
  const actors = value.split(",").map((actor) => actor.trim()).filter(Boolean);
31266
31288
  return actors.length > 0 ? actors : void 0;
31267
31289
  }
31290
+ var DURATION_UNIT_MS = { m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
31291
+ function parseDuration(value) {
31292
+ const parts = [...value.trim().toLowerCase().matchAll(/(\d+)\s*([mhdw])/g)];
31293
+ if (parts.length === 0 || parts.map((p) => p[0]).join("") !== value.trim().toLowerCase().replace(/\s+/g, "")) return null;
31294
+ return parts.reduce((total, [, amount, unit]) => total + Number(amount) * DURATION_UNIT_MS[unit], 0);
31295
+ }
31296
+ function resolveRunAt(options, now = Date.now()) {
31297
+ if (options.in && options.at) throw new Error("Use either --in or --at, not both");
31298
+ if (options.in) {
31299
+ const ms = parseDuration(options.in);
31300
+ if (!ms) throw new Error(`Invalid --in duration: ${options.in} (examples: 30m, 2h, 3d, 1w, 1d12h)`);
31301
+ return new Date(now + ms).toISOString();
31302
+ }
31303
+ if (options.at) {
31304
+ const at = new Date(options.at);
31305
+ if (Number.isNaN(at.getTime()) || !/(?:Z|[+-]\d\d:?\d\d)$/i.test(options.at.trim())) {
31306
+ throw new Error(`Invalid --at: ${options.at} (use ISO-8601 with a timezone, e.g. 2026-10-08T09:00:00-07:00)`);
31307
+ }
31308
+ return at.toISOString();
31309
+ }
31310
+ return void 0;
31311
+ }
31312
+ function parseWorkspaceTarget(value) {
31313
+ if (value === void 0) return void 0;
31314
+ if (value === "new") return { reuse_workspace: false, target_workspace_id: null };
31315
+ if (value === "reuse") return { reuse_workspace: true, target_workspace_id: null };
31316
+ if (value === "current") {
31317
+ const workspaceId = readAgentConfig()?.workspace_id;
31318
+ if (!workspaceId) throw new Error("--workspace current only works inside a Replicas workspace");
31319
+ return { reuse_workspace: true, target_workspace_id: workspaceId };
31320
+ }
31321
+ return { reuse_workspace: true, target_workspace_id: value };
31322
+ }
31323
+ function parseMaxRuns(value) {
31324
+ if (value === void 0) return void 0;
31325
+ if (["none", "unlimited"].includes(value.trim().toLowerCase())) return null;
31326
+ const runs = Number(value);
31327
+ if (!Number.isSafeInteger(runs) || runs < 1) throw new Error('--max-runs must be a positive integer or "none"');
31328
+ return runs;
31329
+ }
31330
+ function localTimezone() {
31331
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
31332
+ }
31333
+ function formatDestination(automation2) {
31334
+ if (!automation2.reuse_workspace) return "new workspace each run";
31335
+ return automation2.target_workspace_id ? `workspace ${automation2.target_workspace_id}` : "one workspace, created on the first run";
31336
+ }
31337
+ function formatRuns(automation2) {
31338
+ return automation2.max_runs === null ? `${automation2.run_count} (unlimited)` : `${automation2.run_count} of ${automation2.max_runs} (deletes itself after the last run)`;
31339
+ }
31268
31340
  function withExcludedActors(config3, excludedActors) {
31269
31341
  const next = { ...config3 };
31270
31342
  if (excludedActors?.length) {
@@ -31297,6 +31369,7 @@ function applyAgentSelection(body, existing) {
31297
31369
  function formatTrigger(trigger) {
31298
31370
  if (trigger.type === "cron") {
31299
31371
  const config3 = trigger.config;
31372
+ if (config3.run_at) return `once: ${formatDate2(config3.run_at)}`;
31300
31373
  const tz = config3.timezone ? ` (${config3.timezone})` : "";
31301
31374
  return `cron: ${config3.schedule}${tz}`;
31302
31375
  }
@@ -31385,6 +31458,9 @@ function printAutomation(automation2) {
31385
31458
  if (automation2.cron_next_fire_at) {
31386
31459
  console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31387
31460
  }
31461
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31462
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31463
+ if (automation2.background) console.log(import_chalk20.default.gray(" List: background"));
31388
31464
  if (automation2.workspace_lifecycle_policy && automation2.workspace_lifecycle_policy !== "default") {
31389
31465
  console.log(import_chalk20.default.gray(` Lifecycle: ${automation2.workspace_lifecycle_policy}`));
31390
31466
  }
@@ -31410,6 +31486,7 @@ async function automationListCommand(options) {
31410
31486
  if (options.triggerType) params.set("trigger_type", options.triggerType);
31411
31487
  if (options.enabled) params.set("enabled", options.enabled);
31412
31488
  if (options.search) params.set("search", options.search);
31489
+ if (options.background) params.set("background", options.background);
31413
31490
  const query = params.toString();
31414
31491
  const response = await orgAuthenticatedFetch(
31415
31492
  `/v1/automations${query ? "?" + query : ""}`
@@ -31462,6 +31539,9 @@ Automation: ${automation2.name}
31462
31539
  if (automation2.cron_next_fire_at) {
31463
31540
  console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31464
31541
  }
31542
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31543
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31544
+ console.log(import_chalk20.default.gray(` List: ${automation2.background ? "background" : "main"}`));
31465
31545
  if (automation2.workspace_lifecycle_policy) {
31466
31546
  console.log(import_chalk20.default.gray(` Lifecycle Policy: ${automation2.workspace_lifecycle_policy}`));
31467
31547
  }
@@ -31600,6 +31680,10 @@ async function promptForTriggers(repositories) {
31600
31680
  }
31601
31681
  async function automationCreateCommand(name, options) {
31602
31682
  ensureOrgApiAuthenticated();
31683
+ const runAt = resolveRunAt(options);
31684
+ if (runAt && options.triggerCron) throw new Error("--in/--at cannot be combined with --trigger-cron");
31685
+ const maxRuns = parseMaxRuns(options.maxRuns);
31686
+ const workspaceTarget = parseWorkspaceTarget(options.workspace ?? (runAt && readAgentConfig() ? "current" : void 0));
31603
31687
  const lifecyclePolicy = parseAutomationLifecycleOptions(options);
31604
31688
  if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(lifecyclePolicy ?? "default")) {
31605
31689
  console.log(import_chalk20.default.red("--auto-stop-minutes requires --lifecycle default"));
@@ -31643,7 +31727,8 @@ async function automationCreateCommand(name, options) {
31643
31727
  `/v1/environments?scope=${options.personal ? "all" : "org"}`
31644
31728
  );
31645
31729
  const selectableEnvs = envResponse.environments;
31646
- if (selectableEnvs.length === 0) {
31730
+ const environmentFromTarget = !options.environment && (!!workspaceTarget?.target_workspace_id || !!readAgentConfig());
31731
+ if (selectableEnvs.length === 0 && !environmentFromTarget) {
31647
31732
  console.log(import_chalk20.default.red("No environments found. Please create an environment first."));
31648
31733
  process.exit(1);
31649
31734
  }
@@ -31678,7 +31763,9 @@ async function automationCreateCommand(name, options) {
31678
31763
  automationPrompt = response2.prompt;
31679
31764
  }
31680
31765
  let selectedEnvironmentId;
31681
- if (options.environment) {
31766
+ if (environmentFromTarget) {
31767
+ selectedEnvironmentId = void 0;
31768
+ } else if (options.environment) {
31682
31769
  selectedEnvironmentId = resolveSelectableEnvironmentId(options.environment, selectableEnvs);
31683
31770
  } else {
31684
31771
  const envResponse2 = await (0, import_prompts8.default)({
@@ -31698,6 +31785,9 @@ async function automationCreateCommand(name, options) {
31698
31785
  selectedEnvironmentId = envResponse2.env;
31699
31786
  }
31700
31787
  let triggers = [];
31788
+ if (runAt) {
31789
+ triggers.push({ type: "cron", config: { run_at: runAt, timezone: localTimezone() } });
31790
+ }
31701
31791
  if (options.triggerCron) {
31702
31792
  triggers.push({
31703
31793
  type: "cron",
@@ -31739,7 +31829,7 @@ async function automationCreateCommand(name, options) {
31739
31829
  }
31740
31830
  }
31741
31831
  let prFollowups = options.prFollowups === true;
31742
- if (options.prFollowups === void 0) {
31832
+ if (options.prFollowups === void 0 && process.stdin.isTTY) {
31743
31833
  const prFollowupsResponse = await (0, import_prompts8.default)({
31744
31834
  type: "confirm",
31745
31835
  name: "prFollowups",
@@ -31752,8 +31842,11 @@ async function automationCreateCommand(name, options) {
31752
31842
  scope: options.personal ? "user" : "org",
31753
31843
  name: automationName,
31754
31844
  prompt: automationPrompt,
31755
- environment_id: selectedEnvironmentId,
31845
+ ...selectedEnvironmentId ? { environment_id: selectedEnvironmentId } : {},
31756
31846
  triggers,
31847
+ ...maxRuns !== void 0 ? { max_runs: maxRuns } : {},
31848
+ ...workspaceTarget,
31849
+ ...options.background ? { background: true } : {},
31757
31850
  enabled: options.enabled !== false,
31758
31851
  ...options.githubChecks !== void 0 ? { github_check_names: normalizeAutomationGithubCheckNames(options.githubChecks.split(",")) } : {},
31759
31852
  config: workspaceConfigWithPrFollowups(void 0, prFollowups),
@@ -31779,8 +31872,11 @@ Created automation: ${automation2.name}`));
31779
31872
  console.log(import_chalk20.default.gray(` Triggers: ${automation2.triggers.map(formatTrigger).join(", ")}`));
31780
31873
  }
31781
31874
  if (automation2.cron_next_fire_at) {
31782
- console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31875
+ console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)} (${automation2.cron_next_fire_at})`));
31783
31876
  }
31877
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31878
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31879
+ console.log(import_chalk20.default.gray(` List: ${automation2.background ? "background" : "main"}`));
31784
31880
  console.log();
31785
31881
  } catch (error51) {
31786
31882
  console.error(import_chalk20.default.red(`Error: ${error51 instanceof Error ? error51.message : "Unknown error"}`));
@@ -31789,6 +31885,10 @@ Created automation: ${automation2.name}`));
31789
31885
  }
31790
31886
  async function automationEditCommand(id, options) {
31791
31887
  ensureOrgApiAuthenticated();
31888
+ const runAt = resolveRunAt(options);
31889
+ if (runAt && options.triggerCron) throw new Error("--in/--at cannot be combined with --trigger-cron");
31890
+ const maxRuns = parseMaxRuns(options.maxRuns);
31891
+ const workspaceTarget = parseWorkspaceTarget(options.workspace);
31792
31892
  const lifecyclePolicy = parseAutomationLifecycleOptions(options);
31793
31893
  if (options.autoStopMinutes) {
31794
31894
  const minutes = parseInt(options.autoStopMinutes, 10);
@@ -31823,7 +31923,7 @@ async function automationEditCommand(id, options) {
31823
31923
  model: existing.automation.model
31824
31924
  });
31825
31925
  const body = {};
31826
- const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.triggerGitlab || options.environment || options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== void 0 || options.githubChecks !== void 0 || options.addGithubChecks !== void 0 || options.lifecycle || options.sleepWhenDone || options.autoStopMinutes || options.agentProvider !== void 0 || options.model !== void 0 || options.thinkingLevel !== void 0 || options.planMode !== void 0 || options.goalMode !== void 0 || options.fastMode !== void 0;
31926
+ const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.triggerGitlab || options.environment || options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== void 0 || options.githubChecks !== void 0 || options.addGithubChecks !== void 0 || options.lifecycle || options.sleepWhenDone || options.autoStopMinutes || options.agentProvider !== void 0 || options.model !== void 0 || options.thinkingLevel !== void 0 || options.planMode !== void 0 || options.goalMode !== void 0 || options.fastMode !== void 0 || runAt !== void 0 || maxRuns !== void 0 || workspaceTarget !== void 0 || options.background !== void 0;
31827
31927
  if (!hasOptions) {
31828
31928
  const nameResponse = await (0, import_prompts8.default)({
31829
31929
  type: "text",
@@ -31892,8 +31992,11 @@ async function automationEditCommand(id, options) {
31892
31992
  ...normalizeAutomationGithubCheckNames(options.addGithubChecks.split(","))
31893
31993
  ])];
31894
31994
  }
31895
- if (options.triggerCron || options.triggerGithub || options.triggerGitlab) {
31995
+ if (runAt || options.triggerCron || options.triggerGithub || options.triggerGitlab) {
31896
31996
  const triggers = [];
31997
+ if (runAt) {
31998
+ triggers.push({ type: "cron", config: { run_at: runAt, timezone: localTimezone() } });
31999
+ }
31897
32000
  if (options.triggerCron) {
31898
32001
  triggers.push({
31899
32002
  type: "cron",
@@ -31981,6 +32084,9 @@ async function automationEditCommand(id, options) {
31981
32084
  if (options.planMode !== void 0) body.plan_mode = options.planMode;
31982
32085
  if (options.goalMode !== void 0) body.goal_mode = options.goalMode;
31983
32086
  if (options.fastMode !== void 0) body.fast_mode = options.fastMode;
32087
+ if (maxRuns !== void 0) body.max_runs = maxRuns;
32088
+ if (options.background !== void 0) body.background = options.background;
32089
+ Object.assign(body, workspaceTarget);
31984
32090
  Object.assign(body, agentSelection);
31985
32091
  }
31986
32092
  if (Object.keys(body).length === 0) {
@@ -33558,7 +33664,7 @@ program.command("read <id>").description("Read conversation history of a replica
33558
33664
  }
33559
33665
  });
33560
33666
  var automation = program.command("automation").alias("auto").description("Manage automations");
33561
- automation.command("list").description("List all automations").option("-p, --page <page>", "Page number").option("-l, --limit <limit>", "Number of items per page").option("--owner <owner>", "Ownership filter: org, user, all").option("--trigger-type <type>", "Only automations with a trigger of this type (cron, github, gitlab, slack, sentry, custom)").option("--enabled <enabled>", "Only enabled or disabled automations (true/false)").option("--search <search>", "Case-insensitive substring match on the name").action(async (options) => {
33667
+ automation.command("list").description("List all automations").option("-p, --page <page>", "Page number").option("-l, --limit <limit>", "Number of items per page").option("--owner <owner>", "Ownership filter: org, user, all").option("--trigger-type <type>", "Only automations with a trigger of this type (cron, github, gitlab, slack, sentry, custom)").option("--enabled <enabled>", "Only enabled or disabled automations (true/false)").option("--search <search>", "Case-insensitive substring match on the name").option("--background <background>", "Only background (true) or main-list (false) automations").action(async (options) => {
33562
33668
  try {
33563
33669
  await automationListCommand(options);
33564
33670
  } catch (error51) {
@@ -33582,7 +33688,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
33582
33688
  process.exit(1);
33583
33689
  }
33584
33690
  });
33585
- automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--confirmation-channel <id>", "Slack channel containing the Mothership confirmation").option("--confirmation-thread <ts>", "Slack thread containing the Mothership confirmation").option("--confirmation-message-ts <ts>", "Slack timestamp of the Mothership confirmation").option("--confirmation-user <id>", "Slack id of the confirming user").option("--disabled", "Create in disabled state").action(async (name, options) => {
33691
+ automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--confirmation-channel <id>", "Slack channel containing the Mothership confirmation").option("--confirmation-thread <ts>", "Slack thread containing the Mothership confirmation").option("--confirmation-message-ts <ts>", "Slack timestamp of the Mothership confirmation").option("--confirmation-user <id>", "Slack id of the confirming user").option("--in <duration>", "Run once after this long, e.g. 30m, 2h, 3d, 1w (inside a workspace, defaults --workspace to current)").option("--at <datetime>", "Run once at this ISO-8601 time with timezone, e.g. 2026-10-08T09:00:00-07:00").option("--max-runs <n>", 'Delete the automation after this many runs ("none" for unlimited)').option("--workspace <target>", "Where runs go: new (default, new workspace each run), reuse (one workspace created on the first run), current (this workspace), or a workspace ID").option("--background", "Keep it out of the main automations list (for offhand follow-ups)").option("--disabled", "Create in disabled state").action(async (name, options) => {
33586
33692
  try {
33587
33693
  await automationCreateCommand(name, {
33588
33694
  ...options,
@@ -33597,7 +33703,7 @@ automation.command("create [name]").description("Create a new automation").optio
33597
33703
  process.exit(1);
33598
33704
  }
33599
33705
  });
33600
- automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
33706
+ automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).option("--in <duration>", "Replace triggers with a one-time run after this long, e.g. 30m, 2h, 3d, 1w").option("--at <datetime>", "Replace triggers with a one-time run at this ISO-8601 time with timezone").option("--max-runs <n>", 'Delete the automation after this many runs in total ("none" for unlimited)').option("--workspace <target>", "Where runs go: new, reuse, current, or a workspace ID").option("--background <enabled>", "Keep it out of the main automations list (true/false)", parseBooleanOption).action(async (id, options) => {
33601
33707
  try {
33602
33708
  await automationEditCommand(id, options);
33603
33709
  } catch (error51) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.777",
3
+ "version": "0.2.778",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {