doordash-cli 0.4.0 → 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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,18 @@ All notable changes to `doordash-cli` will be documented in this file.
9
9
 
10
10
  See [docs/releasing.md](docs/releasing.md) for the maintainer release flow.
11
11
 
12
+ ## [0.4.2](https://github.com/LatencyTDH/doordash-cli/compare/v0.4.1...v0.4.2) (2026-04-10)
13
+
14
+ ### Bug Fixes
15
+
16
+ * import signed-in linux browser profile state for login reuse ([#40](https://github.com/LatencyTDH/doordash-cli/issues/40)) ([97feddc](https://github.com/LatencyTDH/doordash-cli/commit/97feddc68ce0ebc882737dfad69d5e908f20d250))
17
+
18
+ ## [0.4.1](https://github.com/LatencyTDH/doordash-cli/compare/v0.4.0...v0.4.1) (2026-04-10)
19
+
20
+ ### Bug Fixes
21
+
22
+ * bound auth-check and restore login completion flow ([#39](https://github.com/LatencyTDH/doordash-cli/issues/39)) ([5166944](https://github.com/LatencyTDH/doordash-cli/commit/51669444dc124e39ece719624c997ab9f46acd93))
23
+
12
24
  ## [0.4.0](https://github.com/LatencyTDH/doordash-cli/compare/v0.3.3...v0.4.0) (2026-04-10)
13
25
 
14
26
  ### Features
package/README.md CHANGED
@@ -9,7 +9,7 @@ It stops before checkout.
9
9
  ## Highlights
10
10
 
11
11
  - **Cart-safe by design** — browse, inspect existing orders, and manage a cart; no checkout, payment, or order mutation.
12
- - **Browser-first login** — `dd-cli login` reuses saved local auth or a discoverable signed-in browser session when possible, and otherwise opens a temporary login window.
12
+ - **Browser-first login** — `dd-cli login` reuses saved local auth, then same-machine Linux Brave/Chrome profile state, then attachable signed-in browser sessions when possible, and otherwise opens a temporary login window.
13
13
  - **Direct API first** — auth, discovery, existing-order, and cart commands use DoorDash consumer-web GraphQL/HTTP rather than DOM clicking.
14
14
  - **JSON-friendly** — every command prints structured output.
15
15
  - **Fail-closed** — unsupported commands, flags, or unsafe payload shapes are rejected.
@@ -70,13 +70,13 @@ If you are running from a checkout without `npm link`, replace `doordash-cli` wi
70
70
 
71
71
  ## Login and session reuse
72
72
 
73
- `login` reuses saved local auth when it is still valid. Otherwise it tries to import a discoverable signed-in browser session. If neither is available, it opens a temporary Chromium login window and saves the session there. If authentication still is not established, `login` exits non-zero.
73
+ `login` reuses saved local auth when it is still valid. Otherwise it first tries to import signed-in same-machine Linux Brave/Chrome profile state, then falls back to a discoverable attachable signed-in browser session, and finally opens a temporary Chromium login window it can watch directly. If authentication still is not established, `login` exits non-zero.
74
74
 
75
- `auth-check` reports whether the saved state appears logged in and can quietly import a discoverable signed-in browser session unless `logout` disabled that auto-reuse.
75
+ `auth-check` reports whether the saved state appears logged in and can quietly import same-machine Linux Brave/Chrome profile state or a discoverable attachable signed-in browser session unless `logout` disabled that auto-reuse.
76
76
 
77
- `logout` clears persisted cookies and stored browser state, then keeps automatic browser-session reuse disabled until you explicitly run `dd-cli login` again.
77
+ `logout` clears persisted cookies and stored browser state, then keeps passive browser-session reuse disabled until your next explicit `dd-cli login` attempt.
78
78
 
79
- If `login` opens a temporary Chromium window, finish signing in there and let the CLI save the session. If you expect reuse from another browser, make sure it exposes a compatible CDP endpoint, then rerun `dd-cli login`.
79
+ If `login` opens a temporary Chromium window, the CLI now keeps checking automatically and also tells you that you can press Enter to force an immediate recheck once the page already shows you are signed in. That restores the old effective manual-completion path without giving up automatic completion when it works. On Linux, a signed-in local Brave or Google Chrome profile on the same machine is the preferred browser-reuse path and does not need CDP/remote debugging. If that same-machine profile import is unavailable or not signed in, the next reuse path is an attachable browser automation session.
80
80
 
81
81
  ## Command surface
82
82
 
package/dist/cli.js CHANGED
@@ -42,10 +42,11 @@ export function usage() {
42
42
  " - Installed command names are lowercase only: dd-cli and doordash-cli.",
43
43
  " - install-browser downloads the bundled Playwright Chromium runtime used when the CLI needs a local browser.",
44
44
  " - Manual pages ship with the project: man dd-cli or man doordash-cli.",
45
- " - login reuses saved local auth when possible, otherwise imports a signed-in browser session or opens a temporary Chromium login window.",
45
+ " - login reuses saved local auth when possible, otherwise first tries same-machine Linux Brave/Chrome profile import, then attachable signed-in browser sessions, then a temporary Chromium login window.",
46
+ " - login auto-detects completion when it can; in the temporary-browser fallback you can also press Enter to force an immediate recheck once the page shows you are signed in.",
46
47
  " - login exits non-zero if authentication is still not established.",
47
- " - auth-check reports saved-session status and can quietly reuse/import a signed-in browser session unless logout disabled that auto-reuse.",
48
- " - logout clears saved session files and keeps automatic browser-session reuse off until the next login.",
48
+ " - auth-check reports saved-session status and can quietly reuse/import same-machine Linux Brave/Chrome profile state or an attachable signed-in browser session unless logout disabled that auto-reuse.",
49
+ " - logout clears saved session files and keeps passive browser-session reuse off until the next explicit login attempt.",
49
50
  " - configurable items require explicit --options-json selections.",
50
51
  " - unsupported option trees fail closed.",
51
52
  "",
package/dist/cli.test.js CHANGED
@@ -113,10 +113,11 @@ test("help output shows the direct read-only/cart-safe command surface", () => {
113
113
  assert.match(result.stdout, /options-json/);
114
114
  assert.match(result.stdout, /--version, -v/);
115
115
  assert.match(result.stdout, /man dd-cli/);
116
- assert.match(result.stdout, /login reuses saved local auth when possible, otherwise imports a signed-in browser session or opens a temporary Chromium login window\./);
116
+ assert.match(result.stdout, /login reuses saved local auth when possible, otherwise first tries same-machine Linux Brave\/Chrome profile import, then attachable signed-in browser sessions, then a temporary Chromium login window\./);
117
+ assert.match(result.stdout, /login auto-detects completion when it can; in the temporary-browser fallback you can also press Enter to force an immediate recheck once the page shows you are signed in\./);
117
118
  assert.match(result.stdout, /login exits non-zero if authentication is still not established\./);
118
- assert.match(result.stdout, /auth-check reports saved-session status and can quietly reuse\/import a signed-in browser session unless logout disabled that auto-reuse\./);
119
- assert.match(result.stdout, /logout clears saved session files and keeps automatic browser-session reuse off until the next login\./);
119
+ assert.match(result.stdout, /auth-check reports saved-session status and can quietly reuse\/import same-machine Linux Brave\/Chrome profile state or an attachable signed-in browser session unless logout disabled that auto-reuse\./);
120
+ assert.match(result.stdout, /logout clears saved session files and keeps passive browser-session reuse off until the next explicit login attempt\./);
120
121
  assert.match(result.stdout, /Out-of-scope commands remain intentionally unsupported/);
121
122
  assert.doesNotMatch(result.stdout, /auth-bootstrap/);
122
123
  assert.doesNotMatch(result.stdout, /auth-clear/);
@@ -130,8 +131,9 @@ test("repository ships man pages for the supported lowercase command names", ()
130
131
  assert.match(readFileSync(ddManPath, "utf8"), /\.B login/);
131
132
  assert.doesNotMatch(readFileSync(ddManPath, "utf8"), /auth-bootstrap/);
132
133
  assert.doesNotMatch(readFileSync(ddManPath, "utf8"), /auth-clear/);
133
- assert.match(readFileSync(ddManPath, "utf8"), /automatic\s+browser-session reuse stays disabled until the next explicit/i);
134
- assert.match(readFileSync(ddManPath, "utf8"), /temporary Chromium.*window/i);
134
+ assert.match(readFileSync(ddManPath, "utf8"), /passive\s+browser-session reuse stays disabled until the next explicit/i);
135
+ assert.match(readFileSync(ddManPath, "utf8"), /same-machine Linux Brave\/Chrome browser profile/i);
136
+ assert.match(readFileSync(ddManPath, "utf8"), /temporary\s+Chromium\s+window/i);
135
137
  assert.doesNotMatch(readFileSync(ddManPath, "utf8"), /Dd-cli/);
136
138
  assert.equal(readFileSync(aliasManPath, "utf8").trim(), ".so man1/dd-cli.1");
137
139
  });
@@ -24,6 +24,16 @@ export type AuthBootstrapResult = (AuthResult & {
24
24
  isLoggedIn: false;
25
25
  message: string;
26
26
  });
27
+ type ManagedBrowserLoginResult = {
28
+ status: "completed";
29
+ completion: "automatic" | "manual";
30
+ auth: AuthResult;
31
+ } | {
32
+ status: "timed-out";
33
+ auth: AuthResult;
34
+ } | {
35
+ status: "launch-failed";
36
+ };
27
37
  export type SearchRestaurantResult = {
28
38
  id: string;
29
39
  name: string;
@@ -469,6 +479,7 @@ type BootstrapAuthSessionDeps = {
469
479
  markBrowserImportAttempted: () => void;
470
480
  getAttachedBrowserCdpCandidates: () => Promise<string[]>;
471
481
  getReachableCdpCandidates: (candidates: string[]) => Promise<string[]>;
482
+ describeDesktopBrowserReuseGap: () => Promise<string | null>;
472
483
  openUrlInAttachedBrowser: (input: {
473
484
  cdpUrl: string;
474
485
  targetUrl: string;
@@ -482,7 +493,9 @@ type BootstrapAuthSessionDeps = {
482
493
  targetUrl: string;
483
494
  timeoutMs: number;
484
495
  pollIntervalMs: number;
485
- }) => Promise<AuthResult | null>;
496
+ log: (message: string) => void;
497
+ }) => Promise<ManagedBrowserLoginResult>;
498
+ canPromptForManagedBrowserConfirmation: () => boolean;
486
499
  checkAuthDirect: () => Promise<AuthResult>;
487
500
  log: (message: string) => void;
488
501
  };
@@ -557,11 +570,17 @@ export declare function selectAttachedBrowserImportMode(input: {
557
570
  pageUrls: readonly string[];
558
571
  cookies: ReadonlyArray<Pick<Cookie, "domain">>;
559
572
  }): "page" | "cookies" | "skip";
573
+ export type BrowserSessionImportStrategy = "local-linux-chromium-profile" | "attached-browser-cdp";
574
+ export declare function preferredBrowserSessionImportStrategies(platform: NodeJS.Platform): readonly BrowserSessionImportStrategy[];
560
575
  export declare function resolveAttachedBrowserCdpCandidates(env: NodeJS.ProcessEnv, configCandidates?: string[]): string[];
561
576
  export declare function resolveSystemBrowserOpenCommand(targetUrl: string, targetPlatform?: NodeJS.Platform): {
562
577
  command: string;
563
578
  args: string[];
564
579
  } | null;
580
+ export declare function summarizeDesktopBrowserReuseGap(input: {
581
+ processCommands: readonly string[];
582
+ hasAnyDevToolsActivePort: boolean;
583
+ }): string | null;
565
584
  export declare function parseSearchRestaurants(body: unknown[]): SearchRestaurantResult[];
566
585
  export declare function parseSearchRestaurantRow(entry: unknown): SearchRestaurantResult | null;
567
586
  export declare function parseExistingOrderLifecycleStatus(orderRoot: unknown): ExistingOrderLifecycleStatus;