{"id":"gIHYPRxD","markdown":"# CLI — Quick Start\n\n## Install\n\n```bash\nnpm install -g mdfy-cli\n```\n\nAfter install, the `mdfy` command is available globally.\n\n## Publish\n\n```bash\n# Publish a file\nmdfy publish README.md\n# → https://mdfy.cc/d/abc123  (copied to clipboard)\n\n# Publish from pipe\necho \"# Hello World\" | mdfy publish\n\n# Publish clipboard\npbpaste | mdfy publish\n```\n\n## Pipe Anything\n\n```bash\n# AI output\nclaude \"explain React hooks\" | mdfy publish\n\n# Git log\ngit log --oneline -20 | mdfy publish\n\n# System info\nsystem_profiler SPHardwareDataType | mdfy publish\n\n# Man pages\nman grep | mdfy publish\n\n# Command output\ncurl -s https://api.example.com/status | mdfy publish\n```\n\n## Read Documents\n\n```bash\n# Read by ID\nmdfy read abc123\n\n# Read by URL\nmdfy read https://mdfy.cc/d/abc123\n\n# Output: color-coded headings, bold, code blocks, lists\n```\n\n## Manage Documents\n\n```bash\n# List your documents\nmdfy list\n\n# Update a published document\nmdfy update abc123 updated-file.md\n\n# Download to file\nmdfy pull abc123 -o meeting-notes.md\n\n# Delete\nmdfy delete abc123\n\n# Open in browser\nmdfy open abc123\n```\n\n## Capture\n\n```bash\n# Auto-detect: tmux pane if in tmux, clipboard otherwise\nmdfy capture\n\n# Explicit sources\nmdfy capture tmux        # Current tmux pane\nmdfy capture clipboard   # System clipboard\n```\n\nAI conversations (Claude Code, ChatGPT CLI, Ollama) are auto-detected and formatted with User/Assistant roles.\n\n## Authentication\n\n```bash\nmdfy login      # Opens browser for OAuth\nmdfy whoami     # Show current user\nmdfy logout     # Clear credentials\n```\n\nCredentials: `~/.mdfy/config.json`\nEdit tokens: `~/.mdfy/tokens.json`\n\n## tmux Integration\n\nAdd to `~/.tmux.conf`:\n\n```bash\nbind-key M run-shell \"tmux capture-pane -p -S -1000 | mdfy publish\"\n```\n\nPress `prefix + M` to publish the current pane.\n\n## Shell Aliases\n\n```bash\n# Add to ~/.zshrc or ~/.bashrc\nalias mp=\"mdfy publish\"\nalias mpc=\"pbpaste | mdfy publish\"\n```\n\n## Short Aliases\n\n| Short | Full |\n|-------|------|\n| `mdfy p` | `mdfy publish` |\n| `mdfy up` | `mdfy update` |\n| `mdfy ls` | `mdfy list` |\n| `mdfy rm` | `mdfy delete` |\n| `mdfy cat` | `mdfy read` |\n| `mdfy c` | `mdfy capture` |","title":"CLI — Quick Start","created_at":"2026-04-27T01:22:11.145103+00:00","updated_at":"2026-04-27T01:22:11.145103+00:00","view_count":6,"expires_at":null,"edit_mode":"account","is_draft":false,"source":"mcp","hasPassword":false,"editMode":"account","isOwner":false,"isEditor":false,"ownerEmail":"hi@raymind.ai"}