CLI-first collaborative Markdown with realtime editing, stable share links, readable history, and draft-style revision workflows.
If you are an agent or operator landing in this repo, the practical rule is simple:
- use the CLI first
- use MCP when you need tool access from an editor or agent runtime
- use the web app for reading, live collaboration, sharing, and review
Canonical agent guidance lives in AGENTS.md. CLAUDE.md, CODEX.md, and CURSOR.md are symlinks to that file.
Use ShareMyMarkdown when you want to:
- turn local Markdown into a durable share link instead of pasting drafts around
- write Markdown collaboratively without giving up plain text
- control whether a document is private, unlisted, or public
- keep explicit versions for meaningful checkpoints
- create isolated revisions before changing the live document
- let agents interact with the same document system through MCP
The product is designed so the same core actions exist across:
- CLI
- MCP
- web
Install dependencies:
bun installSet up your environment:
cp .env.example .envAdd these values to .env:
DATABASE_URL=libsql://...
TURSO_TOKEN=...
BETTER_AUTH_SECRET=...
BETTER_AUTH_URL=http://localhost:3000
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...For local GitHub auth, use this callback URL in your GitHub OAuth app:
http://localhost:3000/api/auth/callback/githubStart the app:
bun devThen open:
http://localhost:3000Local CLI during repo development:
bun run cli -- helpPrepare the lean npm CLI package locally:
bun run build:cli-package
cd dist-cli
npm pack --dry-runPublished CLI:
bun add -g @sharemymarkdown/smm
smm share draft.md --visibility unlistedInstall the /smm skill so Claude Code can share markdown on your behalf:
smm install-skillAfter restarting Claude Code, type /smm to share files, plans, or conversation content as a link.
Sign in from the CLI:
smm auth loginCreate a link from a file or stdin:
smm share draft.md --visibility unlisted
cat draft.md | smm share --title "Working Draft"Open and edit an existing document:
smm docs get <document-id>
smm docs edit <document-id>
smm docs visibility <document-id> publicSave a version:
smm versions save <document-id> "Initial checkpoint"Create and review a revision:
smm revisions create <document-id> "Alternative draft"
smm revisions edit <document-id> <revision-id>
smm revisions diff <document-id> <revision-id> live
smm revisions apply <document-id> <revision-id>Set a default visibility for future shares:
smm config set default-visibility unlisted
smm config showSee all CLI commands:
smm helpThere are two MCP entrypoints:
- local stdio:
bun run mcp - HTTP:
http://localhost:3000/mcp
Discovery endpoints:
http://localhost:3000/.well-known/oauth-authorization-serverhttp://localhost:3000/.well-known/oauth-protected-resourcehttp://localhost:3000/llms.txt
Agents should prefer markdown output when reading content.
Key GET endpoints support markdown when you send either:
Accept: text/markdown?format=markdown?format=md
High-value endpoints:
/api/documents/api/documents/:id/api/shared/:shareId/api/documents/:id/presence/api/documents/:id/versions/api/documents/:id/revisions/api/documents/:id/revisions/:revisionId/api/documents/:id/diff/api/documents/:id/revisions/:revisionId/diff/api/documents/:id/members
- GitHub is the first auth provider.
- Use one GitHub OAuth app for local and a separate one for production.
- CLI defaults live in
~/.config/sharemymarkdown/config.json. - The repo workspace package is private; npm publishing happens from the generated
dist-cli/package as@sharemymarkdown/smm. db:pushcan hit Turso transaction issues when it tries to recreate existing auth tables. The app also runsensureDatabase()on startup to create missing tables safely.
- Agent instructions: AGENTS.md
- Architecture blueprint: docs/architecture.md