replicas-cli 0.2.777 → 0.2.780

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 +125 -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"));
@@ -7744,6 +7744,13 @@ var CREDENTIAL_TYPE = {
7744
7744
  MUSE_OAUTH: "muse_oauth",
7745
7745
  MUSE_API_KEY: "muse_api_key"
7746
7746
  };
7747
+ var ENVIRONMENT_AUTH_REQUIRED_KEYS = {
7748
+ [AGENT.CLAUDE]: [
7749
+ [CREDENTIAL_METHOD.BEDROCK, ["CLAUDE_CODE_USE_BEDROCK", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"]],
7750
+ [CREDENTIAL_METHOD.API_KEY, ["ANTHROPIC_API_KEY"]]
7751
+ ],
7752
+ [AGENT.CODEX]: [[CREDENTIAL_METHOD.API_KEY, ["OPENAI_API_KEY"]]]
7753
+ };
7747
7754
  var INFERENCE_PROVIDER_LABELS = {
7748
7755
  [CREDENTIAL_METHOD.OLLAMA]: "Ollama",
7749
7756
  [CREDENTIAL_METHOD.OPENCODE_GO]: "OpenCode Go",
@@ -25217,6 +25224,7 @@ Take action *with* Replicas itself \u2014 manage automations, environments (vari
25217
25224
 
25218
25225
  Use this when:
25219
25226
  - The user asks you to create, edit, run, or delete an automation
25227
+ - 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
25228
  - The user asks you to manage environments, environment variables, or environment files
25221
25229
  - The user asks "what envs / repos / automations do I have?"
25222
25230
  - The user asks you to scaffold a \`replicas.json\` / \`replicas.yaml\` in a repo
@@ -25277,6 +25285,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
25277
25285
  | "Create a new env for my \`acme/web\` repo" | \`replicas environment create <name> -r acme/web\` |
25278
25286
  | "What automations do I have?" | \`replicas automation list\` |
25279
25287
  | "Run my nightly automation now" | \`replicas automation run <id>\` |
25288
+ | "Check back on this in a week" | \`replicas automation create ... --in 1w --background --personal\` |
25280
25289
  | "Make an automation that runs every weekday at 9am" | \`replicas automation create\` (interactive) or \`--trigger-cron "0 9 * * 1-5"\` |
25281
25290
  | "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
25291
  | "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 +25397,26 @@ replicas automation create ... --lifecycle default --auto-stop-minutes 30
25388
25397
 
25389
25398
  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
25399
 
25400
+ ### Follow-ups and reminders
25401
+
25402
+ 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:
25403
+
25404
+ \`\`\`bash
25405
+ replicas automation create "Re-check PR #142 CI" \\
25406
+ --in 1w \\
25407
+ --background --personal \\
25408
+ --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."
25409
+ \`\`\`
25410
+
25411
+ - \`--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).
25412
+ - 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\`.
25413
+ - 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.
25414
+ - \`--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.
25415
+ - \`--personal\` makes the automation the user's own. Omit it only when the follow-up belongs to the organization.
25416
+ - 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.
25417
+ - Only schedule when the user asked for a follow-up or clearly agreed to one; not for "maybe I'll look at this later".
25418
+ - 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\`.
25419
+
25391
25420
  ### Edit
25392
25421
 
25393
25422
  \`\`\`bash
@@ -27928,7 +27957,7 @@ var headlessAgentRequestSchema = external_exports.object({
27928
27957
  });
27929
27958
 
27930
27959
  // ../shared/src/cli-version.ts
27931
- var CLI_VERSION = "0.2.777";
27960
+ var CLI_VERSION = "0.2.780";
27932
27961
 
27933
27962
  // ../shared/src/version.ts
27934
27963
  function compareVersions(v1, v2) {
@@ -31265,6 +31294,56 @@ function parseExcludedActorsOption(value) {
31265
31294
  const actors = value.split(",").map((actor) => actor.trim()).filter(Boolean);
31266
31295
  return actors.length > 0 ? actors : void 0;
31267
31296
  }
31297
+ var DURATION_UNIT_MS = { m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
31298
+ function parseDuration(value) {
31299
+ const parts = [...value.trim().toLowerCase().matchAll(/(\d+)\s*([mhdw])/g)];
31300
+ if (parts.length === 0 || parts.map((p) => p[0]).join("") !== value.trim().toLowerCase().replace(/\s+/g, "")) return null;
31301
+ return parts.reduce((total, [, amount, unit]) => total + Number(amount) * DURATION_UNIT_MS[unit], 0);
31302
+ }
31303
+ function resolveRunAt(options, now = Date.now()) {
31304
+ if (options.in && options.at) throw new Error("Use either --in or --at, not both");
31305
+ if (options.in) {
31306
+ const ms = parseDuration(options.in);
31307
+ if (!ms) throw new Error(`Invalid --in duration: ${options.in} (examples: 30m, 2h, 3d, 1w, 1d12h)`);
31308
+ return new Date(now + ms).toISOString();
31309
+ }
31310
+ if (options.at) {
31311
+ const at = new Date(options.at);
31312
+ if (Number.isNaN(at.getTime()) || !/(?:Z|[+-]\d\d:?\d\d)$/i.test(options.at.trim())) {
31313
+ throw new Error(`Invalid --at: ${options.at} (use ISO-8601 with a timezone, e.g. 2026-10-08T09:00:00-07:00)`);
31314
+ }
31315
+ return at.toISOString();
31316
+ }
31317
+ return void 0;
31318
+ }
31319
+ function parseWorkspaceTarget(value) {
31320
+ if (value === void 0) return void 0;
31321
+ if (value === "new") return { reuse_workspace: false, target_workspace_id: null };
31322
+ if (value === "reuse") return { reuse_workspace: true, target_workspace_id: null };
31323
+ if (value === "current") {
31324
+ const workspaceId = readAgentConfig()?.workspace_id;
31325
+ if (!workspaceId) throw new Error("--workspace current only works inside a Replicas workspace");
31326
+ return { reuse_workspace: true, target_workspace_id: workspaceId };
31327
+ }
31328
+ return { reuse_workspace: true, target_workspace_id: value };
31329
+ }
31330
+ function parseMaxRuns(value) {
31331
+ if (value === void 0) return void 0;
31332
+ if (["none", "unlimited"].includes(value.trim().toLowerCase())) return null;
31333
+ const runs = Number(value);
31334
+ if (!Number.isSafeInteger(runs) || runs < 1) throw new Error('--max-runs must be a positive integer or "none"');
31335
+ return runs;
31336
+ }
31337
+ function localTimezone() {
31338
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
31339
+ }
31340
+ function formatDestination(automation2) {
31341
+ if (!automation2.reuse_workspace) return "new workspace each run";
31342
+ return automation2.target_workspace_id ? `workspace ${automation2.target_workspace_id}` : "one workspace, created on the first run";
31343
+ }
31344
+ function formatRuns(automation2) {
31345
+ return automation2.max_runs === null ? `${automation2.run_count} (unlimited)` : `${automation2.run_count} of ${automation2.max_runs} (deletes itself after the last run)`;
31346
+ }
31268
31347
  function withExcludedActors(config3, excludedActors) {
31269
31348
  const next = { ...config3 };
31270
31349
  if (excludedActors?.length) {
@@ -31297,6 +31376,7 @@ function applyAgentSelection(body, existing) {
31297
31376
  function formatTrigger(trigger) {
31298
31377
  if (trigger.type === "cron") {
31299
31378
  const config3 = trigger.config;
31379
+ if (config3.run_at) return `once: ${formatDate2(config3.run_at)}`;
31300
31380
  const tz = config3.timezone ? ` (${config3.timezone})` : "";
31301
31381
  return `cron: ${config3.schedule}${tz}`;
31302
31382
  }
@@ -31385,6 +31465,9 @@ function printAutomation(automation2) {
31385
31465
  if (automation2.cron_next_fire_at) {
31386
31466
  console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31387
31467
  }
31468
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31469
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31470
+ if (automation2.background) console.log(import_chalk20.default.gray(" List: background"));
31388
31471
  if (automation2.workspace_lifecycle_policy && automation2.workspace_lifecycle_policy !== "default") {
31389
31472
  console.log(import_chalk20.default.gray(` Lifecycle: ${automation2.workspace_lifecycle_policy}`));
31390
31473
  }
@@ -31410,6 +31493,7 @@ async function automationListCommand(options) {
31410
31493
  if (options.triggerType) params.set("trigger_type", options.triggerType);
31411
31494
  if (options.enabled) params.set("enabled", options.enabled);
31412
31495
  if (options.search) params.set("search", options.search);
31496
+ if (options.background) params.set("background", options.background);
31413
31497
  const query = params.toString();
31414
31498
  const response = await orgAuthenticatedFetch(
31415
31499
  `/v1/automations${query ? "?" + query : ""}`
@@ -31462,6 +31546,9 @@ Automation: ${automation2.name}
31462
31546
  if (automation2.cron_next_fire_at) {
31463
31547
  console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31464
31548
  }
31549
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31550
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31551
+ console.log(import_chalk20.default.gray(` List: ${automation2.background ? "background" : "main"}`));
31465
31552
  if (automation2.workspace_lifecycle_policy) {
31466
31553
  console.log(import_chalk20.default.gray(` Lifecycle Policy: ${automation2.workspace_lifecycle_policy}`));
31467
31554
  }
@@ -31600,6 +31687,10 @@ async function promptForTriggers(repositories) {
31600
31687
  }
31601
31688
  async function automationCreateCommand(name, options) {
31602
31689
  ensureOrgApiAuthenticated();
31690
+ const runAt = resolveRunAt(options);
31691
+ if (runAt && options.triggerCron) throw new Error("--in/--at cannot be combined with --trigger-cron");
31692
+ const maxRuns = parseMaxRuns(options.maxRuns);
31693
+ const workspaceTarget = parseWorkspaceTarget(options.workspace ?? (runAt && readAgentConfig() ? "current" : void 0));
31603
31694
  const lifecyclePolicy = parseAutomationLifecycleOptions(options);
31604
31695
  if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(lifecyclePolicy ?? "default")) {
31605
31696
  console.log(import_chalk20.default.red("--auto-stop-minutes requires --lifecycle default"));
@@ -31643,7 +31734,8 @@ async function automationCreateCommand(name, options) {
31643
31734
  `/v1/environments?scope=${options.personal ? "all" : "org"}`
31644
31735
  );
31645
31736
  const selectableEnvs = envResponse.environments;
31646
- if (selectableEnvs.length === 0) {
31737
+ const environmentFromTarget = !options.environment && (!!workspaceTarget?.target_workspace_id || !!readAgentConfig());
31738
+ if (selectableEnvs.length === 0 && !environmentFromTarget) {
31647
31739
  console.log(import_chalk20.default.red("No environments found. Please create an environment first."));
31648
31740
  process.exit(1);
31649
31741
  }
@@ -31678,7 +31770,9 @@ async function automationCreateCommand(name, options) {
31678
31770
  automationPrompt = response2.prompt;
31679
31771
  }
31680
31772
  let selectedEnvironmentId;
31681
- if (options.environment) {
31773
+ if (environmentFromTarget) {
31774
+ selectedEnvironmentId = void 0;
31775
+ } else if (options.environment) {
31682
31776
  selectedEnvironmentId = resolveSelectableEnvironmentId(options.environment, selectableEnvs);
31683
31777
  } else {
31684
31778
  const envResponse2 = await (0, import_prompts8.default)({
@@ -31698,6 +31792,9 @@ async function automationCreateCommand(name, options) {
31698
31792
  selectedEnvironmentId = envResponse2.env;
31699
31793
  }
31700
31794
  let triggers = [];
31795
+ if (runAt) {
31796
+ triggers.push({ type: "cron", config: { run_at: runAt, timezone: localTimezone() } });
31797
+ }
31701
31798
  if (options.triggerCron) {
31702
31799
  triggers.push({
31703
31800
  type: "cron",
@@ -31739,7 +31836,7 @@ async function automationCreateCommand(name, options) {
31739
31836
  }
31740
31837
  }
31741
31838
  let prFollowups = options.prFollowups === true;
31742
- if (options.prFollowups === void 0) {
31839
+ if (options.prFollowups === void 0 && process.stdin.isTTY) {
31743
31840
  const prFollowupsResponse = await (0, import_prompts8.default)({
31744
31841
  type: "confirm",
31745
31842
  name: "prFollowups",
@@ -31752,8 +31849,11 @@ async function automationCreateCommand(name, options) {
31752
31849
  scope: options.personal ? "user" : "org",
31753
31850
  name: automationName,
31754
31851
  prompt: automationPrompt,
31755
- environment_id: selectedEnvironmentId,
31852
+ ...selectedEnvironmentId ? { environment_id: selectedEnvironmentId } : {},
31756
31853
  triggers,
31854
+ ...maxRuns !== void 0 ? { max_runs: maxRuns } : {},
31855
+ ...workspaceTarget,
31856
+ ...options.background ? { background: true } : {},
31757
31857
  enabled: options.enabled !== false,
31758
31858
  ...options.githubChecks !== void 0 ? { github_check_names: normalizeAutomationGithubCheckNames(options.githubChecks.split(",")) } : {},
31759
31859
  config: workspaceConfigWithPrFollowups(void 0, prFollowups),
@@ -31779,8 +31879,11 @@ Created automation: ${automation2.name}`));
31779
31879
  console.log(import_chalk20.default.gray(` Triggers: ${automation2.triggers.map(formatTrigger).join(", ")}`));
31780
31880
  }
31781
31881
  if (automation2.cron_next_fire_at) {
31782
- console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
31882
+ console.log(import_chalk20.default.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)} (${automation2.cron_next_fire_at})`));
31783
31883
  }
31884
+ console.log(import_chalk20.default.gray(` Runs: ${formatRuns(automation2)}`));
31885
+ console.log(import_chalk20.default.gray(` Workspace: ${formatDestination(automation2)}`));
31886
+ console.log(import_chalk20.default.gray(` List: ${automation2.background ? "background" : "main"}`));
31784
31887
  console.log();
31785
31888
  } catch (error51) {
31786
31889
  console.error(import_chalk20.default.red(`Error: ${error51 instanceof Error ? error51.message : "Unknown error"}`));
@@ -31789,6 +31892,10 @@ Created automation: ${automation2.name}`));
31789
31892
  }
