@controlvector/cv-agent 1.11.0 → 1.11.1

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/bundle.cjs CHANGED
@@ -6996,14 +6996,66 @@ function statusCommand() {
6996
6996
  return cmd;
6997
6997
  }
6998
6998
 
6999
+ // src/commands/orgs.ts
7000
+ init_source();
7001
+ async function listOrgs() {
7002
+ const creds = await readCredentials();
7003
+ if (!creds.CV_HUB_PAT) {
7004
+ console.log(source_default.red("Not authenticated.") + ` Run ${source_default.cyan("cva auth login")} first.`);
7005
+ process.exit(1);
7006
+ }
7007
+ if (!creds.CV_HUB_API) {
7008
+ creds.CV_HUB_API = "https://api.hub.controlvector.io";
7009
+ }
7010
+ try {
7011
+ const res = await apiCall(creds, "GET", "/api/v1/orgs/my/list");
7012
+ if (!res.ok) {
7013
+ console.log(source_default.red(`Error: ${res.status}`));
7014
+ process.exit(1);
7015
+ }
7016
+ const data = await res.json();
7017
+ const orgs = data.organizations || [];
7018
+ if (orgs.length === 0) {
7019
+ console.log(source_default.gray("You are not a member of any organizations."));
7020
+ return;
7021
+ }
7022
+ console.log();
7023
+ console.log(source_default.bold(` Your Organizations (${orgs.length})`));
7024
+ console.log();
7025
+ console.log(
7026
+ source_default.gray(" ") + "Slug".padEnd(24) + "Name".padEnd(24) + "ID"
7027
+ );
7028
+ console.log(source_default.gray(" " + "\u2500".repeat(72)));
7029
+ for (const org of orgs) {
7030
+ console.log(
7031
+ " " + source_default.cyan(org.slug.padEnd(24)) + org.name.padEnd(24) + source_default.gray(org.id)
7032
+ );
7033
+ }
7034
+ console.log();
7035
+ console.log(source_default.gray(" Use with: cva agent --org <slug>"));
7036
+ console.log(source_default.gray(" Or set: CV_HUB_ORG=<slug>"));
7037
+ console.log();
7038
+ } catch (err) {
7039
+ console.log(source_default.red(`Error: ${err.message}`));
7040
+ process.exit(1);
7041
+ }
7042
+ }
7043
+ function orgsCommand() {
7044
+ const cmd = new Command("orgs");
7045
+ cmd.description("Manage organizations");
7046
+ cmd.command("list").description("List organizations your account belongs to").action(listOrgs);
7047
+ return cmd;
7048
+ }
7049
+
6999
7050
  // src/index.ts
7000
7051
  var program2 = new Command();
7001
- program2.name("cva").description('CV-Hub Agent \u2014 bridges Claude Code with CV-Hub task dispatch.\n\nRun "cva setup" to get started.').version(true ? "1.11.0" : "1.6.0");
7052
+ program2.name("cva").description('CV-Hub Agent \u2014 bridges Claude Code with CV-Hub task dispatch.\n\nRun "cva setup" to get started.').version(true ? "1.11.1" : "1.6.0");
7002
7053
  program2.addCommand(setupCommand());
7003
7054
  program2.addCommand(agentCommand());
7004
7055
  program2.addCommand(authCommand());
7005
7056
  program2.addCommand(remoteCommand());
7006
7057
  program2.addCommand(taskCommand());
7007
7058
  program2.addCommand(statusCommand());
7059
+ program2.addCommand(orgsCommand());
7008
7060
  program2.parse(process.argv);
7009
7061
  //# sourceMappingURL=bundle.cjs.map