# The CLI

> Every files command.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://files.docs.sypnia.com/tools/cli/

For agents: Files CLI: login/logout/whoami/use; buckets create|ls|update|rm|import; ls files://bucket/prefix; cp (both ways, -r, resumable); mv, rm; sign --expires; policies ls|apply; s3-keys create|ls|revoke; --json; SYPNIA_FILES_KEY or --key.

| Command                                     | What it does                                                                                 |
| ------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `login` · `logout` · `whoami` · `use <url>` | Sign in (device flow) or point at an engine                                                  |
| `buckets create\|ls\|update\|rm\|import`    | Buckets and their settings                                                                   |
| `ls files://<bucket>/<prefix>`              | List files                                                                                   |
| `cp <src> <dst>`                            | Copy between your disk and Files, either way, recursively with `-r`; resumable for big files |
| `mv`, `rm`                                  | Move and delete                                                                              |
| `sign files://<bucket>/<path> --expires 1h` | Print a signed URL                                                                           |
| `policies ls\|apply <file.sql>`             | Policies                                                                                     |
| `s3-keys create\|ls\|revoke`                | S3 access keys                                                                               |

`--json` on every command; `SYPNIA_FILES_KEY` or `--key` for a secret key instead of the session.
