# CLI

Use the Restory CLI when agents need local file upload, structured JSON output, and portable shell workflows.

## Fast links

- Web page: https://www.restory.pics/agent/docs/cli
- Markdown: https://www.restory.pics/api/agent/docs/markdown/cli
- Capabilities JSON: https://www.restory.pics/api/agent/capabilities
- OpenAPI JSON: https://www.restory.pics/api/agent/openapi
- API keys: https://www.restory.pics/agent

## Install

```bash
npm install -g @restory/cli
```

## Commands

```bash
restory capabilities
restory credits
restory restore --method fast --file ./photo.jpg
restory image:generate --prompt "UGC product photo" --model nano-banana-2 --resolution 2K
restory video:generate --prompt "slow cinematic push in" --model seedance-2-0 --image ./restored.jpg --duration 8
restory jobs:get <id> --type image
restory gallery:list --type image --status completed --limit 10
```

## File handling

The CLI uploads local references when needed and passes Restory CDN URLs to generation endpoints.

## JSON output

Every command prints JSON. Agents should parse JSON fields instead of scraping terminal text.