replicas-cli 0.3.679 → 0.3.680

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 +25 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -43555,7 +43555,7 @@ var CLI_VERSION;
43555
43555
  var init_cli_version = __esm({
43556
43556
  "../shared/src/cli-version.ts"() {
43557
43557
  "use strict";
43558
- CLI_VERSION = "0.3.679";
43558
+ CLI_VERSION = "0.3.680";
43559
43559
  }
43560
43560
  });
43561
43561
 
@@ -57702,8 +57702,29 @@ function printEnvironment(env, repoSkillCount) {
57702
57702
  console.log(import_chalk22.default.gray(` Updated: ${formatDate(env.updated_at)}`));
57703
57703
  console.log();
57704
57704
  }
57705
- async function environmentListCommand() {
57705
+ async function environmentListCommand(options) {
57706
57706
  ensureOrgApiAuthenticated();
57707
+ if (options.organization) {
57708
+ output2(await orgAuthenticatedFetch("/v1/organization/environments"), ({ environments }) => {
57709
+ const byId = new Map(environments.map((environment2) => [environment2.id, environment2]));
57710
+ console.log(import_chalk22.default.green(`
57711
+ Environments (${environments.length}):
57712
+ `));
57713
+ for (const env of environments) {
57714
+ const ancestors = [];
57715
+ for (let parent = byId.get(env.source_environment_id ?? ""); parent; parent = byId.get(parent.source_environment_id ?? "")) {
57716
+ ancestors.unshift(parent.name);
57717
+ }
57718
+ const tags = [...env.user_id ? [`personal, ${env.owner_email ?? "removed member"}`] : [], ...env.archived ? ["archived"] : []];
57719
+ console.log(import_chalk22.default.white(` ${env.name}`) + import_chalk22.default.gray(tags.length ? ` (${tags.join(", ")})` : ""));
57720
+ console.log(import_chalk22.default.gray(` ID: ${env.id}`));
57721
+ console.log(import_chalk22.default.gray(` Builds on: ${ancestors.join(" \u203A ") || "nothing"}`));
57722
+ console.log(import_chalk22.default.gray(` Updated: ${formatDate(env.updated_at)}`));
57723
+ console.log();
57724
+ }
57725
+ });
57726
+ return;
57727
+ }
57707
57728
  const response = await orgAuthenticatedFetch("/v1/environments?scope=all");
57708
57729
  output2(response, ({ environments }) => {
57709
57730
  if (environments.length === 0) {
@@ -58536,6 +58557,7 @@ Replica: ${replica.name}
58536
58557
  `));
58537
58558
  console.log(import_chalk23.default.gray(` ID: ${replica.id}`));
58538
58559
  console.log(import_chalk23.default.gray(` Kind: ${replica.kind}`));
58560
+ console.log(import_chalk23.default.gray(` Environment: ${replica.environment_name ?? "deleted"} (${replica.environment_id})`));
58539
58561
  if (replica.repositories.length > 0) {
58540
58562
  console.log(import_chalk23.default.gray(` Repositories: ${replica.repositories.map((repository) => repository.name).join(", ")}`));
58541
58563
  }
@@ -62969,7 +62991,7 @@ var init_src2 = __esm({
62969
62991
  issue2.command("relate <issue> <type> <related>").description(`Mark <type> (${ISSUE_RELATION_TYPES.join(" or ")}) another issue`).action(run(issueRelateCommand));
62970
62992
  media.command("delete <mediaId>").description("Permanently delete media and stop all of its links working").action(run(mediaDeleteCommand));
62971
62993
  environment = program.command("environment").alias("env").description("Manage environments (org-scoped templates that back workspaces)");
62972
- environment.command("list").description("List all environments").action(run(environmentListCommand));
62994
+ environment.command("list").description("List all environments").option("--organization", "Every environment in the organization, members' personal ones included, with its owner and what it builds on (admins only)").action(run(environmentListCommand));
62973
62995
  environment.command("get <id-or-name>").description("Get an environment by ID or name").action(run(environmentGetCommand));
62974
62996
  environment.command("create [name]").description("Create a new environment").option("-d, --description <description>", "Environment description").option("-r, --repository <names>", "Repositories to clone (comma-separated names or IDs)").option("--system-prompt <prompt>", "System prompt for agents started in this environment").action(run(environmentCreateCommand));
62975
62997
  environment.command("fork <id-or-name> <name>").description("Create an environment that inherits another one").option("-d, --description <description>", "Environment description").option("-r, --repository <names>", "Repositories to clone instead of the source's (comma-separated names or IDs; empty string for none)").option("--personal", "Make a personal fork only you can see").action(run(environmentForkCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.679",
3
+ "version": "0.3.680",
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": {