CLI

Command Line Interface

Publish Markdown from the terminal. Pipe stdin, capture tmux panes, manage documents.

Installation

bash
npm install -g memory-wiki-cli

Requires Node.js 18+. After install, use the Memory.Wiki command.

Commands

mw publish <file>Publish a Markdown file or stdin to Memory.Wiki.
Memory.Wiki update <id> <file>Update an existing document with new content.
Memory.Wiki pull <id>Download a document's Markdown content.
Memory.Wiki delete <id>Soft-delete a document.
Memory.Wiki listList all your documents.
Memory.Wiki open <id>Open a document in the browser.
Memory.Wiki captureCapture the current tmux pane and publish.
Memory.Wiki loginAuthenticate with Memory.Wiki.
Memory.Wiki logoutClear stored credentials.
Memory.Wiki 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 --open

Options

--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
Memory.Wiki update abc123 README.md

# Update from stdin
echo "# Updated" | mw update abc123

# Update with version note
Memory.Wiki update abc123 README.md --message "Fixed typos"

pull

Download a document's Markdown content.

bash
# Print to stdout
Memory.Wiki pull abc123

# Save to file
Memory.Wiki pull abc123 -o output.md

delete

bash
Memory.Wiki delete abc123

# Skip confirmation
Memory.Wiki delete abc123 --yes

list

bash
Memory.Wiki list

# Output:
#  ID       TITLE              UPDATED         STATUS
#  abc123   My Document        2 hours ago     published
#  def456   Draft Note         5 minutes ago   draft

open

bash
Memory.Wiki open abc123
# Opens https://memory.wiki/abc123 in your default browser

capture

Capture the current tmux pane output and publish it as a code block.

bash
# Capture current pane
Memory.Wiki capture

# Capture specific pane
Memory.Wiki capture -t %3

# Capture last N lines
Memory.Wiki capture --lines 50

Authentication

bash
# Authenticate (opens browser for OAuth)
Memory.Wiki login

# Clear stored credentials
Memory.Wiki logout

# Show current user
Memory.Wiki whoami
# user@example.com (authenticated via OAuth)

Authentication is optional. Without login, documents are created anonymously with edit tokens. Login enables Memory.Wiki 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 publish

tmux 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 publish

Shell Aliases

bash
# Add to ~/.zshrc or ~/.bashrc

# Quick publish
alias mp="Memory.Wiki 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.wiki

Config File

Credentials are stored in ~/.memory.wiki/config.json after Memory.Wiki 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": "..."
}