@topolo/cli 0.4.1 → 0.4.2

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.js +9 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3970,7 +3970,7 @@ var CLI_VERSION = readCliVersion();
3970
3970
  // src/commands/auth.ts
3971
3971
  function registerAuthCommands(program2) {
3972
3972
  const auth = program2.command("auth").description("Manage Topolo credentials");
3973
- auth.command("login").description("Authenticate with Topolo via OAuth device flow (default) or store an API key").option("--api-key <key>", "Store an API key directly, skipping the OAuth flow").option("--client-id <id>", "OAuth client_id (or set TOPOLO_CLI_CLIENT_ID)").option("--scope <scope>", "Scopes to request (space-separated)").option("--json", "Output JSON").option("--no-json", "Output human-readable text").action(
3973
+ auth.command("login").description("Authenticate with Topolo via OAuth device flow (default) or store an API key").option("--api-key <key>", "Store an API key directly, skipping the OAuth flow").option("--client-id <id>", "OAuth client_id (or set TOPOLO_CLI_CLIENT_ID)").option("--scope <scope>", "Scopes to request (space-separated)").option("--no-browser", "Print the approval URL without opening a browser").option("--json", "Output JSON").option("--no-json", "Output human-readable text").action(
3974
3974
  async (opts) => {
3975
3975
  const mode = resolveOutputMode(opts.json);
3976
3976
  const environment = selectedEnvironment();
@@ -3999,7 +3999,13 @@ Visit ${apiKeyIssuanceUrl(environment)} to mint one, or configure an OAuth clien
3999
3999
  await storeApiKey(apiKey, environment, mode);
4000
4000
  return;
4001
4001
  }
4002
- await runDeviceFlow({ clientId, environment, scope: opts.scope, mode });
4002
+ await runDeviceFlow({
4003
+ clientId,
4004
+ environment,
4005
+ scope: opts.scope,
4006
+ mode,
4007
+ openBrowser: opts.browser !== false
4008
+ });
4003
4009
  } catch (err) {
4004
4010
  fail(err, mode);
4005
4011
  }
@@ -4073,7 +4079,7 @@ async function runDeviceFlow(options) {
4073
4079
  });
4074
4080
  const verifyUrl = start.verification_uri_complete ?? start.verification_uri;
4075
4081
  const expiresMin = Math.round(start.expires_in / 60);
4076
- const opened = options.mode === "pretty" ? tryOpenBrowser(verifyUrl) : false;
4082
+ const opened = options.mode === "pretty" && options.openBrowser ? tryOpenBrowser(verifyUrl) : false;
4077
4083
  if (options.mode === "pretty") {
4078
4084
  process.stderr.write(
4079
4085
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
5
5
  "type": "module",
6
6
  "bin": {