# Command line

URL: https://neattrim.com/docs/cli

Run Neattrim tools from a terminal, on your own computer or in the cloud.

> **Not on npm yet.** `@neattrim/cli` is built and tested but not published: it arrives with the first client release, listed in the [changelog](https://neattrim.com/docs/changelog). Until then, run tools with the [REST API](https://neattrim.com/docs/quickstart) or on the website.

```bash
npx @neattrim/cli compress in.mp4 --target 25mb
```

Media commands run on your own computer by default, with your own FFmpeg. A result is a new file next to the input, and nothing is overwritten. The CLI uses the cloud when you add `--cloud`, when a tool has no on-device engine (every AI tool), or when the input is an `https://` URL or a Neattrim file id. It says on stderr when it uploads a file.

```bash
neattrim trim in.mp4 --start 5 --end 12.5
neattrim transcribe talk.mp3
neattrim tools
```

`neattrim tools` lists every command and where it runs. Every input property of a tool is a flag, so `neattrim compress --help` shows the options.

## Sign in

`neattrim login` starts an OAuth device flow and stores the token in your system keychain. Set `NEATTRIM_API_KEY` instead on a system with no keychain. A key takes priority over a stored login.

## Exit codes

The exit code tells a script what went wrong. `0` is done, `3` is not signed in, `6` is a plan or allowance problem, `7` means try again later and `8` means the input was refused. `neattrim --help` lists all of them. Add `--json` for machine-readable results.
