CLI
Command Line Interface
Publish Markdown from the terminal. Pipe stdin, capture tmux panes, manage documents.
Installation
bash
npm install -g memory-wiki-cliRequires Node.js 18+. After install, use the mw command.
Commands
mw publish <file>Publish a Markdown file or stdin to memory.wiki.mw update <id> <file>Update an existing document with new content.mw pull <id>Download a document's Markdown content.mw delete <id>Soft-delete a document.mw listList all your documents.mw open <id>Open a document in the browser.mw captureCapture the current tmux pane and publish.mw loginAuthenticate with memory.wiki.mw logoutClear stored credentials.mw whoamiShow current authenticated user.publish
Publish a file or stdin. Returns the document URL.
bash
# Publish a file
mw publish README.md
# Publish from stdin
echo "# Hello World" | mw publish
# Publish as draft
mw publish README.md --draft
# Publish with title
mw publish README.md --title "My Document"
# Place in a specific folder
mw publish README.md --folder "folder-uuid"
# Open in browser after publishing
mw publish README.md --openOPTIONS
--draft, -dPublish as draft (only visible to you).--title, -tSet document title.--folder, -fPlace document in a folder (folder UUID).--open, -oOpen in browser after publishing.update
Update an existing document. The edit token is stored automatically from the original publish.
bash
# Update from file
mw update abc123 README.md
# Update from stdin
echo "# Updated" | mw update abc123
# Update with version note
mw update abc123 README.md --message "Fixed typos"pull
Download a document's Markdown content.
bash
# Print to stdout
mw pull abc123
# Save to file
mw pull abc123 -o output.mddelete
bash
mw delete abc123
# Skip confirmation
mw delete abc123 --yeslist
bash
mw list
# Output:
# ID TITLE UPDATED STATUS
# abc123 My Document 2 hours ago published
# def456 Draft Note 5 minutes ago draftopen
bash
mw open abc123
# Opens https://memory.wiki/abc123 in your default browsercapture
Capture the current tmux pane output and publish it as a code block.
bash
# Capture current pane
mw capture
# Capture specific pane
mw capture -t %3
# Capture last N lines
mw capture --lines 50Authentication
bash
# Authenticate (opens browser for OAuth)
mw login
# Clear stored credentials
mw logout
# Show current user
mw whoami
# user@example.com (authenticated via OAuth)Authentication is optional. Without login, documents are created anonymously with edit tokens. Login enables mw list and account-based ownership.
Pipe Examples
bash
# Clipboard to memory.wiki
pbpaste | mw publish
# Command output
ls -la | mw publish
# Cat a file
cat report.md | mw publish
# Generate with AI, publish directly
claude "Write a guide to Rust" | mw publish
# Git diff
git diff | mw publish --title "Changes"
# Docker logs
docker logs my-app 2>&1 | mw publish
# Pipe through multiple commands
curl -s https://api.example.com/data | jq . | mw publishtmux Integration
bash
# Capture current pane
tmux capture-pane -p | mw publish
# Capture and share with one keybinding
# Add to ~/.tmux.conf:
bind-key M run-shell "tmux capture-pane -p | mw publish"
# Capture specific pane
tmux capture-pane -t %3 -p | mw publish
# Capture full scrollback
tmux capture-pane -p -S - | mw publishShell Aliases
bash
# Add to ~/.zshrc or ~/.bashrc
# Quick publish
alias mp="mw publish"
# Publish clipboard
alias mpc="pbpaste | mw publish"
# Publish and open
alias mpo="mw publish --open"
# Capture tmux
alias mtx="tmux capture-pane -p | mw publish"Configuration
ENVIRONMENT VARIABLES
MDFY_URLBase URL for the API. Default: https://memory.wikiCONFIG FILE
Credentials are stored in ~/.memory.wiki/config.json after mw login. Edit tokens for published documents are stored in ~/.memory.wiki/tokens.json.
json
// ~/.memory.wiki/config.json
{
"apiUrl": "https://memory.wiki",
"email": "user@example.com",
"token": "..."
}