Command line

Every phantomdisk command, how paths and drives are written, and what the exit codes mean.

phantomdisk is one file for macOS and Linux. It signs in with a key from PHANTOMDISK_KEY, or with phantomdisk login (a code sent to your email).

Paths

A path starts at the drive’s top folder: /notes/plan.md. To name another drive, put its name or id and a colon first: experiment:/notes/plan.md. Lists take --json. A time is a date (RFC 3339), a unix timestamp, or an age such as 30m, 1h or 2d.

Commands

CommandWhat it does
ls [<drive>:]<path>What is in a folder
search <words>... [--kind <kinds>] [-n <count>] [--keywords]Find files by what is inside them. Only on a Mac with the app and its Search turned on; --keywords matches the words only, not the meaning
get <remote> [<local>|-] [-f]Download a file; - writes to standard output; -f replaces a local file
put [-r] <local>... <remote-folder>Upload files (or folders with -r) into an existing folder. Resumes where a broken upload stopped
mkdir <remote>Make a folder and the folders above it
mv <from> <to>Rename or move. To another drive, the item is copied there without copying data and the original goes to Recently Deleted
rm [-r] <remote>Move to Recently Deleted
history <path> [--at <time>]A file’s versions
show <path> --version <id> | --at <time> [-o <file>]An old version’s content
restore <path> --version <id> | --at <time>Make an old version current again
rollback <folder> --at <time> [--dry-run] [--yes]Put a folder, or the whole drive, back as it was at a time
drivesThe drives you can use
drive create <name>A new, empty drive
drive fork <drive> <name>A new drive with everything in another; no data is copied
drive rename <drive> <name>Rename a drive (needs phantomdisk login)
drive delete <drive>Delete a drive, once you have typed its name (needs phantomdisk login). It can be restored for 30 days
keys create --label <text> [--access read|write] [--drive <drive>]...Make an access key (needs phantomdisk login)
keys listYour keys
keys revoke <id>Turn a key off
mcp [--drive <drive>] [--read-only]The MCP server
uploadsUploads waiting or under way; uploads cancel <id> or --all stops them
statusAccount, drive, storage used, uploads waiting
login, logout, whoamiSign in with an email code or a key, sign out, show who is signed in
cache clearEmpty the local cache of file data

Settings

VariableMeaning
PHANTOMDISK_KEYAn access key. With it, no login is needed
PHANTOMDISK_HOMEWhere the tool keeps its state and cache (default ~/.config/phantomdisk). Give each agent its own

Exit codes

0 done. 1 it ran and failed: one plain sentence on standard error. 2 the command line was wrong.

Next: SDKs