Working in a dohc workspace
dohc keeps files, Markdown documents, structured Collections, automations, chat, and small web apps in one local-first workspace with History and Versions. Every user action runs through the same operations in the desktop app, the dohc CLI, and the dohc MCP server.
Before your first call
- Through MCP,
dohc_dataset,dohc_collection_access, anddohc_publish_appfill inworkspaceIdfor the workspace the server serves. The CLI needs it: read it from thedohc://workspace/inforesource,dohc_list_workspaces, orworkspaceIdin.dohc/manifest.jsonat the workspace root. Never guess"local". - Keep the dohc desktop app open for writes, Collections, apps, chat, and Versions.
- For Markdown files (
.md), usedohc_create_document,dohc_read_document, anddohc_edit_document.dohc_write_filerefuses Markdown documents because live documents own their text. - For drawings (
.excalidraw), usedohc_create_drawing,dohc_read_drawing, anddohc_edit_drawing. An open canvas shows each edit at once.
Core building tools
The desktop MCP server registers over 75 tools, most of them for sync recovery, live-document quarantine, and sharing administration. Start with these core building tools:
| Goal | Primary MCP tool | CLI equivalent |
|---|---|---|
| Check workspace role and live sync status | dohc_workspace_status | dohc workspace status |
| Recall context across pages, Collections, records, and chat | dohc_search_workspace | dohc workspace search <query> |
| Explore files | dohc_list_files, dohc_read_file, dohc_search_files | (use workspace files directly) |
| Write non-Markdown files (code, YAML, JSON) | dohc_write_file | (use workspace files directly) |
| Create, read, and edit Markdown documents | dohc_create_document, dohc_read_document, dohc_edit_document | dohc document create|read|edit |
| Create, read, and edit drawings | dohc_create_drawing, dohc_read_drawing, dohc_edit_drawing | `dohc drawing create |
Work with document Collections (collection.yaml) | dohc_query_collection, dohc_create_record, dohc_set_record_fields | dohc document set-fields |
Create, approve, migrate, and invoke transactional Collections (dataset.json) | dohc_dataset | dohc dataset <verb> '<JSON>' |
Scaffold, stage, verify, and publish web apps (app.publish.json) | dohc_create_app, dohc_publish_app (in a workspace you own, verifyFrontend runs the app; readiness shows what a workspace app gives each member) | dohc app <verb> '<JSON>' |
| Import CSV/JSON and query SQLite | dohc_import_data, dohc_query_database | (MCP only) |
Check and change Collection automations (automations.yaml) | dohc_list_automations, then edit automations.yaml with dohc_write_file. In a workspace shared with you at Edit, dohc_switch_automation turns one on or off | dohc automation list|switch |
| Let a website form or another service add records to a Collection | In a synced workspace you own: dohc_read_automation_host, dohc_use_server_for_automations, then dohc_create_incoming_webhook. dohc_list_incoming_webhooks before you retry, and dohc_update_incoming_webhook, dohc_rotate_incoming_webhook, or dohc_delete_incoming_webhook to manage one. See references/automations.md | dohc automation host|use-server, dohc webhook list|create|update|rotate|delete |
| Post or reply in Groups and file comments | dohc_list_groups, dohc_start_group_chat, dohc_start_file_chat, dohc_reply_to_chat | dohc chat groups|post|reply |
| Try multi-file workspace drafts in a Version (not for app iteration) | dohc_create_version, dohc_compare_version, dohc_merge_version | dohc version create|compare|merge |
Choose the right data model
- Document Collection (
collection.yaml+.mdrecords): Best for notes with typed properties (trip plans, tasks, specs) where each record also has a rich Markdown body. - Transactional Collection (
dataset.json+ SQLite + operations): Best for structured records, multi-table relations, capacity or business rules, public forms, and dynamic apps. Apps bind to approved operations on these Collections; apps have no separate private database. - Visible SQLite file (
dohc_import_data+dohc_query_database): Best for quick one-off CSV/JSON imports and read-onlySELECTanalysis.
Give each page and app an icon
When you create a page or an app, give it one emoji that fits it. Explorer and Home show it in place of the generic glyph, so people can find work at a glance.
- Page: after
dohc_create_document, calldohc_set_record_fieldswith{ "recordPath": "<page>.md", "fields": { "icon": "ðŸ§" } }. It works on any page, not only Collection records. CLI:dohc document set-fields <page>.md --field icon=ðŸ§. If you write the Markdown file yourself, start it with--- icon: 🧠---. - App: put
"icon": "ðŸ§"in the app folder'sdohc.json, or create{ "icon": "ðŸ§" }when it has none. Changing it doesn't ask for the app to be approved again unless itsapp.publish.jsonlistsdohc.jsonamong its inputs. Don't addicontoapp.publish.json, which refuses unknown keys. - Collection: a Collection can't take an icon yet. Don't add
icontocollection.yamlordataset.json. The records in a document Collection are pages, so they can.
Detailed references
Read the matching reference before authoring schemas, apps, or automations:
- references/collections-and-datasets.md:
collection.yamlsyntax,dataset.json(formatVersion1 and 2) invariants,dohc_datasetaction fields, custombackend.tsoperations, schema migrations, bound-app drift checks, and public relation choices. - references/apps-and-publishing.md:
app.publish.jsonformat (optionalinputs/packageMap, namedoperations, multi-Collectiondatasets), built-in@dohc/app-kit,dohc-app-channelprotocol, unifiedstage/approveStaged, local approval, and share-link publishing. - references/automations.md:
automations.yamlschema, triggers, steps, formulas vs. conditions, and message templates.
Common pitfalls
- Workspace role vs. folder name ("Personal"): A "Personal app" is a private local app inside a workspace someone else owns (a workspace you joined). It has nothing to do with an owned workspace whose folder is named "Personal". Check
dohc_workspace_statusordohc workspace status(role: "owner"vs."joined"or"shared-view", plus livesync.stateandsync.caughtUp). dohc_datasetpath field name:action: "prepare"takesdescriptorPath. Collection-scoped actions (describe,invoke,prepareSchemaChange,prepareMigration,askToApply,prepareRelationChoices,createForm,history,permissions,lifecycle,archive,restore,deletePreview,delete,export,upload,file, etc.) takedatasetPath. Workspace-scoped and preparation actions (list,create,approve,discard,approveMigration,discardMigration,migrationPreviewPage,cancelInvoke, and recovery actions) omit both. Always pass the path ending indataset.json(for example"tracker/dataset.json"), never the folder alone and neverdatasetId.- Approval arguments:
dohc_datasetapprovetakes{ action: "approve", workspaceId, preparationId, revisionSha256 }(readrevision.revisionSha256fromprepare; omitdatasetPathandsourceDigest).approveMigrationtakes{ action: "approveMigration", workspaceId, preparationId, revisionSha256, approvalDigest }(omitdatasetPath). - Bound apps after Collection migrations: Migration previews (
prepareSchemaChange,prepareMigration,prepareRelationChoices,prepareHistoryRestore) anddataset permissionslist connected local and share-link apps inboundAppswithstatus("compatible","needs-refresh", or"incompatible"). OmitrevisionandrevisionSha256inapp.publish.jsonsoprepareLocal,prepare, orstagepins the current approved revision automatically. If an older app still pinsrevisionandrevisionSha256inapp.publish.json, remove those two lines once before re-preparing and approving it. When editing a local app and its Collections together, usedohc_publish_appstage->approveStaged. - Keep dohc chat conversations in dohc: Keep updates and questions for a dohc chat request in that thread, not your host tool's replies or question box. Send ordinary replies for normal and final text; pass a work report (
--workin CLI,workin Desktop MCP) only to update the thread's Work card, repeating--link/urlon linked cards so the link stays. CLI:dohc chat reply(--needs-decisionand repeated--option "<choice>"for choices) anddohc chat show <thread> --peek(ordohc chat watchonly when polling rather than receiving forwarded messages). Desktop MCP:dohc_reply_to_chat(needsDecision,options) anddohc_read_chat(plusdohc_wait_for_messageswhen polling an owned workspace). Personal MCP (dohc-personal):dohc_post_channel/dohc_post_discussionanddohc_read_channel,dohc_read_discussion, ordohc_wait_for_messages. - File comments vs. Group posts: To comment on a file, use
dohc_start_file_chat(notdohc_start_group_chat). To check existing discussions on a file first, usedohc_list_file_chats. - Drawings: Read before you edit, and pass each element's
versionasexpectedVersion. A refusal means someone changed it: read again and retry. SendrequestIdso a retry never applies twice. Undo Run in History skips a drawing an agent created and any drawing open in an editor. - Iterating on apps: Do not use a workspace Version to build or test app changes. Apps on non-Main versions run as read-only previews and cannot approve Collection changes. For small edits, update the app in place: dohc keeps up to 3 earlier approved local versions for rollback (
listLocal->reviewReactivation->approve). For a side-by-side rewrite, create a sibling app folder pointing at the same Collection and add new Collection operations instead of breaking existing ones. See references/apps-and-publishing.md. - Versions:
dohc_create_versioncreates a copy for multi-file workspace drafts and switches the workspace folder to it immediately. Edit files, rundohc_compare_version, then merge withdohc_merge_version. - Secrets and sharing: Never include owner-only read operations in a public share-link app's
operations/operationIds. Never read or copy secret files (.env*) into workspace apps or databases.