Skip to main content
Read and write the extension’s chrome.storage areas from the terminal. storage talks to a running dev session and runs the storage call inside the extension itself, so you see exactly what your code sees. No DevTools, no temporary console.log. The session must run with the control channel unlocked: start it with extension dev --allow-control. A refusal names the missing flag.

When to use storage

  • You want to check what your extension persisted without wiring up a debug UI.
  • A test or agent needs to seed storage state before exercising a flow.
  • You want to flip a stored feature flag in a live session and watch the effect.

Usage

Read the whole local area, then one key, then write a value:

Arguments and flags

How values are parsed

--value is parsed as JSON, so '{"theme": "dark"}', '42', and 'true' arrive typed. Input that is not valid JSON falls back to a raw string, so --value hello stores the string "hello" without extra quoting. set requires both --key and --value. Leaving either out fails with E_ARGS before any connection is made. Any action other than get or set fails the same way.

Failure modes

  • No session for the browser: E_SESSION_NOT_FOUND, with the exact extension dev --allow-control command to run.
  • Session running without --allow-control: the connection is refused and the error names the flag.
  • The storage call threw inside the extension (for example, writing to the read-only managed area): E_STORAGE.
  • The call outlived --timeout: E_TIMEOUT.
The exit code is 0 on success and 1 on any failure. Machine consumers should read the envelope from --output json (see Result envelope).

Next steps

  • Run arbitrary expressions in the same session with eval.
  • Restart the background worker after seeding state with reload.
  • Diagnose a session that refuses the call with doctor.
  • Read the wider debugging workflow in Debugging.