Command Reference
Global Flags
Section titled “Global Flags”Every command accepts these flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--json | -j | false | Output as JSON (auto-enabled when stdout is not a TTY) |
--profile | -p | from config | Use a specific login profile |
--endpoint | -e | from profile | Route through a specific S3 endpoint |
--quiet | -q | false | Suppress non-essential output |
--no-color | false | Disable colored output | |
--debug | false | Print HTTP request/response details |
Session Commands
Section titled “Session Commands”sairo login [url]
Section titled “sairo login [url]”Authenticate with a Sairo instance.
# Interactive loginsairo login https://sairo.example.com
# API token (for CI/CD)sairo login https://sairo.example.com --token sairo_abc123...
# Named profilesairo login https://staging.example.com --profile staging| Flag | Description |
|---|---|
--token <string> | Use an API token instead of username/password |
--profile <name> | Save as named profile |
sairo logout
Section titled “sairo logout”Clear stored credentials.
sairo logout # Current profilesairo logout --all # All profilessairo status
Section titled “sairo status”Show session info, server health, and bucket summary.
sairo statussairo status --jsonIndexed Read Commands
Section titled “Indexed Read Commands”These commands query Sairo’s SQLite FTS5 index — results return in milliseconds regardless of bucket size.
sairo ls [bucket[/prefix]]
Section titled “sairo ls [bucket[/prefix]]”List buckets, folders, or objects.
sairo ls # All bucketssairo ls my-bucket/ # Top-level objectssairo ls my-bucket/logs/ -l # Long format (size, date)sairo ls my-bucket/data/ -r --sort size # Recursive, sorted by sizesairo ls my-bucket/ --fresh # Bypass index, query S3 directly| Flag | Short | Default | Description |
|---|---|---|---|
--long | -l | false | Show size and date |
--recursive | -r | false | List all objects under prefix |
--sort | -s | name | Sort by: name, size, date |
--reverse | false | Reverse sort order | |
--fresh | false | Bypass index, query S3 directly | |
--limit | -n | 0 | Limit results (0 = unlimited) |
sairo search <bucket> <query>
Section titled “sairo search <bucket> <query>”Full-text search across indexed object keys.
sairo search my-bucket "parquet"sairo search my-bucket "config" --prefix settings/ -lsairo search my-bucket "2026-03" --limit 50| Flag | Short | Default | Description |
|---|---|---|---|
--prefix | "" | Restrict search to a prefix | |
--limit | -n | 200 | Maximum results |
--long | -l | false | Show size and date |
sairo du [bucket[/prefix]]
Section titled “sairo du [bucket[/prefix]]”Show disk usage (like du -sh), using pre-computed index stats.
sairo du my-bucket -d 1sairo du my-bucket/logs/ --sort size --top 10| Flag | Short | Default | Description |
|---|---|---|---|
--depth | -d | 1 | Folder depth for breakdown |
--sort | -s | size | Sort by: size, name, count |
--top | -n | 0 | Show only top N entries |
sairo info <bucket>/<key>
Section titled “sairo info <bucket>/<key>”Show detailed object metadata. For Parquet/ORC/Avro files, includes schema info.
sairo info my-bucket/data/events.parquetsairo info my-bucket/config/app.yamlsairo tree <bucket[/prefix]>
Section titled “sairo tree <bucket[/prefix]>”Display directory tree structure.
sairo tree my-bucket/logs/ -d 2 --sizesairo tree my-bucket/ --dirs-only| Flag | Short | Default | Description |
|---|---|---|---|
--depth | -d | 3 | Max depth to display |
--dirs-only | false | Only show directories | |
--size | false | Show folder sizes |
File Operations
Section titled “File Operations”sairo get <bucket>/<key> [local-path]
Section titled “sairo get <bucket>/<key> [local-path]”Download objects with progress display.
sairo get my-bucket/report.pdf ./sairo get my-bucket/exports/ ./local/ -r --parallel 8sairo get my-bucket/config.yaml ./config.yaml --version abc123| Flag | Short | Default | Description |
|---|---|---|---|
--recursive | -r | false | Download all objects under prefix |
--version | -v | "" | Download a specific version |
--parallel | 4 | Concurrent downloads (recursive) | |
--overwrite | false | Overwrite existing files | |
--dry-run | false | Show what would be downloaded |
sairo put <local-path> <bucket>[/prefix]
Section titled “sairo put <local-path> <bucket>[/prefix]”Upload files with progress display.
sairo put ./data.csv my-bucket/uploads/sairo put ./reports/ my-bucket/reports/2026/ -r| Flag | Short | Default | Description |
|---|---|---|---|
--recursive | -r | false | Upload directory contents |
--parallel | 4 | Concurrent uploads | |
--dry-run | false | Show what would be uploaded | |
--exclude | "" | Glob pattern to exclude |
sairo cp <src> <dst>
Section titled “sairo cp <src> <dst>”Server-side copy (no download).
sairo cp my-bucket/a.txt my-bucket/b.txtsairo cp my-bucket/data/ other-bucket/data/ -r| Flag | Short | Default | Description |
|---|---|---|---|
--recursive | -r | false | Copy all objects under prefix |
sairo mv <src> <dst>
Section titled “sairo mv <src> <dst>”Rename or move objects (server-side copy + delete).
sairo mv my-bucket/old-name.log my-bucket/new-name.logsairo rm <bucket>/<key>
Section titled “sairo rm <bucket>/<key>”Delete objects with safety confirmation.
sairo rm my-bucket/temp/file.txtsairo rm my-bucket/old-data/ -r -fsairo rm my-bucket/archive/ -r --purge-versions --force| Flag | Short | Default | Description |
|---|---|---|---|
--recursive | -r | false | Delete all objects under prefix |
--force | -f | false | Skip confirmation |
--purge-versions | false | Also delete all old versions | |
--dry-run | false | Show what would be deleted |
sairo cat <bucket>/<key>
Section titled “sairo cat <bucket>/<key>”Print object contents to stdout.
sairo cat my-bucket/config/app.yamlsairo cat my-bucket/logs/app.log --tail 1000 | grep ERROR| Flag | Default | Description |
|---|---|---|
--head | 0 | Show first N bytes |
--tail | 0 | Show last N bytes |
--max | 5MB | Max bytes to fetch |
sairo presign <bucket>/<key>
Section titled “sairo presign <bucket>/<key>”Generate a presigned URL for sharing.
sairo presign my-bucket/report.pdf --expires 86400| Flag | Short | Default | Description |
|---|---|---|---|
--expires | 3600 | Expiry in seconds (60-604800) | |
--version | -v | "" | Presign a specific version |
Versioning Commands
Section titled “Versioning Commands”sairo versions <bucket>/<key>
Section titled “sairo versions <bucket>/<key>”List all versions of an object.
sairo versions my-bucket/config/app.yamlsairo restore <bucket>/<key> --version <id>
Section titled “sairo restore <bucket>/<key> --version <id>”Restore a previous version as latest.
sairo restore my-bucket/config/app.yaml --version abc123| Flag | Short | Description |
|---|---|---|
--version | -v | Version ID to restore (required) |
sairo purge <bucket>/<key-or-prefix>
Section titled “sairo purge <bucket>/<key-or-prefix>”Permanently delete all versions and delete markers.
sairo purge my-bucket/old-file.txt --forcesairo purge my-bucket/old-data/ -r --force| Flag | Short | Default | Description |
|---|---|---|---|
--force | -f | false | Skip confirmation |
--recursive | -r | false | Purge all objects under prefix |
Bucket Configuration
Section titled “Bucket Configuration”sairo versioning <bucket> [enable|suspend|status]
Section titled “sairo versioning <bucket> [enable|suspend|status]”sairo versioning my-bucket # Show statussairo versioning my-bucket enable # Enable versioningsairo versioning my-bucket suspend # Suspend versioningsairo lifecycle <bucket> [get|set|delete]
Section titled “sairo lifecycle <bucket> [get|set|delete]”sairo lifecycle my-bucket # Show rulessairo lifecycle my-bucket set --file rules.jsonsairo lifecycle my-bucket delete| Flag | Default | Description |
|---|---|---|
--file | "" | JSON file containing lifecycle rules (for set) |
sairo tags <bucket>[/<key>] [get|set|delete]
Section titled “sairo tags <bucket>[/<key>] [get|set|delete]”sairo tags my-bucket # Bucket tagssairo tags my-bucket/file.txt # Object tagssairo tags my-bucket set env=production team=data # Set bucket tagssairo tags my-bucket/file.txt delete # Remove object tagssairo mb <bucket> / sairo rb <bucket>
Section titled “sairo mb <bucket> / sairo rb <bucket>”Create or remove buckets.
sairo mb new-bucketsairo rb old-bucket --force| Flag | Short | Description |
|---|---|---|
--force | -f | (rb only) Skip confirmation |
Live Operations
Section titled “Live Operations”sairo watch <bucket>[/prefix]
Section titled “sairo watch <bucket>[/prefix]”Watch for changes in real-time (polls at an interval, diffs against previous state).
sairo watch my-bucket/logs/ -i 30| Flag | Short | Default | Description |
|---|---|---|---|
--interval | -i | 30 | Poll interval in seconds |
--filter | -f | "" | Glob pattern to filter |
sairo diff <bucket>/<prefix>
Section titled “sairo diff <bucket>/<prefix>”Show what changed in a prefix over a time period.
sairo diff my-bucket/logs/ --since 24hsairo diff my-bucket/data/ --since 7d --type added| Flag | Short | Default | Description |
|---|---|---|---|
--since | -s | 24h | Time window (1h, 7d, 30d) |
--type | -t | all | Filter: added, removed, modified |
Utility Commands
Section titled “Utility Commands”sairo version
Section titled “sairo version”Print the CLI version, commit hash, and build date.
sairo versionsairo version --jsonExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication error |
| 3 | Permission denied |
| 4 | Not found |
| 5 | User cancelled |
Credential Storage
Section titled “Credential Storage”| OS | Backend |
|---|---|
| macOS | Keychain |
| Linux | libsecret (GNOME Keyring / KWallet) |
| Windows | Credential Manager |
Fallback: ~/.config/sairo/credentials with 0600 permissions (when no keyring is available).
Environment variable: SAIRO_TOKEN for CI/CD use.