@corigin/cli 0.1.2 → 0.1.3

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/main.js +9 -8
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1028,7 +1028,7 @@ function resolveGitCredentialRepo(input) {
1028
1028
  }
1029
1029
  function createCoriginProgram(deps = {}) {
1030
1030
  const program = addCliGlobalOptions(
1031
- new Command().name("corigin").description("Corigin command-line interface").version("0.1.2")
1031
+ new Command().name("corigin").description("Corigin command-line interface").version("0.1.3")
1032
1032
  );
1033
1033
  if (deps.exitOverride !== false) program.exitOverride();
1034
1034
  addCliGlobalOptions(program.command("login")).option("--no-open", "Print the verification URL without opening a browser").option(
@@ -1039,7 +1039,9 @@ function createCoriginProgram(deps = {}) {
1039
1039
  ).action(
1040
1040
  async (options, command) => runCommand("login", command, deps, () => login(command, options, deps))
1041
1041
  );
1042
- const repos = program.command("repos").description("Create, list, and delete hosted repos");
1042
+ const repos = addCliGlobalOptions(
1043
+ program.command("repos").description("Create, list, and delete hosted repos")
1044
+ );
1043
1045
  addCliGlobalOptions(repos.command("list")).action(
1044
1046
  async (_options, command) => runCommand("repos list", command, deps, () => reposList(command, deps))
1045
1047
  );
@@ -1049,9 +1051,8 @@ function createCoriginProgram(deps = {}) {
1049
1051
  addCliGlobalOptions(repos.command("delete")).requiredOption("--repo <repo-id>", "Repository id to delete").requiredOption("--yes", "Confirm deletion without an interactive prompt").action(
1050
1052
  async (options, command) => runCommand("repos delete", command, deps, () => reposDelete(command, options, deps))
1051
1053
  );
1052
- const gitToken = program.command("git-token").description("Mint scoped Git credentials for a repo");
1053
- addCliGlobalOptions(gitToken.command("create")).requiredOption("--repo <repo-id>", "Repository id for the Git token").requiredOption("--actor-subject <label>", "Runtime or sandbox actor label").requiredOption("--access <read|write>", "Git operation scope", parseGitAccess).option("--ttl-seconds <seconds>", "Requested token lifetime in seconds", parsePositiveInteger).action(
1054
- async (options, command) => runCommand("git-token create", command, deps, () => gitTokenCreate(command, options, deps))
1054
+ addCliGlobalOptions(repos.command("git-token").description("Mint scoped Git credentials")).requiredOption("--repo <repo-id>", "Repository id for the Git token").option("--actor-subject <label>", "Runtime or sandbox actor label", "cli").option("--access <read|write>", "Git operation scope", parseGitAccess, "write").option("--ttl-seconds <seconds>", "Requested token lifetime in seconds", parsePositiveInteger).action(
1055
+ async (options, command) => runCommand("repos git-token", command, deps, () => gitTokenCreate(command, options, deps))
1055
1056
  );
1056
1057
  const gitCredentials = program.command("git-credentials").description("Install and inspect the Git credential helper");
1057
1058
  addCliGlobalOptions(gitCredentials.command("install")).option("--git-host <host>", "Git remote host for credential-helper config", defaultGitHost).option("--scope <global|local>", "Git config scope", "global").option("--force", "Replace existing Corigin credential-helper config").action(
@@ -1219,7 +1220,7 @@ async function reposDelete(command, options, deps) {
1219
1220
  async function gitTokenCreate(command, options, deps) {
1220
1221
  const { credential, client: client2 } = await authenticatedRepoClient(command, deps);
1221
1222
  return apiData(
1222
- "git-token create",
1223
+ "repos git-token",
1223
1224
  credential,
1224
1225
  await createGitToken({
1225
1226
  client: client2,
@@ -1375,7 +1376,7 @@ function formatHumanSuccess(command, data) {
1375
1376
  if (value.repos.length === 0) return "No repos found.\n";
1376
1377
  return `${value.repos.map((repo) => {
1377
1378
  const repoValue = objectData(repo);
1378
- return `${stringField(repoValue, "name")} ${stringField(repoValue, "repo_id")} ${stringField(repoValue, "git_url")}`;
1379
+ return `${stringField(repoValue, "name")} ${stringField(repoValue, "repo_id")}`;
1379
1380
  }).join("\n")}
1380
1381
  `;
1381
1382
  }
@@ -1392,7 +1393,7 @@ Git URL: ${stringField(repo, "git_url")}
1392
1393
  Repo ID: ${stringField(repo, "repo_id")}
1393
1394
  `;
1394
1395
  }
1395
- if (command === "git-token create" && value) {
1396
+ if (command === "repos git-token" && value) {
1396
1397
  return `Git URL: ${stringField(value, "git_url")}
1397
1398
  Token: ${stringField(value, "token")}
1398
1399
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corigin/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "bin": {
5
5
  "corigin": "./dist/main.js"
6
6
  },