31790
31893
  async function automationEditCommand(id, options) {
31791
31894
  ensureOrgApiAuthenticated();
31895
+ const runAt = resolveRunAt(options);
31896
+ if (runAt && options.triggerCron) throw new Error("--in/--at cannot be combined with --trigger-cron");
31897
+ const maxRuns = parseMaxRuns(options.maxRuns);
31898
+ const workspaceTarget = parseWorkspaceTarget(options.workspace);
31792
31899
  const lifecyclePolicy = parseAutomationLifecycleOptions(options);
31793
31900
  if (options.autoStopMinutes) {
31794
31901
  const minutes = parseInt(options.autoStopMinutes, 10);
@@ -31823,7 +31930,7 @@ async function automationEditCommand(id, options) {
31823
31930
  model: existing.automation.model
31824
31931
  });
31825
31932
  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;
31933
+ 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
31934
  if (!hasOptions) {
31828
31935
  const nameResponse = await (0, import_prompts8.default)({
31829
31936
  type: "text",
@@ -31892,8 +31999,11 @@ async function automationEditCommand(id, options) {
31892
31999
  ...normalizeAutomationGithubCheckNames(options.addGithubChecks.split(","))
31893
32000
  ])];
31894
32001
  }
31895
- if (options.triggerCron || options.triggerGithub || options.triggerGitlab) {
32002
+ if (runAt || options.triggerCron || options.triggerGithub || options.triggerGitlab) {
31896
32003
  const triggers = [];
32004
+ if (runAt) {
32005
+ triggers.push({ type: "cron", config: { run_at: runAt, timezone: localTimezone() } });
32006
+ }
31897
32007
  if (options.triggerCron) {
31898
32008
  triggers.push({
31899
32009
  type: "cron",
@@ -31981,6 +32091,9 @@ async function automationEditCommand(id, options) {
31981
32091
  if (options.planMode !== void 0) body.plan_mode = options.planMode;
31982
32092
  if (options.goalMode !== void 0) body.goal_mode = options.goalMode;
31983
32093
  if (options.fastMode !== void 0) body.fast_mode = options.fastMode;
32094
+ if (maxRuns !== void 0) body.max_runs = maxRuns;
32095
+ if (options.background !== void 0) body.background = options.background;
32096
+ Object.assign(body, workspaceTarget);
31984
32097
  Object.assign(body, agentSelection);
31985
32098
  }
31986
32099
  if (Object.keys(body).length === 0) {
@@ -33558,7 +33671,7 @@ program.command("read <id>").description("Read conversation history of a replica
33558
33671
  }
33559
33672
  });
33560
33673
  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) => {
33674
+ 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
33675
  try {
33563
33676
  await automationListCommand(options);
33564
33677
  } catch (error51) {
@@ -33582,7 +33695,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
33582
33695
  process.exit(1);
33583
33696
  }
33584
33697
  });
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) => {
33698
+ 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
33699
  try {
33587
33700
  await automationCreateCommand(name, {
33588
33701
  ...options,
@@ -33597,7 +33710,7 @@ automation.command("create [name]").description("Create a new automation").optio
33597
33710
  process.exit(1);
33598
33711
  }
33599
33712
  });
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) => {
33713
+ 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
33714
  try {
33602
33715
  await automationEditCommand(id, options);
33603
33716
  } 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.780",
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": {