@kutrion/cli 1.2.3 → 1.2.4

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 +24 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36619,7 +36619,7 @@ var ROLES = ["OWNER", "ADMIN", "EDITOR", "VIEWER"];
36619
36619
  var TOKEN_SCOPES = ["scim", "events"];
36620
36620
  var ORG_ROLES = ["owner", "admin", "member"];
36621
36621
  var ROTATION_SERVICES = ["linux_password", "postgres_password", "mysql_password"];
36622
- var VERSION = true ? "1.2.3" : "dev";
36622
+ var VERSION = true ? "1.2.4" : "dev";
36623
36623
  var HELP = `kt \u2014 Kutrion CLI
36624
36624
  kt login [--email <e>] [--password-stdin] [--code <2fa>] prompts for the password, or reads it from stdin;
36625
36625
  at a terminal with no --email, first asks the Kutrion desktop app,
@@ -37178,27 +37178,29 @@ run \`kt --help\` for the flags each command takes`);
37178
37178
  if (viaBrowser) {
37179
37179
  if (await browserSignIn()) break;
37180
37180
  }
37181
- if (process.platform !== "win32" && process.stdin.isTTY && flags.email === void 0 && !fromStdin && flags.code === void 0 && accountRoot) {
37182
- const hub = await hubLogin({
37183
- base: cfg.base,
37184
- location: hubLocation(accountRoot),
37185
- kc,
37186
- keychainAvailable: osKeychainAvailable,
37187
- call: hubCall,
37188
- out: (l) => console.error(l),
37189
- ask: (q) => promptLine(q)
37190
- });
37191
- if (hub.kind === "store_failed") die(hub.note);
37192
- if (hub.kind === "signed_in") {
37193
- recordSignIn(accountRoot, hub.user);
37194
- console.log(`logged in with the Kutrion app${hub.user ? ` as ${printable(hub.user.email)}` : ""} (token stored in ${backendName()})`);
37195
- if (rememberBase(cfg.base)) console.log(`server saved: ${cfg.base} (later commands need no --base)`);
37196
- break;
37181
+ if (process.stdin.isTTY && flags.email === void 0 && !fromStdin && flags.code === void 0) {
37182
+ if (!accountRoot) {
37183
+ if (await browserSignIn()) break;
37184
+ } else {
37185
+ const hub = await hubLogin({
37186
+ base: cfg.base,
37187
+ location: hubLocation(accountRoot),
37188
+ kc,
37189
+ keychainAvailable: osKeychainAvailable,
37190
+ call: hubCall,
37191
+ out: (l) => console.error(l),
37192
+ ask: (q) => promptLine(q)
37193
+ });
37194
+ if (hub.kind === "store_failed") die(hub.note);
37195
+ if (hub.kind === "signed_in") {
37196
+ recordSignIn(accountRoot, hub.user);
37197
+ console.log(`logged in with the Kutrion app${hub.user ? ` as ${printable(hub.user.email)}` : ""} (token stored in ${backendName()})`);
37198
+ if (rememberBase(cfg.base)) console.log(`server saved: ${cfg.base} (later commands need no --base)`);
37199
+ break;
37200
+ }
37201
+ if (hub.note) console.error(hub.note);
37202
+ if (hubAbsent(hub.reason) && await browserSignIn()) break;
37197
37203
  }
37198
- if (hub.note) console.error(hub.note);
37199
- if (hubAbsent(hub.reason) && await browserSignIn()) break;
37200
- } else if (process.platform === "win32" && process.stdin.isTTY && flags.email === void 0 && !fromStdin && flags.code === void 0) {
37201
- if (await browserSignIn()) break;
37202
37204
  }
37203
37205
  if (flags.email === void 0 && !fromStdin) {
37204
37206
  const hint = otherAppsHint(accountRoot);
@@ -37248,7 +37250,7 @@ run \`kt --help\` for the flags each command takes`);
37248
37250
  }
37249
37251
  case "logout":
37250
37252
  {
37251
- const root = process.platform !== "win32" ? appDataDir() : null;
37253
+ const root = appDataDir();
37252
37254
  await signOutBorrowed(cfg.base, kc, client, root ? hubLocation(root) : null);
37253
37255
  }
37254
37256
  clearToken(cfg.base);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kutrion/cli",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Kutrion command-line client — vaults, credentials and SSH/SFTP/RDP brokering from the terminal.",
5
5
  "type": "commonjs",
6
6
  "bin": {