@shipd-ai/cli 0.1.1 → 0.1.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.
package/README.md CHANGED
@@ -16,7 +16,7 @@ Admin docs, the supported checks, and a copy-paste setup prompt for coding agent
16
16
 
17
17
  ```bash
18
18
  npm install -g @shipd-ai/cli
19
- shipd login # opens the quest's login page (olympus by default); or: shipd login --token <jwt>
19
+ shipd login # opens https://shipd.ai/cli-auth (one token for every quest); or: shipd login --token <jwt>
20
20
  shipd whoami
21
21
  shipd quests # which quests this CLI can talk to
22
22
  ```
@@ -110,6 +110,7 @@ check with `status`, `verdict`, `output`, `error`, `durationMs`, and `steps`
110
110
 
111
111
  | Variable | Effect |
112
112
  | --- | --- |
113
+ | `SHIPD_AUTH_URL` | Override the platform login page `shipd login` opens (default `https://shipd.ai/cli-auth`). |
113
114
  | `SHIPD_<QUEST>_URL` | Override the quest's base URL (for example `SHIPD_OLYMPUS_URL`). |
114
115
  | `SHIPD_<QUEST>_CONVEX_URL` | Skip `/api/cli/config` and talk to this Convex deployment. |
115
116
  | `SHIPD_HOME` | Credentials and caches directory (default `~/.shipd`). |
@@ -9,8 +9,7 @@ export declare const login: import("citty").CommandDef<{
9
9
  };
10
10
  readonly quest: {
11
11
  readonly type: "string";
12
- readonly description: "Quest whose login page to open (default: olympus)";
13
- readonly default: "olympus";
12
+ readonly description: "Open this quest's own login page instead of the platform page (the token works for every quest either way)";
14
13
  };
15
14
  }>;
16
15
  export declare const logout: import("citty").CommandDef<import("citty").ArgsDef>;
@@ -4,7 +4,7 @@ import { defineCommand } from "citty";
4
4
  import { clearCredentials, loadCredentials, saveCredentials } from "../auth.js";
5
5
  import { UsageError } from "../errors.js";
6
6
  import { printJson } from "../format.js";
7
- import { DEFAULT_QUEST, questAuthUrl } from "../quests.js";
7
+ import { platformAuthUrl, questAuthUrl } from "../quests.js";
8
8
  function openBrowser(url) {
9
9
  if (process.platform === "win32") {
10
10
  // `start` is a cmd.exe built-in, not a standalone executable.
@@ -27,8 +27,7 @@ function prompt(question) {
27
27
  const questArg = {
28
28
  quest: {
29
29
  type: "string",
30
- description: `Quest whose login page to open (default: ${DEFAULT_QUEST})`,
31
- default: DEFAULT_QUEST,
30
+ description: "Open this quest's own login page instead of the platform page (the token works for every quest either way)",
32
31
  },
33
32
  };
34
33
  export const login = defineCommand({
@@ -39,7 +38,7 @@ export const login = defineCommand({
39
38
  "no-browser": { type: "boolean", description: "Print the login URL instead of opening it" },
40
39
  },
41
40
  run: async ({ args }) => {
42
- const authUrl = questAuthUrl(args.quest);
41
+ const authUrl = args.quest ? questAuthUrl(args.quest) : platformAuthUrl();
43
42
  let token = args.token?.trim();
44
43
  if (!token) {
45
44
  if (args["no-browser"]) {
package/dist/quests.d.ts CHANGED
@@ -4,7 +4,9 @@ export declare const DEFAULT_QUEST = "olympus";
4
4
  export declare function knownQuests(): string[];
5
5
  /** `SHIPD_<QUEST>_URL` override, or NODE_ENV=development → localhost. */
6
6
  export declare function questBaseUrl(quest: string): string;
7
- /** The page that mints the CLI token for the browser login flow. */
7
+ /** `SHIPD_AUTH_URL` override, or NODE_ENV=development → localhost. */
8
+ export declare function platformAuthUrl(): string;
9
+ /** A quest's own copy of the token page (the platform page is the default). */
8
10
  export declare function questAuthUrl(quest: string): string;
9
11
  export interface QuestConfig {
10
12
  convexUrl: string;
package/dist/quests.js CHANGED
@@ -32,7 +32,21 @@ export function questBaseUrl(quest) {
32
32
  }
33
33
  return process.env.NODE_ENV === "development" ? entry.dev : entry.prod;
34
34
  }
35
- /** The page that mints the CLI token for the browser login flow. */
35
+ // The platform-level token page. The shipd-cli token works for every quest,
36
+ // so the browser login lands here; `questAuthUrl` stays for a quest's own
37
+ // copy of the page (`shipd login --quest <quest>`).
38
+ const PLATFORM_AUTH_URL = {
39
+ prod: "https://shipd.ai/cli-auth",
40
+ dev: "http://localhost:3010/cli-auth",
41
+ };
42
+ /** `SHIPD_AUTH_URL` override, or NODE_ENV=development → localhost. */
43
+ export function platformAuthUrl() {
44
+ const override = process.env.SHIPD_AUTH_URL;
45
+ if (override)
46
+ return override;
47
+ return process.env.NODE_ENV === "development" ? PLATFORM_AUTH_URL.dev : PLATFORM_AUTH_URL.prod;
48
+ }
49
+ /** A quest's own copy of the token page (the platform page is the default). */
36
50
  export function questAuthUrl(quest) {
37
51
  return `${questBaseUrl(quest)}/cli-auth`;
38
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipd-ai/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Shipd admin CLI — run quest checks on Harbor tasks or existing tasks",
5
5
  "type": "module",
6
6
  "homepage": "https://shipd.ai",