@mcp-use/cli 3.1.0-canary.4 → 3.1.0-canary.5
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/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/org.d.ts.map +1 -1
- package/dist/commands/servers.d.ts.map +1 -1
- package/dist/index.cjs +138 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +138 -148
- package/dist/index.js.map +1 -1
- package/dist/utils/errors.d.ts +6 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAoB,OAAO,EAAE,MAAM,iBAAiB,CAAC;AA8FjE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EAAE,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,GAAG,IAAI,CAUhB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,OAAO,EAAE,EACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAC3B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CA2CzB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,IAAI,CAAC,CAiLhB;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBnD;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAqDnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/commands/deployments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/commands/deployments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4gBpC,wBAAgB,wBAAwB,IAAI,OAAO,CAuDlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/commands/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/commands/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiMpC,wBAAgB,gBAAgB,IAAI,OAAO,CAmD1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAmCpD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDtD;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0BvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../src/commands/servers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../src/commands/servers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8TpC,wBAAgB,oBAAoB,IAAI,OAAO,CAkC9C"}
|
package/dist/index.cjs
CHANGED
|
@@ -1528,6 +1528,28 @@ var McpUseAPI = class _McpUseAPI {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
1530
|
|
|
1531
|
+
// src/utils/errors.ts
|
|
1532
|
+
function handleCommandError(error, context) {
|
|
1533
|
+
if (error instanceof ApiUnauthorizedError) {
|
|
1534
|
+
console.error(
|
|
1535
|
+
source_default.red("\n\u2717 Your session has expired or your API key is invalid.")
|
|
1536
|
+
);
|
|
1537
|
+
console.error(
|
|
1538
|
+
source_default.gray(
|
|
1539
|
+
`Run ${source_default.white("npx mcp-use login")} to re-authenticate.
|
|
1540
|
+
`
|
|
1541
|
+
)
|
|
1542
|
+
);
|
|
1543
|
+
process.exit(1);
|
|
1544
|
+
}
|
|
1545
|
+
console.error(
|
|
1546
|
+
source_default.red.bold(`
|
|
1547
|
+
\u2717 ${context}:`),
|
|
1548
|
+
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
1549
|
+
);
|
|
1550
|
+
process.exit(1);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1531
1553
|
// src/commands/auth.ts
|
|
1532
1554
|
var DEVICE_CLIENT_ID = "mcp-use-cli";
|
|
1533
1555
|
var DEVICE_POLL_TIMEOUT = 18e5;
|
|
@@ -1656,14 +1678,32 @@ async function loginCommand(options) {
|
|
|
1656
1678
|
return;
|
|
1657
1679
|
}
|
|
1658
1680
|
if (await isLoggedIn()) {
|
|
1681
|
+
let needsReauth = false;
|
|
1682
|
+
try {
|
|
1683
|
+
await (await McpUseAPI.create()).testAuth();
|
|
1684
|
+
} catch (e) {
|
|
1685
|
+
if (e instanceof ApiUnauthorizedError) {
|
|
1686
|
+
needsReauth = true;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
if (!needsReauth) {
|
|
1690
|
+
if (!options?.silent) {
|
|
1691
|
+
console.log(
|
|
1692
|
+
source_default.yellow(
|
|
1693
|
+
"You are already logged in. Run 'npx mcp-use logout' first if you want to login with a different account."
|
|
1694
|
+
)
|
|
1695
|
+
);
|
|
1696
|
+
}
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1659
1699
|
if (!options?.silent) {
|
|
1660
1700
|
console.log(
|
|
1661
1701
|
source_default.yellow(
|
|
1662
|
-
"
|
|
1702
|
+
"\u26A0\uFE0F Stored credentials are invalid or expired. Re-authenticating..."
|
|
1663
1703
|
)
|
|
1664
1704
|
);
|
|
1665
1705
|
}
|
|
1666
|
-
|
|
1706
|
+
await deleteConfig();
|
|
1667
1707
|
}
|
|
1668
1708
|
console.log(source_default.cyan.bold("Logging in to mcp-use cloud...\n"));
|
|
1669
1709
|
const authBaseUrl = await getAuthBaseUrl();
|
|
@@ -1830,21 +1870,7 @@ async function whoamiCommand() {
|
|
|
1830
1870
|
}
|
|
1831
1871
|
}
|
|
1832
1872
|
} catch (error) {
|
|
1833
|
-
|
|
1834
|
-
console.error(
|
|
1835
|
-
source_default.red("\nYour session has expired or your API key is invalid.")
|
|
1836
|
-
);
|
|
1837
|
-
console.log(
|
|
1838
|
-
source_default.gray(`Run ${source_default.white("mcp-use login")} to re-authenticate.
|
|
1839
|
-
`)
|
|
1840
|
-
);
|
|
1841
|
-
} else {
|
|
1842
|
-
console.error(
|
|
1843
|
-
source_default.red.bold("\n\u2717 Failed to get user info:"),
|
|
1844
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
1845
|
-
);
|
|
1846
|
-
}
|
|
1847
|
-
process.exit(1);
|
|
1873
|
+
handleCommandError(error, "Failed to get user info");
|
|
1848
1874
|
}
|
|
1849
1875
|
}
|
|
1850
1876
|
|
|
@@ -4313,11 +4339,7 @@ async function listDeploymentsCommand() {
|
|
|
4313
4339
|
}
|
|
4314
4340
|
console.log();
|
|
4315
4341
|
} catch (error) {
|
|
4316
|
-
|
|
4317
|
-
source_default.red.bold("\n\u2717 Failed to list deployments:"),
|
|
4318
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4319
|
-
);
|
|
4320
|
-
process.exit(1);
|
|
4342
|
+
handleCommandError(error, "Failed to list deployments");
|
|
4321
4343
|
}
|
|
4322
4344
|
}
|
|
4323
4345
|
async function getDeploymentCommand(deploymentId) {
|
|
@@ -4379,11 +4401,7 @@ async function getDeploymentCommand(deploymentId) {
|
|
|
4379
4401
|
}
|
|
4380
4402
|
console.log();
|
|
4381
4403
|
} catch (error) {
|
|
4382
|
-
|
|
4383
|
-
source_default.red.bold("\n\u2717 Failed to get deployment:"),
|
|
4384
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4385
|
-
);
|
|
4386
|
-
process.exit(1);
|
|
4404
|
+
handleCommandError(error, "Failed to get deployment");
|
|
4387
4405
|
}
|
|
4388
4406
|
}
|
|
4389
4407
|
async function restartDeploymentCommand(deploymentId, options) {
|
|
@@ -4454,11 +4472,7 @@ async function restartDeploymentCommand(deploymentId, options) {
|
|
|
4454
4472
|
}
|
|
4455
4473
|
console.log();
|
|
4456
4474
|
} catch (error) {
|
|
4457
|
-
|
|
4458
|
-
source_default.red.bold("\n\u2717 Failed to restart deployment:"),
|
|
4459
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4460
|
-
);
|
|
4461
|
-
process.exit(1);
|
|
4475
|
+
handleCommandError(error, "Failed to restart deployment");
|
|
4462
4476
|
}
|
|
4463
4477
|
}
|
|
4464
4478
|
async function deleteDeploymentCommand(deploymentId, options) {
|
|
@@ -4501,11 +4515,7 @@ async function deleteDeploymentCommand(deploymentId, options) {
|
|
|
4501
4515
|
`)
|
|
4502
4516
|
);
|
|
4503
4517
|
} catch (error) {
|
|
4504
|
-
|
|
4505
|
-
source_default.red.bold("\n\u2717 Failed to delete deployment:"),
|
|
4506
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4507
|
-
);
|
|
4508
|
-
process.exit(1);
|
|
4518
|
+
handleCommandError(error, "Failed to delete deployment");
|
|
4509
4519
|
}
|
|
4510
4520
|
}
|
|
4511
4521
|
async function logsCommand(deploymentId, options) {
|
|
@@ -4594,11 +4604,7 @@ async function logsCommand(deploymentId, options) {
|
|
|
4594
4604
|
}
|
|
4595
4605
|
console.log();
|
|
4596
4606
|
} catch (error) {
|
|
4597
|
-
|
|
4598
|
-
source_default.red.bold("\n\u2717 Failed to get logs:"),
|
|
4599
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4600
|
-
);
|
|
4601
|
-
process.exit(1);
|
|
4607
|
+
handleCommandError(error, "Failed to get logs");
|
|
4602
4608
|
}
|
|
4603
4609
|
}
|
|
4604
4610
|
async function stopDeploymentCommand(deploymentId) {
|
|
@@ -4618,11 +4624,7 @@ async function stopDeploymentCommand(deploymentId) {
|
|
|
4618
4624
|
\u2713 Deployment stopped
|
|
4619
4625
|
`));
|
|
4620
4626
|
} catch (error) {
|
|
4621
|
-
|
|
4622
|
-
source_default.red.bold("\n\u2717 Failed to stop deployment:"),
|
|
4623
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4624
|
-
);
|
|
4625
|
-
process.exit(1);
|
|
4627
|
+
handleCommandError(error, "Failed to stop deployment");
|
|
4626
4628
|
}
|
|
4627
4629
|
}
|
|
4628
4630
|
async function startDeploymentCommand(deploymentId) {
|
|
@@ -4642,11 +4644,7 @@ async function startDeploymentCommand(deploymentId) {
|
|
|
4642
4644
|
)
|
|
4643
4645
|
);
|
|
4644
4646
|
} catch (error) {
|
|
4645
|
-
|
|
4646
|
-
source_default.red.bold("\n\u2717 Failed to start deployment:"),
|
|
4647
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4648
|
-
);
|
|
4649
|
-
process.exit(1);
|
|
4647
|
+
handleCommandError(error, "Failed to start deployment");
|
|
4650
4648
|
}
|
|
4651
4649
|
}
|
|
4652
4650
|
function createDeploymentsCommand() {
|
|
@@ -4715,87 +4713,103 @@ async function requireLogin() {
|
|
|
4715
4713
|
}
|
|
4716
4714
|
}
|
|
4717
4715
|
async function listEnvCommand(options) {
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4716
|
+
try {
|
|
4717
|
+
await requireLogin();
|
|
4718
|
+
const api = await McpUseAPI.create();
|
|
4719
|
+
const vars = await api.listEnvVariables(options.server);
|
|
4720
|
+
if (vars.length === 0) {
|
|
4721
|
+
console.log(
|
|
4722
|
+
source_default.yellow("\nNo environment variables set for this server.\n")
|
|
4723
|
+
);
|
|
4724
|
+
return;
|
|
4725
|
+
}
|
|
4726
|
+
console.log(source_default.cyan.bold(`
|
|
4728
4727
|
Environment Variables (${vars.length})
|
|
4729
4728
|
`));
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4729
|
+
for (const v of vars) {
|
|
4730
|
+
printEnvVar(v, options.showValues);
|
|
4731
|
+
console.log();
|
|
4732
|
+
}
|
|
4733
|
+
} catch (error) {
|
|
4734
|
+
handleCommandError(error, "Failed to list environment variables");
|
|
4733
4735
|
}
|
|
4734
4736
|
}
|
|
4735
4737
|
async function addEnvCommand(assignment, options) {
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4738
|
+
try {
|
|
4739
|
+
await requireLogin();
|
|
4740
|
+
const eqIdx = assignment.indexOf("=");
|
|
4741
|
+
if (eqIdx === -1) {
|
|
4742
|
+
console.error(
|
|
4743
|
+
source_default.red(
|
|
4744
|
+
"\u2717 Expected KEY=VALUE format, e.g. mcp-use servers env add API_KEY=abc123"
|
|
4745
|
+
)
|
|
4746
|
+
);
|
|
4747
|
+
process.exit(1);
|
|
4748
|
+
}
|
|
4749
|
+
const key = assignment.substring(0, eqIdx).trim();
|
|
4750
|
+
const value = assignment.substring(eqIdx + 1);
|
|
4751
|
+
if (!key) {
|
|
4752
|
+
console.error(source_default.red("\u2717 Key must not be empty."));
|
|
4753
|
+
process.exit(1);
|
|
4754
|
+
}
|
|
4755
|
+
const environments = options.env ? parseEnvironments(options.env) : ALL_ENVS;
|
|
4756
|
+
const api = await McpUseAPI.create();
|
|
4757
|
+
const created = await api.createEnvVariable(options.server, {
|
|
4758
|
+
key,
|
|
4759
|
+
value,
|
|
4760
|
+
environments,
|
|
4761
|
+
sensitive: options.sensitive ?? false
|
|
4762
|
+
});
|
|
4763
|
+
console.log(
|
|
4764
|
+
source_default.green(`
|
|
4762
4765
|
\u2713 Environment variable "${created.key}" added.
|
|
4763
4766
|
`)
|
|
4764
|
-
);
|
|
4765
|
-
printEnvVar(created, true);
|
|
4766
|
-
console.log();
|
|
4767
|
-
}
|
|
4768
|
-
async function updateEnvCommand(varId, options) {
|
|
4769
|
-
await requireLogin();
|
|
4770
|
-
if (!options.value && !options.env && options.sensitive === void 0) {
|
|
4771
|
-
console.error(
|
|
4772
|
-
source_default.red(
|
|
4773
|
-
"\u2717 Nothing to update. Provide at least one of --value, --env, --sensitive."
|
|
4774
|
-
)
|
|
4775
4767
|
);
|
|
4776
|
-
|
|
4768
|
+
printEnvVar(created, true);
|
|
4769
|
+
console.log();
|
|
4770
|
+
} catch (error) {
|
|
4771
|
+
handleCommandError(error, "Failed to add environment variable");
|
|
4777
4772
|
}
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4773
|
+
}
|
|
4774
|
+
async function updateEnvCommand(varId, options) {
|
|
4775
|
+
try {
|
|
4776
|
+
await requireLogin();
|
|
4777
|
+
if (!options.value && !options.env && options.sensitive === void 0) {
|
|
4778
|
+
console.error(
|
|
4779
|
+
source_default.red(
|
|
4780
|
+
"\u2717 Nothing to update. Provide at least one of --value, --env, --sensitive."
|
|
4781
|
+
)
|
|
4782
|
+
);
|
|
4783
|
+
process.exit(1);
|
|
4784
|
+
}
|
|
4785
|
+
const body = {};
|
|
4786
|
+
if (options.value !== void 0) body.value = options.value;
|
|
4787
|
+
if (options.env) body.environments = parseEnvironments(options.env);
|
|
4788
|
+
if (options.sensitive !== void 0) body.sensitive = options.sensitive;
|
|
4789
|
+
const api = await McpUseAPI.create();
|
|
4790
|
+
const updated = await api.updateEnvVariable(options.server, varId, body);
|
|
4791
|
+
console.log(
|
|
4792
|
+
source_default.green(`
|
|
4786
4793
|
\u2713 Environment variable "${updated.key}" updated.
|
|
4787
4794
|
`)
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4795
|
+
);
|
|
4796
|
+
printEnvVar(updated, !!options.value);
|
|
4797
|
+
console.log();
|
|
4798
|
+
} catch (error) {
|
|
4799
|
+
handleCommandError(error, "Failed to update environment variable");
|
|
4800
|
+
}
|
|
4791
4801
|
}
|
|
4792
4802
|
async function removeEnvCommand(varId, options) {
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4803
|
+
try {
|
|
4804
|
+
await requireLogin();
|
|
4805
|
+
const api = await McpUseAPI.create();
|
|
4806
|
+
await api.deleteEnvVariable(options.server, varId);
|
|
4807
|
+
console.log(source_default.green(`
|
|
4797
4808
|
\u2713 Environment variable ${varId} removed.
|
|
4798
4809
|
`));
|
|
4810
|
+
} catch (error) {
|
|
4811
|
+
handleCommandError(error, "Failed to remove environment variable");
|
|
4812
|
+
}
|
|
4799
4813
|
}
|
|
4800
4814
|
function createEnvCommand() {
|
|
4801
4815
|
const envCommand = new import_commander3.Command("env").description(
|
|
@@ -4925,11 +4939,7 @@ async function listServersCommand(options) {
|
|
|
4925
4939
|
}
|
|
4926
4940
|
console.log();
|
|
4927
4941
|
} catch (error) {
|
|
4928
|
-
|
|
4929
|
-
source_default.red.bold("\n\u2717 Failed to list servers:"),
|
|
4930
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
4931
|
-
);
|
|
4932
|
-
process.exit(1);
|
|
4942
|
+
handleCommandError(error, "Failed to list servers");
|
|
4933
4943
|
}
|
|
4934
4944
|
}
|
|
4935
4945
|
async function getServerCommand(idOrSlug, options) {
|
|
@@ -5029,11 +5039,7 @@ async function getServerCommand(idOrSlug, options) {
|
|
|
5029
5039
|
}
|
|
5030
5040
|
console.log();
|
|
5031
5041
|
} catch (error) {
|
|
5032
|
-
|
|
5033
|
-
source_default.red.bold("\n\u2717 Failed to get server:"),
|
|
5034
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
5035
|
-
);
|
|
5036
|
-
process.exit(1);
|
|
5042
|
+
handleCommandError(error, "Failed to get server");
|
|
5037
5043
|
}
|
|
5038
5044
|
}
|
|
5039
5045
|
async function deleteServerCommand(serverId, options) {
|
|
@@ -5086,11 +5092,7 @@ async function deleteServerCommand(serverId, options) {
|
|
|
5086
5092
|
)
|
|
5087
5093
|
);
|
|
5088
5094
|
} catch (error) {
|
|
5089
|
-
|
|
5090
|
-
source_default.red.bold("\n\u2717 Failed to delete server:"),
|
|
5091
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
5092
|
-
);
|
|
5093
|
-
process.exit(1);
|
|
5095
|
+
handleCommandError(error, "Failed to delete server");
|
|
5094
5096
|
}
|
|
5095
5097
|
}
|
|
5096
5098
|
function createServersCommand() {
|
|
@@ -5142,11 +5144,7 @@ async function orgListCommand() {
|
|
|
5142
5144
|
);
|
|
5143
5145
|
}
|
|
5144
5146
|
} catch (error) {
|
|
5145
|
-
|
|
5146
|
-
source_default.red.bold("\n\u2717 Failed to list organizations:"),
|
|
5147
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
5148
|
-
);
|
|
5149
|
-
process.exit(1);
|
|
5147
|
+
handleCommandError(error, "Failed to list organizations");
|
|
5150
5148
|
}
|
|
5151
5149
|
}
|
|
5152
5150
|
async function orgSwitchCommand() {
|
|
@@ -5191,11 +5189,7 @@ async function orgSwitchCommand() {
|
|
|
5191
5189
|
source_default.green.bold("\n\u2713 Switched to ") + source_default.cyan.bold(selected.name) + slug
|
|
5192
5190
|
);
|
|
5193
5191
|
} catch (error) {
|
|
5194
|
-
|
|
5195
|
-
source_default.red.bold("\n\u2717 Failed to switch organization:"),
|
|
5196
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
5197
|
-
);
|
|
5198
|
-
process.exit(1);
|
|
5192
|
+
handleCommandError(error, "Failed to switch organization");
|
|
5199
5193
|
}
|
|
5200
5194
|
}
|
|
5201
5195
|
async function orgCurrentCommand() {
|
|
@@ -5215,11 +5209,7 @@ async function orgCurrentCommand() {
|
|
|
5215
5209
|
source_default.cyan.bold("\u{1F3E2} Active organization: ") + source_default.white(config.orgName || config.orgId) + slug
|
|
5216
5210
|
);
|
|
5217
5211
|
} catch (error) {
|
|
5218
|
-
|
|
5219
|
-
source_default.red.bold("\n\u2717 Failed to get organization:"),
|
|
5220
|
-
source_default.red(error instanceof Error ? error.message : "Unknown error")
|
|
5221
|
-
);
|
|
5222
|
-
process.exit(1);
|
|
5212
|
+
handleCommandError(error, "Failed to get organization");
|
|
5223
5213
|
}
|
|
5224
5214
|
}
|
|
5225
5215
|
|