Local-first notes for agents and humans.
Bugbook is a local-first notes + database workspace where humans and coding agents collaborate in the same files.
BugbookCore: shared models + storage engine.BugbookCLI: automation and agent-friendly CLI.Bugbook(app target): desktop macOS app for humans.BugbookMobile(SwiftPM executable): shared mobile code and local validation target.ios/BugbookMobile.xcodeproj: real iOS app target for Simulator/device.
Both interfaces read/write the same workspace data.
Human interface (desktop/mobile):
- Edit notes and databases.
- Open Agent Hub to see active tasks, recent runs, and recent events.
- Update task statuses visually.
Agent interface (CLI):
- List/read/create/update/delete markdown pages.
- Embed databases into notes.
- Discover workspace skills.
- Create kanban boards without hand-writing schema JSON.
- Add and move cards by column name from the CLI.
- Add, update, delete, and set default database views from the CLI.
- Query databases and rows.
- Traverse backlinks.
- Create/update tasks.
- Start/finish runs.
- Log structured events.
- Output dashboard JSON for automation.
Shared source of truth (inside your workspace):
.bugbook/agents/tasks.json.bugbook/agents/runs.jsonl.bugbook/agents/events.jsonlAGENTS.md(optional workspace instructions)
git clone https://github.com/max4c/bugbook.git
cd bugbookswift buildswift run BugbookCLI agent --helpswift run BugbookCLI install --forceOr use the helper script:
./scripts/install-bugbook-cli.shBy default this installs a symlink at ~/.local/bin/bugbook. If that directory is not on your PATH, the command prints the shell snippet needed to add it.
Read and update notes:
swift run BugbookCLI page list --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --raw
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --raw --include-internal-comments
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --blocks
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --block-id path:3 --raw
swift run BugbookCLI page headings "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI page format "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --style commonmark --dry-run --output summary --report
swift run BugbookCLI page format "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --style commonmark --dry-run --fail-on-warnings
swift run BugbookCLI page compact "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --output summary
swift run BugbookCLI page ensure-block-ids "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --blocks
swift run BugbookCLI page strip-block-ids "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI page get "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --section-line 110
cat updated-note.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --content-file -
cat updated-note.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --content-file - --output summary
cat roadmap.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --section "Roadmap" --content-file -
cat roadmap.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --section "Roadmap" --create-section --section-level 2 --content-file -
cat roadmap.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --section "Roadmap" --create-section --section-level 2 --content-file - --dry-run
cat block.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --block-id path:3 --content-file -
cat text.txt | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --block-id path:3 --text-file -
cat sibling.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --block-id path:3 --append-file - --dry-run
cat snippet.md | swift run BugbookCLI page update "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook" --append-file -
swift run BugbookCLI block list "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI block get "Bugbook Strategy" path:3 --workspace "~/Library/Application Support/Bugbook" --raw
cat block.md | swift run BugbookCLI block replace "Bugbook Strategy" path:3 --workspace "~/Library/Application Support/Bugbook" --content-file -
cat text.txt | swift run BugbookCLI block update-text "Bugbook Strategy" path:3 --workspace "~/Library/Application Support/Bugbook" --text-file -
cat sibling.md | swift run BugbookCLI block insert "Bugbook Strategy" path:3 --workspace "~/Library/Application Support/Bugbook" --after --content-file - --dry-run
swift run BugbookCLI block move "Bugbook Strategy" path:3 path:7 --workspace "~/Library/Application Support/Bugbook" --before --dry-run
swift run BugbookCLI block delete "Bugbook Strategy" path:3 --workspace "~/Library/Application Support/Bugbook" --dry-run
swift run BugbookCLI backlinks "Bugbook Strategy" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI page embed-database "Bugbook Strategy" "Bugbook Strategy Board" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI board create "Bugbook Strategy Board" --workspace "~/Library/Application Support/Bugbook" --group-name "Phase" --column "Now" --column "Next" --column "Later" --view list --view calendar --embed-in "Bugbook Strategy"
swift run BugbookCLI board create "Sprint Board" --workspace "~/Library/Application Support/Bugbook" --column "Todo" --column "Doing" --column "Done" --no-table
swift run BugbookCLI board add-card "Bugbook Strategy Board" "Search trust" --workspace "~/Library/Application Support/Bugbook" --column "Now" --date 2026-03-07
swift run BugbookCLI board move-card "Bugbook Strategy Board" row_abc123 "Next" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI db list --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI db view list "Bugbook Strategy Board" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI db move "Agent Tickets" --workspace "~/Library/Application Support/Bugbook" --page "Agent Tickets" --dry-run
swift run BugbookCLI db move "Agent Tickets" --workspace "~/Library/Application Support/Bugbook" --page "Agent Tickets"
swift run BugbookCLI db view add "Bugbook Strategy Board" --workspace "~/Library/Application Support/Bugbook" --type calendar --name "Calendar" --date-property "Date"
swift run BugbookCLI db view set-default "Bugbook Strategy Board" "Calendar" --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI skill create "research-summarizer" --workspace "~/Library/Application Support/Bugbook" --description "Summarize linked source pages into one note."
swift run BugbookCLI skill list --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI skill get "research-summarizer" --workspace "~/Library/Application Support/Bugbook"Notes:
page get --rawprints clean markdown by default; add--include-internal-commentsfor the literal stored file.page get --blocksreturns parsed markdown blocks plus document metadata.page get --block-id <selector>narrows reads to one markdown block by stable UUID orpath:0/1.page headingsreturns heading titles, levels, and line numbers for section targeting.page format --style bugbook|commonmarkrewrites a page using either Bugbook's dense block format or a CommonMark-style layout with structural blank lines.page format --style commonmarknow strips persisted block IDs and converts Bugbook-only block syntax into portable approximations: toggles become<details>, columns are flattened sequentially with thematic breaks, database embeds become labeled text, and page-link blocks become relative markdown links when they resolve uniquely in the workspace or plain text when they do not.page format --reportaddswarning_countplus structuredwarningsto the response so agents can see which page links were downgraded during commonmark export.page format --fail-on-warningsturns those portability warnings into a non-zero exit and skips the write, which is useful for agent and CI gating.page compactandpage formatnow reportempty_paragraphs_removedso agents can tell when a rewrite cleaned up blank block gaps.page compactrewrites a page through Bugbook's block serializer and removes empty paragraph gaps, which is useful when a note has accumulated extra blank lines.page compactis the shortcut forpage format --style bugbook.page ensure-block-idspersists unique stable block IDs and repairs duplicate persisted IDs when needed; add--blocksif you want the parsed block list in the response.page strip-block-idsremoves persisted block ID comments from a page and restores clean markdown storage.page get --section "<Heading>"or--section-line Nnarrows reads to one heading section and fails if the selector does not match.page update --section "<Heading>"or--section-line Nscopes replace/prepend/append operations to a heading body.page update --block-id <selector>scopes replace/prepend/append operations to one block without polluting a clean note with persisted block IDs.page update --block-id <selector> --text-fileupdates only the selected block's text and preserves its markdown type.page update --section "<Heading>" --create-sectionappends the section if it is missing.page update --dry-runpreviews the post-edit page plus structured line changes without writing anything.page createandpage updateaccept--output summarywhen you want a compact write result instead of the full page payload.block list,block get,block replace,block update-text,block insert,block move, andblock deleteprovide a dedicated block-level command surface on top of the same selectors used bypage get --block-id.db listnow includesrelative_pathand, when applicable,parent_pagemetadata so agents can see whether a database lives under a page companion folder or a top-level directory.db move --page <Page>reparents a database into that page's companion folder, retargets any embed markers that still point at the old path, and supports--dry-runfor previewing the move first.- Row
getnow matchesqueryby returning friendly property names and display values by default; add--fieldsto narrow the payload and--raw-propertiesto include schema IDs and stored option IDs. query --fieldsreturns friendly property names and display values by default; add--raw-propertieswhen you also need schema IDs and stored option IDs.- Row
create,update,query --filter,query --sort, andquery --fieldsaccept friendly property names in addition to schema IDs.
Initialize workspace files:
swift run BugbookCLI agent init --workspace "~/Library/Application Support/Bugbook" --write-agents-mdCreate task and track a run:
swift run BugbookCLI agent task create --workspace "~/Library/Application Support/Bugbook" --title "Fix editor bug" --status todo
swift run BugbookCLI agent run start --workspace "~/Library/Application Support/Bugbook" --task <task_id> --agent codex --branch codex/fix-editor
swift run BugbookCLI agent event log --workspace "~/Library/Application Support/Bugbook" --run-id <run_id> --level info --message "Added regression test"
swift run BugbookCLI agent run finish <run_id> --workspace "~/Library/Application Support/Bugbook" --status succeeded --summary "Shipped fix"
swift run BugbookCLI agent task update <task_id> --workspace "~/Library/Application Support/Bugbook" --status doneOpen dashboard JSON:
swift run BugbookCLI agent dashboard --workspace "~/Library/Application Support/Bugbook"swift run BugbookThen open Agent Hub from the sidebar (or Cmd+Shift+J).
Open the iOS project in Xcode:
open ios/BugbookMobile.xcodeprojThe iOS project is generated from ios/project.yml (XcodeGen). Regenerate if needed:
cd ios && xcodegen generateThen:
- Select scheme
BugbookMobileApp. - Select an iOS simulator/device.
- Run.
Important:
- Do not run
Bugbookon iOS.Bugbookis macOS-only and usesAppKit. - If you see
No such module 'AppKit', you launched the wrong scheme. - If you see
BUNDLE_IDENTIFIER_FOR_CURRENT_PROCESS_IS_NIL, you are launching the SwiftPM executable instead of the iOS app bundle.
Run the one-command smoke test:
./scripts/smoke-cli.shThis verifies:
- workspace init
- task create/update
- run start/finish
- event logging
- dashboard output
- on-disk agent files
- Verify scheme is
BugbookMobileAppinios/BugbookMobile.xcodeproj. - In Xcode: Product -> Clean Build Folder.
- Rebuild and run again.
You can also verify simulator build from terminal:
xcodebuild -project ios/BugbookMobile.xcodeproj -scheme BugbookMobileApp -destination 'platform=iOS Simulator,name=iPhone 17' buildUse either:
swift run BugbookCLI agent task list --workspace "~/Library/Application Support/Bugbook"
swift run BugbookCLI agent run list --workspace "~/Library/Application Support/Bugbook" --limit 50
swift run BugbookCLI agent event list --workspace "~/Library/Application Support/Bugbook" --limit 100Or inspect raw files directly:
"~/Library/Application Support/Bugbook"/.bugbook/agents/tasks.json"~/Library/Application Support/Bugbook"/.bugbook/agents/runs.jsonl"~/Library/Application Support/Bugbook"/.bugbook/agents/events.jsonl
This repo currently does not contain MCP-specific integration/config.
If you want MCP-enabled workflows here, we can add:
- an MCP capability document in
AGENTS.md - task templates for Xcode actions
- explicit agent instructions for MCP tools