# Command line

`@o41/artifacts` on npm installs `o41-artifacts`. It does everything the app
does, and answers in JSON with `--json`.

```bash
npx @o41/artifacts login          # Clerk device login in the browser
npx @o41/artifacts org list       # organizations you belong to
npx @o41/artifacts org use <id>   # the one later commands act in
```

## Commands

| Command                    | Does                                                                                          |
| -------------------------- | --------------------------------------------------------------------------------------------- |
| `login`, `logout`          | Sign in with the device flow; tokens are kept on disk and refreshed                           |
| `org`                      | List organizations and choose the active one                                                  |
| `connections`              | Connect AWS, GCP or Azure: print the setup script, complete it with the identifiers it echoed |
| `locations`                | List, create a bucket, add an S3 endpoint, set the fallback or a cloud's default, retire      |
| `api-keys`                 | List, create (the secret is printed once) and revoke organization API keys                    |
| `ls [prefix]`              | Artifacts under a prefix                                                                      |
| `versions <artifact>`      | An artifact's committed versions                                                              |
| `url <full path>`          | Signed download URLs for a version's files; `latest` works as the version                     |
| `get <full path> <dir>`    | Download a version's files                                                                    |
| `put <full path> <files…>` | Write a version from local files                                                              |
| `usage`                    | Writes by place and match, cross-cloud reads                                                  |

`o41-artifacts <command> --help` lists each command's flags.

## Credentials

The CLI uses your login. On a box without a browser, set `O41_ARTIFACTS_API_KEY`
to an organization API key instead; `O41_ARTIFACTS_URL` points it at another
deployment.

---

Artifacts by 041 documentation. Every page: https://artifacts.041.io/llms.txt
