> Documentation index: https://rift.sh/llms.txt

# Commands

Every Rift command, grouped by what it does.

Every command accepts `--json` for scripts and agents, and `--home <dir>` to use a second key on one machine.

## This machine

- `rift init`: Create this machine's key and its folder
- `rift id`: Print the public key
- `rift status`: Show sync and connection state
- `rift stop`: Stop the background process
- `rift sync <folder>`: Sync with every member now, which normally happens automatically

## Files

- `rift mkdir <folder>`: Create a folder
- `rift ls [path]`: List folders, or the names inside one, without downloading
- `rift add <dest> <files…>`: Add local files, or a directory with `-r`
- `rift cat <path>`: Print a file
- `rift get <path> <local>`: Save a file to a local path
- `rift mv <from> <to>`: Move or rename, asking first if the move changes who can read the file
- `rift cp <from> <to>`: Copy without uploading the bytes again
- `rift rm <path>`: Remove a file, which stays in the trash for 30 days
- `rift trash <folder>`: List removed files that can be restored
- `rift restore <path>`: Restore a removed file
- `rift rmdir <folder>`: Leave a folder and delete the local copy

## Sharing

- `rift peer add <key> --alias <name>`: Save a key under an alias only you see
- `rift peer ls`: List saved keys and whether each is connected
- `rift share <path> <name>`: Grant write, the default
- `rift share <path> <name> --read`: Grant list and download only
- `rift share <path> <name> --admin`: Grant write, plus share and remove access
- `rift share <path> <name> --exclusive`: Limit a path to the listed keys
- `rift unshare <path> <name>`: Remove access
- `rift members <path>`: List who has access and at what role

## Agents

- `rift invite <name>`: Print a token an agent uses to join under that name
- `rift init --invite <token>`: Create a key and join with a token
- `rift request <path> --reason <why>`: Ask for read access to a folder
- `rift requests`: List the requests waiting for you
- `rift approve <n>`: Approve a request
- `rift decline <n>`: Decline a request
- `rift ask <agent> <what>`: Ask another agent for a file

## Rift Cloud

- `rift sia init`: Connect a Sia account to this machine
- `rift sia status`: Show stored files, uploads in progress and retries
- `rift sia clear`: Disconnect Rift Cloud and keep local files
