replicas-cli 0.3.20 → 0.3.21

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 +20 -1
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -28396,7 +28396,7 @@ var headlessAgentRequestSchema = external_exports.object({
28396
28396
  });
28397
28397
 
28398
28398
  // ../shared/src/cli-version.ts
28399
- var CLI_VERSION = "0.3.20";
28399
+ var CLI_VERSION = "0.3.21";
28400
28400
 
28401
28401
  // ../shared/src/version.ts
28402
28402
  function compareVersions(v1, v2) {
@@ -31044,6 +31044,24 @@ async function credentialsRemoveCommand(service, options) {
31044
31044
  const response = await orgAuthenticatedFetch(credentialsPath(service, options), { method: "DELETE" });
31045
31045
  output(response, ({ success: success2 }) => console.log(success2 ? import_chalk17.default.green(`Removed ${scopeLabel(options)} ${service} credentials.`) : `No ${scopeLabel(options)} ${service} credentials to remove.`));
31046
31046
  }
31047
+ async function credentialsUsageCommand({ org: org2, user }) {
31048
+ const scope = org2 ? "org" : user ? "user" : null;
31049
+ const response = await orgAuthenticatedFetch(`/v1/agents/subscription-usage${scope ? `?scope=${scope}` : ""}`);
31050
+ output(response, ({ accounts }) => {
31051
+ if (accounts.length === 0) console.log(import_chalk17.default.yellow("No Claude or Codex subscriptions connected."));
31052
+ for (const account of accounts) {
31053
+ const limits = account.reconnectRequired ? import_chalk17.default.yellow(`Reconnect required: run replicas ${account.provider}-auth${account.scope === "org" ? " --org" : ""} with the same account`) : !account.windows ? import_chalk17.default.gray("Usage unavailable, try again in a few minutes") : account.windows.length === 0 ? "No usage limits" : account.windows.map((window) => [
31054
+ window.kind === "session" ? "5-hour" : "weekly",
31055
+ window.model,
31056
+ `${Math.round(window.usedPercent)}%`,
31057
+ window.resetsAt && import_chalk17.default.gray(`(resets ${formatDate(window.resetsAt)})`)
31058
+ ].filter(Boolean).join(" ")).join(", ");
31059
+ const label = [account.email ?? account.credentialId, account.planType].filter(Boolean).join(" ");
31060
+ console.log(`${account.provider} ${scopeLabel({ org: account.scope === "org" })} ${label} ${limits}`);
31061
+ if (account.exhaustedUntil) console.log(import_chalk17.default.gray(` Workspaces skip this account until ${formatDate(account.exhaustedUntil)}`));
31062
+ }
31063
+ });
31064
+ }
31047
31065
 
31048
31066
  // src/lib/version-check.ts
31049
31067
  var import_chalk18 = __toESM(require("chalk"));
@@ -34167,6 +34185,7 @@ credentials.command("list <agent>").description("List connected credentials for
34167
34185
  credentials.command("get <service>").description("Show stored credentials for a service (secrets masked for API keys)").option("-o, --org", "Organization credentials instead of personal").action(run(credentialsGetCommand));
34168
34186
  credentials.command("set <service>").description(`Store credentials. The API key (AWS secret for bedrock) is prompted for, or read from stdin. Services: ${API_KEY_CREDENTIAL_SERVICES.join(", ")}`).option("-o, --org", "Organization credentials (admins only)").option("--base-url <url>", "Base URL (ollama, openai-compatible, codex-foundry)").option("--models <ids>", "Comma-separated model IDs (ollama)").option("--models-url <url>", "Models endpoint (openai-compatible)").option("--authorization-header <value>", "Authorization header value (openai-compatible)").option("--preserve-authorization-header", "Forward the authorization header unchanged (openai-compatible)").option("--aws-access-key-id <id>", "AWS access key ID (bedrock)").option("--aws-region <region>", "AWS region (bedrock)").option("--small-fast-model-region <region>", "Region for the small fast model (bedrock)").option("--resource <name>", "Azure Foundry resource (claude-foundry)").option("--sonnet-model <id>", "Sonnet deployment (claude-foundry)").option("--haiku-model <id>", "Haiku deployment (claude-foundry)").option("--opus-model <id>", "Opus deployment (claude-foundry)").option("--model <id>", "Model deployment (codex-foundry)").action(run(credentialsSetCommand));
34169
34187
  credentials.command("remove <service>").description("Remove stored credentials for a service (also claude, codex, muse subscriptions)").option("-o, --org", "Organization credentials instead of personal").action(run(credentialsRemoveCommand));
34188
+ credentials.command("usage").description("Show how much of each connected Claude and ChatGPT subscription's 5-hour and weekly limits is used (personal and organization by default)").addOption(new import_commander.Option("-o, --org", "Only organization subscriptions").conflicts("user")).option("-u, --user", "Only your personal subscriptions").action(run(credentialsUsageCommand));
34170
34189
  var automation = program.command("automation").alias("auto").description("Manage automations");
34171
34190
  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(run(automationListCommand));
34172
34191
  automation.command("get <id>").description("Get automation details by ID").action(run(automationGetCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
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": {