feat(cli): persist startup defaults from XDG config - #2629
Open
joebasrawi wants to merge 1 commit into
Open
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Load chrome-devtools start options from $XDG_CONFIG_HOME/chrome-devtools/config.json (falling back to ~/.config/chrome-devtools/config.json) and apply them when a tool command auto-starts the daemon and when start is invoked without those flags. Explicit CLI options still take precedence. Fixes ChromeDevTools#2388 Co-authored-by: Joseph B <joebasrawi@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/persist-cli-defaults-4750
branch
from
August 29, 2026 14:30
31ec446 to
68ed4b9
Compare
joebasrawi
marked this pull request as ready for review
August 29, 2026 14:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The standalone
chrome-devtoolsCLI auto-starts its daemon when the first tool command runs, but that path had no way to reuse user-specific startup options (executablePath,headless,userDataDir, and otherstartflags). After a reboot, crash, orstop, the next command launched the daemon with built-in defaults.This adds an XDG-compatible config file:
falling back to
~/.config/chrome-devtools/config.json. For example:{ "executablePath": "/usr/bin/chromium", "headless": false }Precedence is:
The same file is applied to automatic daemon startup and to explicit
chrome-devtools startwhen an option is omitted. Config keys are validated with the existingstartoption parser (including coerce/conflict rules).chrome-devtools statuscontinues to report the effective daemon arguments.Fixes #2388
Design notes
Implemented against current
mainrather than resurrecting closed PR #2389.src/config/cli-config.tsnext to the current option modules.startsharegetCliStartOptions(),applyCliStartDefaults(), and yargs.config(), so CLI-specific defaults such asisolatedstay consistent.startoptions, and overlapping keys (for exampleviewportonemulate) could leak into the daemon. Persistent defaults belong in the config file; explicitchrome-devtools start --…still overrides them.chrome-devtools start.Testing
tests/cli-config.test.ts)list_pagesstartup uses config values andstatusshows themstartuses config when flags are omittedLocally:
npm run format,npx tsc --noEmit,npm run test tests/cli-config.test.ts, and the chrome-devtools start/commands e2e files.