--json for scripts and AI agents.
Discover commands
Authenticate without a prompt
On a headless machine or CI runner, configureASPECT_API_KEY through your environment or secret manager. The key authenticates commands directly; there is no separate login step.
aspect auth login without a key argument is an interactive terminal flow; --json disables that prompt.
Authentication follows this order:
- The Aspect desktop app, when it is running and signed in.
ASPECT_API_KEY.- A key saved by
aspect auth login.
aspect auth status --json reports the source as desktop, env, or auth-file, and reports when a key is ignored. A signed-in desktop app that is offline also takes precedence; the CLI does not silently switch to a key.
See authentication for creating keys and managing sign-in.
Make destinations explicit
Include the workspace and project in each remote URL, and quote URLs or local paths that contain spaces:aspect://~/ depends on ASPECT_WORKSPACE, a saved default, or sole workspace membership. Explicit workspace URLs make a job independent of that local configuration. There is no --workspace flag. See paths and workspaces.
Choose conflict behavior deliberately. Uploads and downloads skip existing filenames by default. Use --replace to replace them or --keep-both to preserve both copies. These two flags cannot be combined.
For viewing or analysis, stream proxies can avoid downloading large originals. A directory download omits assets that do not have the selected variant, so check that you received the media your job needs.
Parse JSON and exit codes
With--json:
- stdout contains the JSON result.
- Command errors go to stderr as a JSON error object.
- Interactive prompts and progress bars are disabled. Without
--json, progress is written to stderr only when it is a terminal.
2>&1 before parsing.
An error object has this shape:
error.code; display error.message to the person operating the job. Common codes include usage, not_logged_in, invalid_api_key, not_found, ambiguous_name, api_request_failed, network_timeout, network_unreachable, daemon_error, and daemon_owned_by_desktop.
Exit code
1 can include a normal JSON result on stdout. doctor returns its checks, transfer status and transfer wait return the transfer snapshot, and uploads or downloads with per-file failures return their summary. Check stdout before assuming stderr contains an error object.1:
downloaded instead of uploaded. Skipped files do not make a transfer fail. Treat the exit code as well as the result as significant, and allow additional JSON fields as the CLI evolves.
Run a background transfer
Add--detach when a transfer should outlive the foreground CLI process:
id:
wait blocks until a terminal state. Both commands return the snapshot directly, with fields including:
aspect transfer list --json wraps its snapshots in a transfers array. aspect transfer cancel <id> --json requests cancellation; use wait to collect the terminal outcome.
The runner writes its first snapshot after launch. An immediate status or wait can briefly return transfer_not_found; retry that error briefly for a newly launched ID. Other failures need their own handling.
This Python example starts a proxy download, handles that short startup window, and preserves the final JSON and exit code. It requires Python 3 and aspect on PATH:
Connect AI agents
Install the official CLI skill:npx. It installs the aspect-cli skill from aspect-hq/aspect-cli at user scope for supported agents detected on the machine. The skill teaches authentication, path handling, JSON results, transfers, mounts, and offline pins.
Use the CLI for local files, transfers, proxies, and mounts. Connect the Aspect MCP server for searching and understanding media, transcripts, collections, metadata, comments, and sharing:
Documentation for language models
- CLI documentation index: links to this section’s guides and reference.
- Site documentation index: links across the Aspect documentation.
- Full documentation text: the site’s documentation in a combined text format.
aspect <command> --help --json for the options supported by the installed binary.