CLI Reference
Every mp command and flag, generated from the CLI itself (make mp-docs; do not edit by hand). For a guided tour see the CLI Workflow tutorial; the same content is installed as man pages (man mp, man mp-clip-list).
mp
Command-line interface for mahpastes
Synopsis
mp is a command-line interface for the mahpastes clipboard manager.
It communicates with the mahpastes REST API to manage clips, tags, and other resources from your terminal.
Getting started:
- Open mahpastes and enable the API under menu drawer > API (turn on "Start on launch" to keep it running across restarts)
- Create an API key in the same panel
- Export your key: export MP_API_KEY=<your-key> (or keep it in a file: export MP_API_KEY_FILE=<path>)
- (Optional) Set a custom URL: export MP_API_URL=
http://host:port
By default, mp connects to http://localhost:44557.
Environment variables:
MP_API_KEY API key (this or MP_API_KEY_FILE is required)
MP_API_KEY_FILE File holding just the API key, used when MP_API_KEY
is unset
MP_API_URL API base URL (default http://localhost:44557)
MP_TIMEOUT Wait for the connection and the first response bytes
(default 30s; never limits a running transfer)
MAHPASTES_API_KEY, MAHPASTES_API_URL
Fallbacks used when the MP_ variables are unset
(the same names the Claude Code plugin configures).
Options
-h, --help help for mp
--json Output results as JSON
SEE ALSO
- mp api - API connectivity and key management
- mp backup - Backup and restore mahpastes data
- mp clip - Manage clips
- mp clipboard - Copy clip content to the system clipboard
- mp completion - Generate the autocompletion script for the specified shell
- mp dedup - Find and merge duplicate clips
- mp link - Manage revocable public share links
- mp maintenance - Database maintenance tools
- mp plugin - Manage plugins
- mp serve - Manage tag HTTP servers
- mp tag - Manage tags
- mp watch - Manage watch folders
mp api
API connectivity and key management
Synopsis
Check API connectivity and manage API keys.
Options
-h, --help help for api
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp - Command-line interface for mahpastes
- mp api key - Manage API keys
- mp api status - Check API connectivity
mp api key
Manage API keys
Synopsis
Create, list, and revoke API keys through the REST API.
Options
-h, --help help for key
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp api - API connectivity and key management
- mp api key create - Create an API key
- mp api key list - List API keys
- mp api key revoke - Revoke an API key
mp api key create
Create an API key
mp api key create <name> [flags]
Examples
mp api key create my-key
Options
-h, --help help for create
--role string Role for the new key: viewer, editor, or admin (default "viewer")
--scoped-tag int Restrict the key to a tag ID
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp api key - Manage API keys
mp api key list
List API keys
mp api key list [flags]
Examples
mp api key list
Options
-h, --help help for list
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp api key - Manage API keys
mp api key revoke
Revoke an API key
mp api key revoke <id> [flags]
Examples
mp api key revoke 3
Options
-h, --help help for revoke
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp api key - Manage API keys
mp api status
Check API connectivity
Synopsis
Verify that the CLI can connect to the mahpastes API.
First asks the unauthenticated status endpoint whether the API is up, then makes an authenticated request to confirm the key is valid. Exits 2 when the app is not reachable and 3 when the key is missing, invalid or revoked.
Also prints the app's version, and warns when it differs from this mp's.
mp api status [flags]
Examples
# Check connection
mp api status
# Check connection as JSON
mp api status --json
Options
-h, --help help for status
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp api - API connectivity and key management
mp backup
Backup and restore mahpastes data
Synopsis
Create and restore full backups of your mahpastes data.
Backups are ZIP archives containing the database and all clip files.
Options
-h, --help help for backup
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp - Command-line interface for mahpastes
- mp backup create - Download a backup to a file
- mp backup restore - Restore from a backup file
mp backup create
Download a backup to a file
Synopsis
Create a backup of all mahpastes data and save it to the specified path.
The backup is a ZIP archive containing the database and all clip files. Use "-" as the path to write the backup to stdout (for piping).
mp backup create <path> [flags]
Examples
# Save backup to a file
mp backup create ~/backups/mahpastes.zip
# Pipe backup to another command
mp backup create - | aws s3 cp - s3://bucket/backup.zip
# Save with JSON output showing size
mp backup create backup.zip --json
Options
-h, --help help for create
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp backup - Backup and restore mahpastes data
mp backup restore
Restore from a backup file
Synopsis
Restore mahpastes data from a backup ZIP archive.
This replaces all current data with the contents of the backup. Use "-" as the path to read the backup from stdin (for piping).
mp backup restore <path> [flags]
Examples
# Restore from a file
mp backup restore ~/backups/mahpastes.zip
# Restore from stdin
cat backup.zip | mp backup restore -
# Restore from S3
aws s3 cp s3://bucket/backup.zip - | mp backup restore -
Options
-h, --help help for restore
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp backup - Backup and restore mahpastes data
mp clip
Manage clips
Synopsis
Create, view, modify, and delete clips stored in mahpastes.
Options
-h, --help help for clip
Options inherited from parent commands
--json Output results as JSON
SEE ALSO
- mp - Command-line interface for mahpastes
- mp clip archive - Archive one or more clips
- mp clip data - Output raw clip content to stdout
- mp clip delete - Delete one or more clips
- mp clip download - Download clips to files
- mp clip expire - Set or cancel clip expiration
- mp clip get - Show clip metadata
- mp clip list - List clips with optional filtering
- mp clip metadata - Manage clip metadata key-value pairs
- mp clip open - Open a clip in its default application
- mp clip rename - Rename a clip
- mp clip unarchive - Unarchive one or more clips
- mp clip upload - Upload files as clips
mp clip archive
Archive one or more clips
Synopsis
Archive clips by their IDs. Archived clips are hidden from the default list view. Use --stdin to read IDs from stdin (one per line).
mp clip archive <ids...> [flags]
Examples
# Archive a single clip
mp clip archive 42
# Archive multiple clips
mp clip archive 1 2 3
# Archive from a piped list
mp clip list --json | jq -r '.clips[].id' | mp clip archive --stdin