Skip to content

CLI reference

Install: npm install -g @canvasmesh/cli. The binary is canvasmesh.

All commands except download require canvasmesh login first.

FlagDescription
--debugPrint all log entries to stderr in real time
--versionShow CLI version
--helpShow help for any command

Debug mode is useful for diagnosing slow requests or authentication issues:

Terminal window
canvasmesh --debug push image.png

Every command and API request is logged to ~/.canvasmesh/cli.log with timestamps, duration in milliseconds, and structured metadata. The log file is created automatically on first use.

Example log entries:

2026-04-22T05:10:00.000Z [DEBUG] POST /v1/upload/presign {"status":200,"ms":120}
2026-04-22T05:10:00.342Z [INFO] push {"canvas_id":"01H...","file":"demo.png","ext":"png","size":84210,"permanent":false}
2026-04-22T05:10:00.345Z [INFO] command push completed {"ms":892}

Save API key and endpoint to ~/.canvasmesh/config.json.

Terminal window
# Interactive mode — prompts for API key and endpoint
canvasmesh login
# Non-interactive mode
canvasmesh login --token <api-key> [--endpoint <url>] [--web-url <url>]

When called without --token, the CLI enters interactive mode and prompts for each value with sensible defaults:

$ canvasmesh login
CanvasMesh Login
Create an API key in the Settings page of the web dashboard.
API Key: sk-xxxx
API Endpoint (https://api.canvasmesh.app):
✓ API key saved (endpoint: https://api.canvasmesh.app)
FlagRequiredDefaultDescription
--tokennoAPI key from canvasmesh.app Settings. Omit to enter interactive mode
--endpointnohttps://api.canvasmesh.appAPI base URL
--web-urlnohttps://canvasmesh.appWeb dashboard URL (used by view)

Remove the stored API key.

Terminal window
canvasmesh logout

View or update local configuration.

Terminal window
# Show current config
canvasmesh config show
# Set a value
canvasmesh config set <key> <value>

Allowed keys: endpoint, web_url.

Show the authenticated user and workspace.

Terminal window
canvasmesh whoami

Display workspace storage statistics.

Terminal window
canvasmesh usage [--json]
FlagDefaultDescription
--json(off)Emit raw JSON

Upload a file and create a new canvas (temporary 24h by default).

Terminal window
canvasmesh push <file> [--title <title>] [--save]
FlagDefaultDescription
--titlefilenameHuman-readable canvas title
--save(off)Save permanently (no 24h expiry)

Download a canvas’s raw content.

Terminal window
canvasmesh pull <canvas-id> [--output <path>]
FlagDefaultDescription
--outputstdoutWrite file to this path

List canvases in the current workspace.

Terminal window
canvasmesh list [--type <type>] [--limit <n>] [--json]
FlagDefaultDescription
--type(all)Filter by file type (e.g. png, pdf, html)
--limit20Maximum number of results
--json(off)Emit JSON instead of a table

Create a public share link.

Terminal window
canvasmesh share <canvas-id> [--expires <duration>]

--expires accepts duration strings: 30m, 24h, 7d. Omit for a link that never expires.

Open a canvas in the default browser.

Terminal window
canvasmesh view <canvas-id>

Supports macOS, Windows, and Linux (xdg-open).

Download a file from a public share link. Requires authentication.

Terminal window
canvasmesh download <share-url-or-token> [--output <path>] [--info]
FlagDefaultDescription
--output<title>.<ext>Output file path
--info(off)Print canvas metadata as JSON without downloading
VariableDescription
CANVAS_API_KEYOverrides stored token
CANVAS_ENDPOINTOverrides stored endpoint
CANVAS_WEB_URLOverrides stored web URL

Environment variables take precedence over ~/.canvasmesh/config.json.

PathDescription
~/.canvasmesh/config.jsonCredentials and endpoint configuration
~/.canvasmesh/cli.logCommand and API request log with timing
CodeMeaning
0Success
1Generic error