> ## Documentation Index
> Fetch the complete documentation index at: https://rendermate.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Sync a folder to your workspace's assets, record your screen and camera, and call the API from your terminal.

`rendermate` is a command line tool for macOS, Linux and Windows. Its main job is keeping a folder
in your workspace in step with a folder on your computer.

## Install

```bash theme={null}
curl -fsSL https://rendermate.com/install.sh | sh
```

The script puts `rendermate` in `~/.local/bin`. On macOS, it puts the CLI and its recorder in
`~/.local/lib/rendermate` and links `rendermate` into `~/.local/bin`; keep them together. Check it
with `rendermate --version`.

On Windows, download the Windows build from [rendermate.com](https://rendermate.com/#cli) and put
`rendermate.exe` in a folder on your `PATH`.

## Sign in

```bash theme={null}
rendermate login
```

This opens your browser, where you sign in to rendermate and pick the workspace the CLI acts in.
The CLI then acts as you in that workspace, with what your role there allows. Run `rendermate login`
again to switch workspaces, and `rendermate whoami` to see which one you're in.

To use an API key instead, such as in CI, set `RENDERMATE_API_KEY`, which takes precedence over a
sign-in, or save one:

```bash theme={null}
echo "$RENDERMATE_API_KEY" | rendermate login --with-key
```

`rendermate logout` forgets the saved sign-in or key.

## Sync a folder

```bash theme={null}
rendermate sync ./launch
```

This makes the workspace folder `launch/` match the local folder `./launch`: it uploads new and
changed files, and leaves files that haven't changed alone. Give a second argument to sync to
another workspace folder, or `/` for the workspace's root:

```bash theme={null}
rendermate sync ./launch campaigns/q3
rendermate sync ./site /
```

Files are compared by their SHA-256. A file whose content is already in the workspace, such as a
copy or a renamed file, is recorded without uploading it again. File bytes go straight to storage;
files over 100 MiB upload in parts.

| Option | What it does |
| - | - |
| `--dry-run` | Shows what would change, without changing anything. |
| `--delete` | Also deletes files in the workspace folder that aren't in the local folder. |
| `--watch` | Keeps running, and syncs again whenever a file changes. |
| `--exclude <glob>` | Skips matching files and folders, such as `'*.tmp'` or `'drafts/**'`. Repeatable. |
| `--project <id>` | The project new assets go in; the workspace's default project when absent. |
| `--jobs <n>` | Files hashed and uploaded at once (8 by default). |
| `--json` | Prints the result as JSON. |

`.DS_Store`, `Thumbs.db` and `.git` are always skipped. Sync only deletes files in the workspace
when you pass `--delete`; combine it with `--dry-run` to see what would go first.

The output has a line per file: `+` uploaded, `~` recorded from content the workspace already had,
`-` deleted, and then a summary.

## Record your screen and camera

On macOS, `rendermate record` records the screen, a camera or both, with your microphone, and
uploads them to the workspace as they're recorded:

```bash theme={null}
rendermate record --list-devices
rendermate record --screen main
rendermate record --screen main --camera "MacBook Pro Camera" --duration 5m
```

Press Enter to stop, or `p` and Enter to pause and resume; Ctrl-C also stops. The first time,
macOS asks to let your terminal app record the screen, camera and microphone. After allowing
screen recording, restart the terminal and record again.

Each source is its own file in `recordings/<date and time>/`: `screen.mp4`, `camera.mp4`,
`microphone.m4a` and `system-audio.m4a`, with a `recording.json` that describes them. They all
start at the same moment. The videos are fragmented MP4 files.

| Option | What it does |
| - | - |
| `--screen <display>` | The display to record: `main`, or an ID or name from `--list-devices`. |
| `--camera <camera>` | The camera to record: an ID or part of a name from `--list-devices`. |
| `--mic <microphone>` | The microphone, the first available one by default; `none` for no microphone. |
| `--system-audio` | Also records the computer's sound. |
| `--duration <time>` | Stops after this long, such as `30s`, `5m` or `1h`. |
| `--to <folder>` | The workspace folder the recording goes in. |
| `--project <id>` | The project the assets go in; the workspace's default project when absent. |
| `--keep` | Keeps the local copy after uploading it. |
| `--no-upload` | Records only, and leaves the files on your computer. |
| `--list-devices` | Lists the displays, cameras and microphones. |

## Manage assets

```bash theme={null}
rendermate assets ls launch/          # a folder's files and subfolders; -r for everything under it
rendermate assets get launch/intro.mp4 # download, to ./intro.mp4
rendermate assets put intro.mp4 launch/intro.mp4
rendermate assets mv launch/ archive/launch/
rendermate assets rm launch/old.png
```

## Call the API

`rendermate api` sends any [API](https://rendermate.com/docs/api/overview.md) request with your sign-in or key, and prints the
JSON answer:

```bash theme={null}
rendermate api GET /v1/projects
rendermate api POST /v1/projects --data '{"name": "Launch"}'
rendermate api POST /v1/projects --data @project.json
```

## Configuration

| Variable | What it sets |
| - | - |
| `RENDERMATE_API_KEY` | An API key to use instead of the saved sign-in. |
| `RENDERMATE_API_URL` | The API's address, `https://api.rendermate.com` by default. |
| `RENDERMATE_CONFIG_DIR` | Where the sign-in is saved, the system's config folder (such as `~/.config/rendermate`) by default. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.