Wrangler State Viewer
Browse local Cloudflare Wrangler state without leaving VS Code.
Wrangler State Viewer finds .wrangler/state/v* folders in your workspace and presents KV, R2, D1, Durable Objects, Cache, Workflows, Queues, and other local state in one read-only view.
This is particularly useful for inspecting the state of nested workers in monorepos.
Features
- Whole-state overview — see every detected service, resource, item count, and stored size from the Wrangler State activity-bar view.
- Logical KV, Cache, and R2 objects — Miniflare SQLite metadata replaces hashed blob filenames with their real keys, content types, expiration times, upload times, ETags, and custom metadata. Multipart R2 objects are assembled in part order for preview, open, and save-copy actions.
- Blob previews — inspect images, formatted JSON, text, HTML, gzip-compressed text, and bounded hexadecimal previews for other binary content.
- SQLite hand-off — D1, Durable Object, Workflow, and other SQLite-backed state is listed but not claimed by this extension. Choose Open to use your configured SQLite editor, including Database Editor if installed.
- Useful file actions — open a state file, reveal it in Finder/Explorer, or save a copy under a readable filename.
- Automatic discovery and refresh — nested workers in monorepos are supported, and state changes trigger a debounced rescan.
- Read-only by design — the viewer never changes Wrangler state. Only the explicit Save copy action writes a new file selected by you, and destinations inside active state roots are rejected.
Use
- Open a project that has been run with
wrangler dev, or any workspace containing .wrangler/state.
- Select the Wrangler State cloud icon in the Activity Bar.
- Choose a detected state folder from the top selector.
- Filter by service or resource, search by key, and select an item to preview it.
You can also run these commands from the Command Palette:
- Wrangler State: Open Wrangler State Viewer
- Wrangler State: Refresh Wrangler State
- Wrangler State: Open Wrangler State Folder…
The folder command accepts a project folder, .wrangler folder, state folder, or a version folder such as v3.
Preview limits
wranglerStateViewer.maxPreviewBytes controls how many uncompressed bytes are loaded for text, JSON, and hexadecimal previews. It defaults to 1 MB and can be set between 1 KB and 10 MB. Single-part images are loaded directly from the local state folder. Multipart objects are assembled only when needed into extension storage, never into Wrangler state.
Miniflare metadata databases larger than 64 MB are skipped with a warning to protect the extension host from excessive memory use.
Wrangler and Miniflare compatibility
The extension recognizes versioned Wrangler state roots and understands the current Miniflare v3 layouts used for KV, Cache, R2, D1, Durable Objects, and Workflows.
Miniflare storage is an internal implementation detail and can change between Wrangler versions. Unknown files remain visible in the Other or corresponding service inventory rather than being discarded.
If a metadata database has a non-empty SQLite WAL sidecar, the viewer shows a warning. The main database remains a valid snapshot, but very recent keys or objects may not appear until Wrangler checkpoints the WAL. The extension does not merge or modify live WAL state.
Privacy and workspace trust
All scanning and previews happen locally in the VS Code extension host and webview. State content is not transmitted to a service. The extension supports untrusted workspaces because it only reads files and does not execute workspace code or shell commands. Virtual workspaces are not supported because Wrangler state is local filesystem data.
Development
pnpm install
pnpm run vendor:sqljs
pnpm test
pnpm run validate:local
Full local preview while debugging
The repository includes the same F5-style Extension Development Host workflow used by the companion SQLite extension:
- Open this repository in VS Code.
- Select Launch Wrangler State Preview in Run and Debug.
- Press F5.
- In the Extension Development Host, select the Wrangler State Activity Bar icon.
The pre-launch task vendors SQL.js, compiles the extension, and regenerates .tmp/wrangler-preview-workspace. The launched workspace contains two discoverable state roots and deterministic examples for KV, R2, D1, Durable Objects, Cache, Workflows, Queues, and Other state. It includes JSON, text, binary, PNG, gzip, SQLite, metadata, and multipart R2 preview cases.
Regenerate the environment without launching VS Code with:
pnpm run fixture:wrangler
validate:local verifies the vendored SQL.js runtime, compiles TypeScript, runs all tests including the generated preview environment, audits production dependencies, rebuilds the VSIX, and compares every packaged runtime file hash with the current build.
License
Apache-2.0. The packaged SQL.js runtime is distributed under its MIT license in media/vendor/sqljs/LICENSE.sql.js.