Requirements
- Desktop VS Code 1.106 or later, or a compatible editor such as Grok Build (Cursor) or Antigravity with a native extension host and filesystem access
- A Ditto database ID and token. Ditto Cloud users can find these in the Ditto Portal.
- macOS on Apple silicon, Linux on x64 or arm64, or Windows on x64
Install the extension
Once the extension is available in Visual Studio Marketplace, open Extensions in VS Code, search forDittoLive.ditto-vsce, and select Install. You can also install it from a terminal.
.vsix to install in Grok Build (Cursor) or Antigravity, or if the extension is unavailable in your marketplace. You can download it from the latest GitHub Release if you have access to the repository.
Then install it with your editor’s UI or CLI:
- VS Code — Extensions sidebar →
…(More Actions) → Install from VSIX…, or runcode --install-extension /path/to/ditto-vsce-<target>-<ver>.vsix - Grok Build (Cursor) — same UI flow, or
cursor --install-extension /path/to/ditto-vsce-<target>-<ver>.vsix - Antigravity — same UI flow, or
agy --install-extension /path/to/ditto-vsce-<target>-<ver>.vsix
Cmd+Shift+P / Ctrl+Shift+P) and run Developer: Reload Window.
If you installed an earlier build as
ditto.ditto-vsce, register your connections again in DittoLive.ditto-vsce. The earlier build keeps its own saved connections and local database files.Open the extension
Click the Ditto icon in the VS Code Activity Bar to open the Ditto sidebar. It contains three views:- Connections — register and open databases. After you connect, a database’s rows provide access to subscriptions, collections, observers, Presence, the Query Editor, metrics, the Log Analyzer, and data import.
- Logging — log levels, the Output channel, log export, and the log pattern editor. See Logging and bug reports.
- Help — the Welcome guide, Get Quickstarts, links to What’s New, the Ditto documentation, the Ditto Portal, and the quickstart repos, plus Suggest a Feature, Report a Bug, and Reset Warnings.
Use the Command Palette
The Command Palette gives you a keyboard-driven way to run Ditto actions. Open it withCmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux, then type Ditto: to filter the extension’s commands. Each section of this page lists the commands that apply to that feature.
Commands that create something — such as Ditto: New Subscription… and Ditto: New Observer… — act on the active connection. Connect a database first; otherwise the command asks you to open a connection.
Actions that operate on a specific tree item are hidden from the Command Palette because they need a selected row. These include Connect, Disconnect, Edit Configuration, Delete, Open Presence, Open Query Editor, the metrics panels, Import Data…, Add Index…, Delete Index, and subscription and observer edit/delete. Use the row in the Connections tree, its inline buttons, or its right-click context menu.
Register a connection
- Command Palette
For a self-managed Ditto Server that serves plain HTTP, include
http:// in URL. Sync and HTTP queries use the corresponding unencrypted transports. Use HTTPS for connections that carry credentials over a network.
The extension keeps credentials in VS Code Secret Storage and connection settings in VS Code’s global state.
Encrypt a local database
- While registering a new connection, expand Advanced Configuration and select Encrypt local database.
- In Encryption key (optional), enter a Base64-encoded 32-byte key or leave the field blank to generate a key.
- Select Save and connect. VS Code Secret Storage keeps the key for subsequent connections.
Configure sync scopes and startup settings
Under Advanced Configuration, use Collection Sync Scopes to choose where a collection can sync. Use Startup System Settings to set Ditto system parameters before sync and subscriptions start. Save any changes, then disconnect and reconnect to apply them to an active connection.Manage connections
Right-click a connection row to Connect, Disconnect, Edit Configuration, or Delete it. Only one connection is active at a time; connecting to a different database asks for confirmation, closes the previous database’s panels, and rolls back to the previous connection if the new one fails. Deleting a connection also removes its subscriptions, observers, query history, favorites, and local data directory.Open the Ditto Inspector
The Ditto Inspector is a contextual documentation and data panel in VS Code’s Secondary Side Bar on the right side of the window. It follows the feature you are currently using, so its contents change when you move between the Query Editor, Presence Graph, subscriptions, observers, metrics, and Log Analyzer.1
Open a database feature
Connect a database, then open a feature such as Query Editor or Presence from the Connections tree. The Inspector may open automatically the first time you open a feature panel.
2
Choose Ditto Inspector
If the Secondary Side Bar shows Chat or another agent view, click its … overflow button and select Ditto Inspector. If the bar is hidden, enable it from View → Appearance → Secondary Side Bar first.
3
Read contextual help
Select the Help tab in the Inspector. The help changes with the focused screen and explains the controls and Ditto concepts for that feature.
Cmd+Alt+I on macOS and Ctrl+Alt+I on Windows/Linux.
Subscriptions
Subscriptions tell Ditto which documents to keep in sync — a saved DQLSELECT query whose matching documents replicate from any reachable peer. See Syncing Data for the concepts.
- Create — hover the Subscriptions row under a connected database and click +. When the connection has an HTTP API URL and key, you choose between New Subscription… and Import from Server…, which bulk-imports the subscriptions your Ditto Server already knows about.
- Edit — click the subscription’s row, or right-click it → Edit Subscription. The saved query is re-registered with the SDK immediately.
- Delete — right-click the row → Delete Subscription.
- Ditto: New Subscription… — creates a subscription on the active connection. When HTTP API credentials are configured, it offers the same choice between writing a subscription and importing one from the server.
- Ditto: Import Subscriptions from Server… — opens the import flow directly for the active connection. It requires the HTTP API URL and key on that connection.
Collections and Indexes
Collections appear in the Connections tree as documents land locally (see Subscriptions). Expand a collection to see its documents and indexes. Right-click a collection → SELECT * FROM … to open the Query Editor pre-filled with a query for that collection. Indexes accelerate frequently-filtered ad-hoc queries — note that subscription queries do not use indexes, only ad-hoc queries do.Import data
To bulk-load documents, click the Import Data row under a connected database, or right-click a collection → Import Data… to preselect that collection. Import requires an active connection to the database and is available only from the tree.Query Editor
The Query Editor reads, writes, and inspects data using Ditto Query Language (DQL). Open it from the Query Editor row under a connected database, then pressCmd+Enter / Ctrl+Enter to run the query under the cursor. For the full language reference, see the DQL documentation.
Run ADVISE before a SELECT to see the planner’s index recommendations. The editor shows each recommendation with its reason and a ready-to-run CREATE INDEX statement; creating the index asks for confirmation and refreshes the Connections tree.
Execution modes
The Run on dropdown picks where a query executes. It only appears when more than one mode is available for the connection.
The Metrics tab shows Location: Local Database or Location: HTTP above each result, so a slow query reads as “different transport” rather than “same query got slower.”
Result views
Results appear in one of three views:- JSON — full documents, syntax-highlighted, with fold gutters and word-wrap. Click inside a top-level document to select that row.
- Table — a flat projection with one column per top-level field, unioned across heterogeneous documents. Large result sets are paged client-side, so multi-thousand-row queries don’t freeze the editor.
- Profile — visualizes Ditto’s
PROFILEexecution plan as nested cards or a top-down tree for localSELECTqueries. It highlights CPU bottlenecks and shows time spent waiting on the store, scheduler yields, skipped documents, and inner plans for joins when the SDK reports them.
dittoVsce.collectProfiling, dittoVsce.collectMetrics), so the choice travels across workspaces.
Working with rows
- Single-click a row to mirror its full JSON into the Inspector’s JSON tab.
- Double-click to select the row and switch the Inspector to the JSON tab.
- Right-click a row to add or remove attachments on that document. Attachment flows require an active local connection and a string
_id; files over 20 MB are refused.
Inspector contents
The Inspector tracks the focused panel. Its Help tab is available for the Query Editor, subscriptions, Presence, Query Metrics, Database Metrics, System Metrics, observers, Log Analyzer, and Manage Log Patterns. The documentation is built into the extension, so it remains available while you investigate a database. When the Query Editor has focus it exposes five tabs:
History and Favorites persist per-database and survive disconnect/reconnect. The JSON viewer scans selected documents for attachment tokens. You can preview images inline or save an attachment to disk. To replace a file, select the existing file in the save dialog and confirm the replacement. See Open the Ditto Inspector if the Inspector is not visible.
Observers
An observer registers a live DQLSELECT query against the local store and fires an event whenever matching documents are inserted, updated, deleted, or reordered — whether the change came from a local write or a sync from a remote peer.
- Create — hover the Observers row under a connected database and click +, or right-click it → Ditto: New Observer….
- Open — click the observer’s row, then click Activate in the panel toolbar.
- Edit — right-click the row → Edit Observer.
- Delete — right-click the row → Delete Observer, or click its inline trash icon.
Presence and peer listing
The Presence panel surfaces the live mesh — every device the app is currently aware of, the transports each connection is using, and how data is flowing. See Mesh Networking and Using Mesh Presence for the underlying concepts. Open it by clicking the Presence row under a connected database. The panel is tied to a specific database, so it is not available from the Command Palette.Connected Peers
The Connected Peers tab shows a live card for the local peer and each directly connected remote peer. Cards include the device name, OS, SDK version, sync status, active connection types, synced commit, and last update. Ditto Cloud Server appears as a WebSocket peer when cloud sync is active. The Local Network section shows the interfaces and addresses available on your machine; use its refresh button to rescan them.Presence Graph (Presence Viewer)
The Presence Graph tab draws peers as nodes and transports as color-coded edges. Use it to spot topology problems, such as one device acting as a hub for all the others or a connection silently downgrading from LAN to Bluetooth LE. The Direct toggle in the top-right of the graph controls which peers appear:- On (default) — shows only peers with a direct connection to the local device, and only the connections from the local device. This is the most readable view.
- Off — shows the full mesh, including multi-hop peers and connections between remote devices. The rings spread wider to give connection lines room.
Search for a peer
Type a device name or peer ID in the search box (case-insensitive). Matching peers and their connections stay highlighted while unrelated peers dim, and matches are listed below the box. Select a result, or press Enter for the first result, to focus the graph on that peer; Direct turns off automatically if needed. The search text is kept so you can move between results. Press Escape or clear the box to restore the normal graph.View peer details
The peer detail card shows everything the presence graph reports about a peer: its peer key, OS, Ditto SDK version, cloud link, compatibility, and metadata key counts, plus sync progress when available.- With Direct on — click a remote peer. That peer, the local device, and the connections between them stay highlighted, and its detail card opens. Click another peer to swap the card. Click the selected peer again, or click empty canvas, to close the card and clear the selection.
- With Direct off — click a peer in the full mesh to open a focused view of its neighborhood. Then click any peer in the focused view, including the focused peer itself or Me, to open its detail card. Click Focus this peer on a card to move the focus to that peer.
Navigate the graph
Drag nodes to reposition them, drag empty space to pan, use + and − or the mouse wheel to zoom, and use the reset control to recenter the view at 100% zoom. Exiting a focused view restores the full mesh’s earlier pan and zoom. You can hide the graph controls or background effects when you need a less busy view.A fully connected mesh of more than a handful of peers produces crossing lines no matter how it’s laid out. The full-mesh view is meant for topology debugging — confirming a path exists between two devices or diagnosing a partition — so use search and focused neighborhoods to isolate a peer or connection path.
Transports and sync
- Transport configuration — the cog opens switches for the transports supported by the current platform: LAN, Bluetooth LE, and AWDL. Applying a change temporarily stops sync, updates the live configuration, and restarts sync; you remain connected to the same database. Use it to reproduce failover behavior or validate firewall rules.
- Start / Stop Sync — take the local peer out of the mesh without disconnecting the database.
Query Metrics
The Query Metrics panel keeps a running history — up to 200 records, in memory, per connection — of every DQL query you’ve executed alongside itsEXPLAIN plan. Each row shows a timestamp, a Local/HTTP location pill, a color-coded latency pill, and an index dot indicating whether the plan mentions an index. Use it to compare two versions of a query side by side or to spot why a query that used to be fast got slow.
Open it from the Query Metrics row under a connected database. The row is hidden when dittoVsce.collectMetrics is off.
Database Metrics
The Database Metrics panel breaks down how much disk space a connection is using and where. It computes on demand — open the panel from the Database Metrics row for a snapshot, then click Refresh for fresh numbers. On-disk usage is bucketed into Store (the SQLite document store), Replication (sync state), Attachments, Auth, WAL/SHM (write-ahead log), Logs, and Other. A second table lists every user collection by document count and total CBOR payload size — the wire format, and therefore a good approximation of what a fresh peer would have to pull down to replicate that collection. Each connection’s data lives at<VS Code globalStorage>/dittoData/<connectionId>/.
System Metrics
The System Metrics panel displays every metric series the SDK reports through thesystem:metrics virtual collection. Open it from the System Metrics row, which sits between Database Metrics and Log Analyzer under a connected database.
Each row shows the metric name, its labels, and the change since the last poll. Counters show the total since connection. Gauges show the current value, and timestamps such as last peer activity appear as elapsed time. When the SDK reports an aggregate for a metric, it appears as one row. Metrics poll every 5 seconds while the panel is visible. Select Refresh for an immediate update.
- Filter by topic — select All, Discovery, Network, Sync, Transport, Store, Query, or Peer. Query includes
ditto.query.*and the legacydql.*series. - Search — type in the filter box to narrow the list by metric name or label, case-insensitively. For example,
blefinds everytransport=bleseries. Search combines with the namespace filter. - Show details — click a row’s ⓘ icon to expand its description, kind, unit, and full metric name. Histograms also show the average and absolute maximum since connect.
- Pin series — click the pin icon on a row to add it to the Pinned section above the segment control. Pinned series appear regardless of the namespace filter or search, persist per connection across restarts, and can be reordered by dragging. Click Clear to remove all pins.
System metrics collection is controlled by
dittoVsce.collectSystemMetrics and is applied when the SDK opens. After changing the setting, disconnect and reconnect the database for the change to take effect.Log Analyzer
The Log Analyzer is a live triage tool for a connected database. It watches every log line the SDK and the extension emit for the connection, scans them against a catalog of known problem patterns, and surfaces severity-ranked counts, histograms, and a searchable virtualized log table. Each connection gets its own panel, which closes automatically on disconnect. Open it by clicking the Log Analyzer row under a connected database. The Ditto: Open Log Analyzer command appears in the Command Palette, but because the analyzer is scoped to a database, running it from the palette only reminds you to open it from the database row. On open, the panel backfills from the on-disk log file (ditto-edge-studio.log plus rotated files), filtered to lines after the database’s most-recent connect time, then streams new lines live.
- Summary — counts of critical matches, errors, warnings, problems, and total lines, plus detected SDK version and time range.
- Histograms — log volume by level, problems over time (colored by max severity), and connection durations (
0–1sthrough5m+; a healthy mesh concentrates in5m+). - Sources — switch between Logs, Transport Conditions, and Connection Requests to investigate transport changes and incoming connection decisions.
- Filter tabs and search — All / Critical / Errors / Warnings / Problems tabs with live count badges, plus a debounced free-text search over message, tag, and user tags.
- Toolbar — Pause/Resume the live stream, Clear the in-memory view (the on-disk log is untouched), or open the pattern editor.
Manage Log Patterns
The Manage Log Patterns editor manages the regex catalog the analyzer scans against. Open it from the Log Analyzer toolbar or the Manage Log Patterns row in the Logging view. Command Palette: run Ditto: Manage Log Patterns. Bundled patterns are read-only; user patterns get full create/edit/delete with live regex validation and a Test line field. Each pattern carries a unique key, a regex (matched case-insensitively against the line’s message body), a severity from 1–5, an actionable recommendation, and optional level filter, tag filter, and user tag. User tags label matching lines in the log table and become searchable terms — for example, tag every query-engine line withquery, then type query in the analyzer’s search box to see only those lines.
User patterns are stored in <globalStorage>/log-analyzer/user_patterns.json. Point the dittoVsce.logAnalyzer.customPatternsFile setting at a different path — such as ${workspaceFolder}/.ditto/log-patterns.json — to share a catalog with your team via version control.
Logging and bug reports
The Logging view in the Ditto sidebar controls the extension’s own logs. Each row has a matching Command Palette command:Collect SDK diagnostics
- Ditto: Collect Support Bundle (dial9)… saves a
.tar.gzwith SDK logs, store diagnostics, and dial9 runtime traces from the active connection. To investigate a slow query, run it first, then collect the bundle. If the SDK reports a rate limit, wait and retry. See Capturing support bundles. - Ditto: Export SDK Logs (gzip)… saves the active connection’s internal SDK logs as a
.jsonl.gzfile. Connect to a database before running the command.
README.txt explains why the bundle is missing.
Use the log retention settings to control application log rotation and how long the extension keeps backups.
To re-enable tips and warnings you dismissed, click Reset Warnings in the Help view or run Ditto: Reset Warnings.
Debug Console
The Debug Console runs DQL directly against a running app that uses Ditto SDK 5.1 or later, through the app’s debug socket. It doesn’t use the extension’s own connection, so you don’t need to register or connect a database first. Command Palette: run Ditto: Open Debug Console. The Debug Console is available only from the Command Palette.1
Enable the debug socket in your app
In your app, after opening Ditto, run a DQL statement that opens a debug socket at an absolute file path, then run the app:
2
Connect
Enter the socket’s absolute path, such as
/tmp/my-app-ditto-debug.sock, and click Connect. The status changes to Connected. On macOS, the path must be 104 bytes or shorter.3
Run statements
Type a DQL statement, such as
SELECT * FROM system:data_sync_info, and press Enter. Each result appears as a card showing the statement, item count, duration, and results or the SDK’s error message. Shift+Enter doesn’t run the statement.MCP server for AI agents
Edge Studio includes an embedded Model Context Protocol (MCP) server. It lets AI assistants such as GitHub Copilot agent mode, Claude Code, Grok Build (Cursor), and Codex work with the same active database that the extension panels use: run DQL, inspect peers and schema, manage indexes and subscriptions, watch live query changes, read metrics and logs, and download attachments to disk. The server is off by default and is enabled separately for each connection. It runs only while a connection with MCP enabled is active.Enable MCP
- Connection settings
- Command Palette
1
Edit the connection
In the Connections tree, right-click a database and choose Edit Configuration. Expand Advanced Configuration.
2
Enable AI access
Under MCP Server (AI Access), select Start MCP server while this connection is active, then click Save.
3
Connect the database
Connect the database. The server starts while this connection is active and stops when you disconnect or switch to a connection without MCP enabled.
Connect an AI client
The server listens athttp://127.0.0.1:65270/mcp using the Streamable HTTP transport. Older clients that use the legacy HTTP+SSE transport can connect with GET /sse and POST /messages.
- Copilot agent mode
- Claude Code
- Codex
- Other clients
No setup is required. While the server runs, VS Code discovers it automatically and its tools appear in the Copilot agent mode tool picker.
OK.
The extension’s repository includes an agent skill bundle that describes every tool, the resources, and safety rules. Share it with your agent to help it use the server effectively.
Change the port
The server uses port65270 by default. The standalone Edge Studio app uses 65269, so both can run at the same time. To use a different port, change the dittoVsce.mcpServer.port setting. If the server is running, it restarts on the new port immediately. Run Ditto: Copy MCP Client Config again to copy a configuration with the new port.
Available tools
All tools act on the active connection. Tools that need a connection return an error that tells the agent to connect a database first.
Key behaviors:
connect_databaseswitches connections without the UI. If the new connection fails, it rolls back to the previously active connection.execute_dqlruns any DQL statement, including mutations, against the local store, or against the HTTP API when you passtransport: "http".SELECTresults are capped at 10,000 rows.watch_querycaptures live changes for up to 30 seconds and 100 events, then stops automatically.debug_socket_queryruns one statement against a running app’s debug socket and doesn’t need an extension connection.add_observersaves observer definitions only; activate observers from the observer panel.fetch_attachmentsaves attachments directly to disk, within an open workspace folder, the extension’s storage directory, or the OS temp directory. Setoverwrite: trueto replace an existing file.
ditto://schema, ditto://peers, ditto://sync-status, ditto://subscriptions, ditto://observers, and ditto://system-metrics.
Troubleshoot MCP
If your agent can’t connect:- Run Ditto: MCP Server Status. Confirm the server is running and the active connection has MCP enabled, and check the last start error.
- Open the Log Analyzer for the active database and search for
mcp. Server starts, stops, client sessions, and start failures are logged with the[mcp]tag, and start failures are flagged with a recommendation. - Run Ditto: Open Output Channel and look for lines containing
mcp. - Check whether another process — such as a second VS Code window — already uses the port. If so, change
dittoVsce.mcpServer.port.
Get Quickstarts
The Get Quickstarts action clones the official Ditto quickstart repo into a folder you choose. It pre-fills.env files for every quickstart project, plus the Edge Server configuration, using the Database ID, Development Token, and URLs from your currently active connection. If no connection is active, it offers a code-only download. Requires git on your PATH.
Start it from the Get Quickstarts row in the Help view, or the Get Quickstarts card on the Welcome screen.
Command Palette: run Ditto: Get Quickstarts….
Settings reference
Related documentation
- DQL reference — the full query language
- ADVISE — index recommendations in the Query Editor
- Syncing Data — subscriptions and sync concepts
- Using Mesh Presence — the Presence API behind the Presence panel
- SDK Logging — SDK-side log configuration
- Troubleshooting — common SDK issues
- Ditto CLI — run DQL against a local store from a terminal