CLI Quickstart
The Sairo CLI brings indexed search and listing to your terminal. Instead of enumerating S3 objects live on every command (like mc or aws s3), it queries Sairo’s pre-built SQLite FTS5 index — returning results in milliseconds regardless of bucket size.
Installation
Section titled “Installation”brew install ashwathstephen/sairo/sairogo install github.com/ashwathstephen/sairo/cli@latestDownload the latest release from GitHub Releases for your platform:
- macOS (ARM):
sairo_*_darwin_arm64.tar.gz - macOS (Intel):
sairo_*_darwin_amd64.tar.gz - Linux (AMD64):
sairo_*_linux_amd64.tar.gz - Linux (ARM64):
sairo_*_linux_arm64.tar.gz - Windows:
sairo_*_windows_amd64.zip
Extract and move to your PATH:
tar xzf sairo_*_darwin_arm64.tar.gzsudo mv sairo /usr/local/bin/Verify installation:
sairo version-
Connect to your Sairo instance:
Terminal window sairo login https://sairo.example.comEnter your username and password when prompted. If 2FA is enabled, you’ll be asked for your TOTP code.
-
Verify the connection:
Terminal window sairo statusProfile: productionServer: https://sairo.example.comUser: admin (admin)Session: expires in 23h 14mVersion: 2.0.0S3: https://s3.amazonaws.com (connected, 12ms)BUCKETS OBJECTS TOTAL SIZE LAST CRAWL─────── ─────── ────────── ──────────4 134,707 38.2 TB 2m ago
Core Commands
Section titled “Core Commands”List buckets and objects
Section titled “List buckets and objects”# List all bucketssairo ls
# List objects in a bucketsairo ls my-bucket/logs/ -l
# Recursive listing (all objects under a prefix)sairo ls my-bucket/data/ -r --sort sizeSearch (indexed full-text search)
Section titled “Search (indexed full-text search)”# Search across a bucket — returns in millisecondssairo search my-bucket "parquet"
# Search within a specific prefixsairo search my-bucket "config" --prefix settings/Download and upload
Section titled “Download and upload”# Download a filesairo get my-bucket/reports/summary.pdf ./
# Upload a filesairo put ./data.csv my-bucket/uploads/
# Recursive downloadsairo get my-bucket/exports/ ./local-dir/ -rStorage analytics
Section titled “Storage analytics”# Disk usage breakdownsairo du my-bucket -d 1
# Object metadatasairo info my-bucket/data/events.parquet
# Directory treesairo tree my-bucket/logs/ -d 2 --sizeFile operations
Section titled “File operations”# Preview file contentssairo cat my-bucket/config/app.yaml
# Generate a presigned URLsairo presign my-bucket/reports/summary.pdf --expires 86400
# Server-side copysairo cp my-bucket/a.txt my-bucket/b.txt
# Delete with confirmationsairo rm my-bucket/old-data/ -rJSON Output
Section titled “JSON Output”Every command supports --json for machine-readable output. JSON mode is auto-enabled when stdout is piped.
# Explicit JSONsairo ls my-bucket/ --json | jq '.files[] | .key'
# Auto-detected (pipe)sairo search my-bucket "parquet" | jq .Multiple Profiles
Section titled “Multiple Profiles”Manage connections to multiple Sairo instances:
# Login with a named profilesairo login https://staging.example.com --profile staging
# Use a specific profilesairo ls my-bucket/ --profile staging
# Switch default profilesairo login https://production.example.com --profile productionAPI Token Authentication
Section titled “API Token Authentication”For CI/CD pipelines, use API tokens instead of interactive login:
# Login with a tokensairo login https://sairo.example.com --token sairo_abc123...
# Or use an environment variableexport SAIRO_TOKEN=sairo_abc123...sairo ls my-bucket/Performance
Section titled “Performance”The CLI queries Sairo’s indexed backend, not S3 directly. On a production bucket with 134K+ objects:
| Operation | mc / aws s3 | sairo | Speedup |
|---|---|---|---|
| List top-level folder | ~3 min | 0.05s | 3,000x+ |
| Recursive list (134K objects) | ~12 min | 4.8s | 150x |
| Search by filename | 3+ min | 0.08s | 2,000x+ |
| Storage breakdown | 3+ min | 0.03s | 6,000x+ |
Next Steps
Section titled “Next Steps”- Command Reference — All 24 commands with flags and examples
- Benchmarks — Full performance data
- API Reference — The REST API the CLI talks to