@rayul/kordis 0.1.6 → 0.1.7

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 +17 -4
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -965,6 +965,7 @@ import { Command as Command12 } from "commander";
965
965
 
966
966
  // src/commands/login.ts
967
967
  import { Command } from "commander";
968
+ import open from "open";
968
969
 
969
970
  // src/client.ts
970
971
  init_src2();
@@ -1150,7 +1151,7 @@ var c = kleur;
1150
1151
 
1151
1152
  // src/commands/login.ts
1152
1153
  function loginCommand() {
1153
- return new Command("login").description("authenticate with the Kordis registry").option("--provider <name>", "OAuth provider", "discord").action(async (opts) => {
1154
+ return new Command("login").description("authenticate with the Kordis registry").option("--provider <name>", "OAuth provider", "discord").option("--no-browser", "don't auto-open the browser; print the URL instead").action(async (opts) => {
1154
1155
  const bundle = await useClient();
1155
1156
  const started = spinner("Requesting device code");
1156
1157
  const device = await bundle.api.startDeviceFlow(
@@ -1158,11 +1159,23 @@ function loginCommand() {
1158
1159
  );
1159
1160
  started.succeed();
1160
1161
  printHuman("");
1161
- printHuman(c.bold("To continue, open this URL in a browser:"));
1162
- printHuman(" " + c.cyan(device.verification_url));
1163
- printHuman(c.bold("And confirm the code:"));
1162
+ printHuman(c.bold("Confirm the code in your browser:"));
1164
1163
  printHuman(" " + c.yellow(device.user_code));
1165
1164
  printHuman("");
1165
+ printHuman(c.gray("Verification URL:"));
1166
+ printHuman(" " + c.cyan(device.verification_url));
1167
+ printHuman("");
1168
+ if (opts.browser !== false) {
1169
+ try {
1170
+ await open(device.verification_url);
1171
+ printHuman(c.gray("Opened in your default browser."));
1172
+ } catch {
1173
+ printHuman(
1174
+ c.gray("Couldn't open the browser automatically \u2014 paste the URL above manually.")
1175
+ );
1176
+ }
1177
+ printHuman("");
1178
+ }
1166
1179
  const poll = spinner("Waiting for browser confirmation");
1167
1180
  const start = Date.now();
1168
1181
  const deadline = start + device.expires_in * 1e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayul/kordis",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "description": "Command-line client for the Kordis registry — discover, install, and publish agentic-coding packages.",
6
6
  "license": "MIT",
@@ -26,6 +26,7 @@
26
26
  "@iarna/toml": "^2.2.5",
27
27
  "commander": "^12.1.0",
28
28
  "kleur": "^4.1.5",
29
+ "open": "^10.1.0",
29
30
  "ora": "^8.1.1",
30
31
  "prompts": "^2.4.2",
31
32
  "yaml": "^2.6.0",