Skip to content

Command Reference

Every command accepts these flags:

FlagShortDefaultDescription
--json-jfalseOutput as JSON (auto-enabled when stdout is not a TTY)
--profile-pfrom configUse a specific login profile
--endpoint-efrom profileRoute through a specific S3 endpoint
--quiet-qfalseSuppress non-essential output
--no-colorfalseDisable colored output
--debugfalsePrint HTTP request/response details

Authenticate with a Sairo instance.

Terminal window
# Interactive login
sairo login https://sairo.example.com
# API token (for CI/CD)
sairo login https://sairo.example.com --token sairo_abc123...
# Named profile
sairo login https://staging.example.com --profile staging
FlagDescription
--token <string>Use an API token instead of username/password
--profile <name>Save as named profile

Clear stored credentials.

Terminal window
sairo logout # Current profile
sairo logout --all # All profiles

Show session info, server health, and bucket summary.

Terminal window
sairo status
sairo status --json

These commands query Sairo’s SQLite FTS5 index — results return in milliseconds regardless of bucket size.

List buckets, folders, or objects.

Terminal window
sairo ls # All buckets
sairo ls my-bucket/ # Top-level objects
sairo ls my-bucket/logs/ -l # Long format (size, date)
sairo ls my-bucket/data/ -r --sort size # Recursive, sorted by size
sairo ls my-bucket/ --fresh # Bypass index, query S3 directly
FlagShortDefaultDescription
--long-lfalseShow size and date
--recursive-rfalseList all objects under prefix
--sort-snameSort by: name, size, date
--reversefalseReverse sort order
--freshfalseBypass index, query S3 directly
--limit-n0Limit results (0 = unlimited)

Full-text search across indexed object keys.

Terminal window
sairo search my-bucket "parquet"
sairo search my-bucket "config" --prefix settings/ -l
sairo search my-bucket "2026-03" --limit 50
FlagShortDefaultDescription
--prefix""Restrict search to a prefix
--limit-n200Maximum results
--long-lfalseShow size and date

Show disk usage (like du -sh), using pre-computed index stats.

Terminal window
sairo du my-bucket -d 1
sairo du my-bucket/logs/ --sort size --top 10
FlagShortDefaultDescription
--depth-d1Folder depth for breakdown
--sort-ssizeSort by: size, name, count
--top-n0Show only top N entries

Show detailed object metadata. For Parquet/ORC/Avro files, includes schema info.

Terminal window
sairo info my-bucket/data/events.parquet
sairo info my-bucket/config/app.yaml

Display directory tree structure.

Terminal window
sairo tree my-bucket/logs/ -d 2 --size
sairo tree my-bucket/ --dirs-only
FlagShortDefaultDescription
--depth-d3Max depth to display
--dirs-onlyfalseOnly show directories
--sizefalseShow folder sizes

Download objects with progress display.

Terminal window
sairo get my-bucket/report.pdf ./
sairo get my-bucket/exports/ ./local/ -r --parallel 8
sairo get my-bucket/config.yaml ./config.yaml --version abc123
FlagShortDefaultDescription
--recursive-rfalseDownload all objects under prefix
--version-v""Download a specific version
--parallel4Concurrent downloads (recursive)
--overwritefalseOverwrite existing files
--dry-runfalseShow what would be downloaded

Upload files with progress display.

Terminal window
sairo put ./data.csv my-bucket/uploads/
sairo put ./reports/ my-bucket/reports/2026/ -r
FlagShortDefaultDescription
--recursive-rfalseUpload directory contents
--parallel4Concurrent uploads
--dry-runfalseShow what would be uploaded
--exclude""Glob pattern to exclude

Server-side copy (no download).

Terminal window
sairo cp my-bucket/a.txt my-bucket/b.txt
sairo cp my-bucket/data/ other-bucket/data/ -r
FlagShortDefaultDescription
--recursive-rfalseCopy all objects under prefix

Rename or move objects (server-side copy + delete).

Terminal window
sairo mv my-bucket/old-name.log my-bucket/new-name.log

Delete objects with safety confirmation.

Terminal window
sairo rm my-bucket/temp/file.txt
sairo rm my-bucket/old-data/ -r -f
sairo rm my-bucket/archive/ -r --purge-versions --force
FlagShortDefaultDescription
--recursive-rfalseDelete all objects under prefix
--force-ffalseSkip confirmation
--purge-versionsfalseAlso delete all old versions
--dry-runfalseShow what would be deleted

Print object contents to stdout.

Terminal window
sairo cat my-bucket/config/app.yaml
sairo cat my-bucket/logs/app.log --tail 1000 | grep ERROR
FlagDefaultDescription
--head0Show first N bytes
--tail0Show last N bytes
--max5MBMax bytes to fetch

Generate a presigned URL for sharing.

Terminal window
sairo presign my-bucket/report.pdf --expires 86400
FlagShortDefaultDescription
--expires3600Expiry in seconds (60-604800)
--version-v""Presign a specific version

List all versions of an object.

Terminal window
sairo versions my-bucket/config/app.yaml

sairo restore <bucket>/<key> --version <id>

Section titled “sairo restore <bucket>/<key> --version <id>”

Restore a previous version as latest.

Terminal window
sairo restore my-bucket/config/app.yaml --version abc123
FlagShortDescription
--version-vVersion ID to restore (required)

Permanently delete all versions and delete markers.

Terminal window
sairo purge my-bucket/old-file.txt --force
sairo purge my-bucket/old-data/ -r --force
FlagShortDefaultDescription
--force-ffalseSkip confirmation
--recursive-rfalsePurge all objects under prefix

sairo versioning <bucket> [enable|suspend|status]

Section titled “sairo versioning <bucket> [enable|suspend|status]”
Terminal window
sairo versioning my-bucket # Show status
sairo versioning my-bucket enable # Enable versioning
sairo versioning my-bucket suspend # Suspend versioning
Terminal window
sairo lifecycle my-bucket # Show rules
sairo lifecycle my-bucket set --file rules.json
sairo lifecycle my-bucket delete
FlagDefaultDescription
--file""JSON file containing lifecycle rules (for set)

sairo tags <bucket>[/<key>] [get|set|delete]

Section titled “sairo tags <bucket>[/<key>] [get|set|delete]”
Terminal window
sairo tags my-bucket # Bucket tags
sairo tags my-bucket/file.txt # Object tags
sairo tags my-bucket set env=production team=data # Set bucket tags
sairo tags my-bucket/file.txt delete # Remove object tags

Create or remove buckets.

Terminal window
sairo mb new-bucket
sairo rb old-bucket --force
FlagShortDescription
--force-f(rb only) Skip confirmation

Watch for changes in real-time (polls at an interval, diffs against previous state).

Terminal window
sairo watch my-bucket/logs/ -i 30
FlagShortDefaultDescription
--interval-i30Poll interval in seconds
--filter-f""Glob pattern to filter

Show what changed in a prefix over a time period.

Terminal window
sairo diff my-bucket/logs/ --since 24h
sairo diff my-bucket/data/ --since 7d --type added
FlagShortDefaultDescription
--since-s24hTime window (1h, 7d, 30d)
--type-tallFilter: added, removed, modified

Print the CLI version, commit hash, and build date.

Terminal window
sairo version
sairo version --json

CodeMeaning
0Success
1General error
2Authentication error
3Permission denied
4Not found
5User cancelled
OSBackend
macOSKeychain
Linuxlibsecret (GNOME Keyring / KWallet)
WindowsCredential Manager

Fallback: ~/.config/sairo/credentials with 0600 permissions (when no keyring is available).

Environment variable: SAIRO_TOKEN for CI/CD use.