replicas-cli 0.2.640 → 0.2.641
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 +3 -0
- package/dist/index.cjs +31 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,9 @@ Choose the organization used by organization-scoped commands. The selection pers
|
|
|
41
41
|
### `replicas connect <workspace-name>`
|
|
42
42
|
Connect to a workspace via SSH.
|
|
43
43
|
|
|
44
|
+
### `replicas code [workspace-name...]`
|
|
45
|
+
Open a workspace in VS Code via Remote SSH. Omit the argument to pick a workspace with the arrow keys and Enter, or pass a name or ID. Names with spaces work with or without quotes.
|
|
46
|
+
|
|
44
47
|
### Coding agents
|
|
45
48
|
Use `replicas claude-auth` or `replicas codex-auth` to connect Claude Code or Codex credentials. Cursor uses a Cursor API key configured in Coding Agents settings.
|
|
46
49
|
|
package/dist/index.cjs
CHANGED
|
@@ -27252,7 +27252,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
|
|
|
27252
27252
|
});
|
|
27253
27253
|
|
|
27254
27254
|
// ../shared/src/cli-version.ts
|
|
27255
|
-
var CLI_VERSION = "0.2.
|
|
27255
|
+
var CLI_VERSION = "0.2.641";
|
|
27256
27256
|
|
|
27257
27257
|
// ../shared/src/version.ts
|
|
27258
27258
|
function compareVersions(v1, v2) {
|
|
@@ -28512,27 +28512,37 @@ async function resolveWorkspaceRecord(workspaceName) {
|
|
|
28512
28512
|
if (!canCallOrgApi()) {
|
|
28513
28513
|
throw new Error('No organization selected. Please run "replicas org switch" first.');
|
|
28514
28514
|
}
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
);
|
|
28522
|
-
if (
|
|
28523
|
-
|
|
28515
|
+
if (workspaceName) {
|
|
28516
|
+
const exactWorkspace = await fetchWorkspaceById(workspaceName);
|
|
28517
|
+
if (exactWorkspace) return exactWorkspace;
|
|
28518
|
+
}
|
|
28519
|
+
console.log(import_chalk5.default.blue(workspaceName ? `
|
|
28520
|
+
Searching for workspace: ${workspaceName}...` : "\nLoading workspaces..."));
|
|
28521
|
+
const params = new URLSearchParams({ limit: "100" });
|
|
28522
|
+
if (workspaceName) params.set("name", workspaceName);
|
|
28523
|
+
const workspaces = [];
|
|
28524
|
+
for (let page = 1; ; page++) {
|
|
28525
|
+
params.set("page", String(page));
|
|
28526
|
+
const response = await orgAuthenticatedFetch(`/v1/workspaces?${params}`);
|
|
28527
|
+
workspaces.push(...response.workspaces);
|
|
28528
|
+
if (page >= response.totalPages || response.workspaces.length === 0) break;
|
|
28529
|
+
}
|
|
28530
|
+
if (workspaces.length === 0) {
|
|
28531
|
+
throw new Error(workspaceName ? `No workspaces found with name matching "${workspaceName}".` : "No workspaces found.");
|
|
28524
28532
|
}
|
|
28525
28533
|
let selectedWorkspace;
|
|
28526
|
-
if (
|
|
28527
|
-
selectedWorkspace =
|
|
28534
|
+
if (workspaceName && workspaces.length === 1) {
|
|
28535
|
+
selectedWorkspace = workspaces[0];
|
|
28528
28536
|
} else {
|
|
28529
|
-
|
|
28530
|
-
|
|
28537
|
+
if (workspaceName) {
|
|
28538
|
+
console.log(import_chalk5.default.yellow(`
|
|
28539
|
+
Found ${workspaces.length} workspaces matching "${workspaceName}":`));
|
|
28540
|
+
}
|
|
28531
28541
|
const selectResponse = await (0, import_prompts5.default)({
|
|
28532
28542
|
type: "select",
|
|
28533
28543
|
name: "workspaceId",
|
|
28534
28544
|
message: "Select a workspace:",
|
|
28535
|
-
choices:
|
|
28545
|
+
choices: workspaces.map((ws) => ({
|
|
28536
28546
|
title: `${ws.name} (${ws.status || "unknown"})`,
|
|
28537
28547
|
value: ws.id,
|
|
28538
28548
|
description: `Status: ${ws.status || "unknown"}`
|
|
@@ -28541,7 +28551,7 @@ Found ${response.workspaces.length} workspaces matching "${workspaceName}":`));
|
|
|
28541
28551
|
if (!selectResponse.workspaceId) {
|
|
28542
28552
|
throw new Error("Workspace selection cancelled.");
|
|
28543
28553
|
}
|
|
28544
|
-
const selected =
|
|
28554
|
+
const selected = workspaces.find((ws) => ws.id === selectResponse.workspaceId);
|
|
28545
28555
|
if (!selected) {
|
|
28546
28556
|
throw new Error("Selected workspace was not found.");
|
|
28547
28557
|
}
|
|
@@ -28701,6 +28711,10 @@ async function codeCommand(workspaceName) {
|
|
|
28701
28711
|
console.log(import_chalk7.default.red('Not logged in. Please run "replicas login" first.'));
|
|
28702
28712
|
process.exit(1);
|
|
28703
28713
|
}
|
|
28714
|
+
if (!workspaceName && !process.stdin.isTTY) {
|
|
28715
|
+
console.error(import_chalk7.default.red('Pass a workspace name or ID, or run "replicas code" in an interactive terminal.'));
|
|
28716
|
+
process.exit(1);
|
|
28717
|
+
}
|
|
28704
28718
|
try {
|
|
28705
28719
|
const { workspace, sshToken, sshHost, sshProxyCommand, repoName } = await prepareWorkspaceConnection(workspaceName);
|
|
28706
28720
|
const hostAlias = getWorkspaceHostAlias(workspace.name);
|
|
@@ -32154,7 +32168,7 @@ Error: ${error51 instanceof Error ? error51.message : "Unknown error"}`));
|
|
|
32154
32168
|
process.exit(1);
|
|
32155
32169
|
}
|
|
32156
32170
|
});
|
|
32157
|
-
program.command("code
|
|
32171
|
+
program.command("code [workspace-name...]").description("Open a workspace in VSCode/Cursor via Remote SSH (pick a workspace if omitted)").action(async (workspaceName = []) => {
|
|
32158
32172
|
try {
|
|
32159
32173
|
await codeCommand(workspaceName.join(" "));
|
|
32160
32174
|
} catch (error51) {
|