{"id":38964214,"url":"https://github.com/rustfs/cli","last_synced_at":"2026-05-25T03:04:55.725Z","repository":{"id":332364283,"uuid":"1132162998","full_name":"rustfs/cli","owner":"rustfs","description":"A S3-compatible command-line client written in Rust.","archived":false,"fork":false,"pushed_at":"2026-05-22T13:08:23.000Z","size":745,"stargazers_count":77,"open_issues_count":6,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-22T18:44:48.080Z","etag":null,"topics":["rustfs","s3-cli","s3-client"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-11T13:01:15.000Z","updated_at":"2026-05-22T02:01:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rustfs/cli","commit_stats":null,"previous_names":["rustfs/cli"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/rustfs/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustfs%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustfs%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustfs%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustfs%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustfs","download_url":"https://codeload.github.com/rustfs/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustfs%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33423284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rustfs","s3-cli","s3-client"],"created_at":"2026-01-17T16:27:43.760Z","updated_at":"2026-05-25T03:04:55.719Z","avatar_url":"https://github.com/rustfs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# rc - Rust S3 CLI Client\n\n[![CI](https://github.com/rustfs/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/rustfs/cli/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-APACHE)\n[![Crates.io](https://img.shields.io/crates/v/rustfs-cli.svg)](https://crates.io/crates/rustfs-cli)\n[![Docs.rs](https://docs.rs/rustfs-cli/badge.svg)](https://docs.rs/rustfs-cli)\n\nA S3-compatible command-line client written in Rust.\n\n## Features\n\n- 🚀 **High Performance** - Written in Rust with async concurrent operations\n- 🔧 **S3 Compatible** - Supports RustFS, MinIO, AWS S3, and other S3-compatible services\n- 📦 **Cross-Platform** - Supports Linux, macOS, and Windows\n- 🎨 **Friendly Output** - Human-readable and JSON format output\n- 🔒 **Secure** - Secure credential storage, no sensitive data in logs\n\n## Installation\n\n### Binary Download\n\nDownload the appropriate binary for your platform from the [Releases](https://github.com/rustfs/cli/releases) page.\nOn Linux, use the default `linux-amd64` / `linux-arm64` artifacts for maximum compatibility (`musl` static build).\nIf you specifically need glibc-linked builds, use `linux-amd64-gnu` / `linux-arm64-gnu`.\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew install rustfs/tap/rc\n```\n\n### Scoop (Windows)\n\n```powershell\nscoop bucket add rustfs https://github.com/rustfs/scoop-bucket\nscoop install rustfs/rc\n```\n\n### Cargo\n\n```bash\ncargo install rustfs-cli\n```\n\n### Docker\n\n```bash\n# Show help\ndocker run --rm rustfs/rc:latest --help\n\n# Run a command with a local RustFS instance\ndocker run --rm --network host rustfs/rc:latest \\\n  alias set local http://localhost:9000 accesskey secretkey\n```\n\n### Build from Source\n\n```bash\ngit clone https://github.com/rustfs/cli.git\ncd cli\ncargo build --release\n```\n\n## Quick Start\n\n### Configure Aliases\n\n```bash\n# Add local S3 service\nrc alias set local http://localhost:9000 accesskey secretkey\n\n# Add AWS S3\nrc alias set s3 https://s3.amazonaws.com AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\n\n# List all aliases\nrc alias list\n```\n\n### Basic Operations\n\n```bash\n# List buckets\nrc ls local/\n\n# Create bucket\nrc mb local/my-bucket\n\n# Upload file\nrc cp ./file.txt local/my-bucket/\n\n# Download file\nrc cp local/my-bucket/file.txt ./\n\n# View object info\nrc stat local/my-bucket/file.txt\n\n# Delete object\nrc rm local/my-bucket/file.txt\n\n# Delete bucket\nrc rb local/my-bucket\n```\n\n### Advanced Operations\n\n```bash\n# Recursively copy directory\nrc cp -r ./local-dir/ local/bucket/remote-dir/\n\n# Mirror between S3 locations\nrc mirror local/bucket1/ local/bucket2/\n\n# Find objects\nrc find local/bucket --name \"*.txt\" --newer 1d\n\n# List anonymous access rules\nrc anonymous list local/bucket\n\n# Set anonymous access level\nrc anonymous set public local/bucket/public\n\n# Generate download link\nrc share download local/bucket/file.txt --expire 24h\n\n# View directory tree\nrc tree local/bucket -L 3\n```\n\n### Admin Operations (IAM)\n\n```bash\n# List users\nrc admin user list local/\n\n# Add a new user\nrc admin user add local/ newuser secretpassword\n\n# Create a policy\nrc admin policy create local/ readonly --file policy.json\n\n# Attach policy to user\nrc admin policy attach local/ readonly --user newuser\n\n# Create a service account (access_key + secret_key)\nrc admin service-account create local/ AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\n\n# Create a service account with inline policy file\nrc admin service-account create local/ SAKEY123 SASECRET123 --policy ./service-account-policy.json\n\n# Manage bucket event notifications\nrc event add local/my-bucket arn:aws:sns:us-east-1:123456789012:topic --event 's3:ObjectCreated:*'\nrc event list local/my-bucket\nrc event remove local/my-bucket arn:aws:sns:us-east-1:123456789012:topic\n\n# Manage bucket CORS configuration\nrc bucket cors list local/my-bucket\nrc bucket cors get local/my-bucket\nrc bucket cors set local/my-bucket cors.xml\ncat cors.xml | rc bucket cors set local/my-bucket -\nrc bucket cors set local/my-bucket --file cors.json\nrc cors remove local/my-bucket\n```\n\n### Lifecycle (ILM) Operations\n\n```bash\n# Add lifecycle rule: expire objects after 30 days with prefix filter\nrc ilm rule add local/my-bucket --expiry-days 30 --prefix \"logs/\"\n\n# Add lifecycle rule: transition to remote tier after 90 days\nrc ilm rule add local/my-bucket --transition-days 90 --storage-class WARM\n\n# List lifecycle rules\nrc ilm rule list local/my-bucket\n\n# Edit an existing rule\nrc ilm rule edit local/my-bucket --id rule-abc123 --expiry-days 60\n\n# Remove a specific rule or all rules\nrc ilm rule remove local/my-bucket --id rule-abc123\nrc ilm rule remove local/my-bucket --all\n\n# Export/import lifecycle configuration (JSON)\nrc ilm rule export local/my-bucket \u003e lifecycle.json\nrc ilm rule import local/my-bucket lifecycle.json\n\n# Manage remote storage tiers\nrc ilm tier add rustfs WARM local --endpoint http://remote:9000 --access-key ak --secret-key sk --bucket warm-bucket\nrc ilm tier list local\nrc ilm tier info WARM local\nrc ilm tier remove WARM local --force\n\n# Restore a transitioned (archived) object\nrc ilm restore local/my-bucket/archived-file.dat --days 7\n```\n\n### Bucket Replication\n\n```bash\n# Replication requires versioning on both source and destination buckets\nrc version enable local/my-bucket\nrc version enable remote/target-bucket\n\n# Configure a remote alias with the destination RustFS endpoint URL.\n# rc normalizes the remote target endpoint to the host:port form expected by\n# the RustFS admin API when creating replication targets.\nrc alias set remote http://remote:9000 ACCESS_KEY SECRET_KEY\n\n# Add a replication rule\nrc replicate add local/my-bucket \\\n  --remote-bucket remote/target-bucket \\\n  --priority 1 \\\n  --replicate delete,delete-marker,existing-objects\n\n# List replication rules\nrc replicate list local/my-bucket\n\n# View replication status/metrics\nrc replicate status local/my-bucket\n\n# Update a replication rule\nrc replicate update local/my-bucket --id rule-1 --priority 2\n\n# Remove replication rules\nrc replicate remove local/my-bucket --id rule-1\nrc replicate remove local/my-bucket --all\n\n# Export/import replication configuration (JSON)\nrc replicate export local/my-bucket \u003e replication.json\nrc replicate import local/my-bucket replication.json\n```\n\n### Admin Operations (Cluster)\n\n```bash\n# Cluster information\nrc admin info cluster local\nrc admin info server local\nrc admin info disk local --offline\n\n# Heal operations\nrc admin heal status local\nrc admin heal start local --bucket mybucket --scan-mode deep\nrc admin heal start local --dry-run\nrc admin heal stop local\n\n# Pool expansion and decommission workflows\nrc admin pool list local\nrc admin pool status local 1 --by-id\nrc admin expand start local\nrc admin expand status local\nrc admin expand stop local\nrc admin decommission start local '/data/pool1/disk{1...4}'\nrc admin decommission status local '/data/pool1/disk{1...4}'\nrc admin decommission cancel local 1 --by-id\n\n# Rebalance data after adding server pools\nrc admin rebalance start local\nrc admin rebalance status local\nrc admin rebalance stop local\n\n# JSON output\nrc admin info cluster local --json\nrc admin heal status local --json\nrc admin rebalance status local --json\n```\n\n## Command Overview\n\nFor full command documentation, see the [`rc` command reference](docs/reference/rc/README.md).\n\n| Command       | Description                                                                  |\n|---------------|------------------------------------------------------------------------------|\n| `alias`       | Manage storage service aliases                                               |\n| `admin`       | Manage IAM users, policies, groups, service accounts, and cluster operations |\n| `ls`          | List buckets or objects                                                      |\n| `mb`          | Make bucket                                                                  |\n| `rb`          | Remove bucket                                                                |\n| `cp`          | Copy objects                                                                 |\n| `mv`          | Move objects                                                                 |\n| `rm`          | Remove objects                                                               |\n| `cat`         | Display object contents                                                      |\n| `head`        | Display first N lines of object                                              |\n| `stat`        | Display object metadata                                                      |\n| `find`        | Find objects                                                                 |\n| `anonymous`   | Manage anonymous access to buckets and objects                               |\n| `diff`        | Compare two locations                                                        |\n| `mirror`      | Mirror sync between S3 locations                                             |\n| `tree`        | Tree view display                                                            |\n| `share`       | Generate presigned URLs                                                      |\n| `event`       | Manage bucket event notifications                                            |\n| `cors`        | Manage bucket CORS configuration                                             |\n| `pipe`        | Upload from stdin                                                            |\n| `version`     | Manage bucket versioning                                                     |\n| `tag`         | Manage bucket and object tags                                                |\n| `quota`       | Manage bucket quota                                                          |\n| `ilm`         | Manage lifecycle rules, storage tiers, and object restore                    |\n| `replicate`   | Manage bucket replication                                                    |\n| `completions` | Generate shell completion scripts                                            |\n\n### Admin Subcommands\n\n| Command                 | Description                                                                           |\n|-------------------------|---------------------------------------------------------------------------------------|\n| `admin user`            | Manage IAM users (add, remove, list, info, enable, disable)                           |\n| `admin policy`          | Manage IAM policies (create, remove, list, info, attach)                              |\n| `admin group`           | Manage IAM groups (add, remove, list, info, enable, disable, add-members, rm-members) |\n| `admin service-account` | Manage service accounts (create, remove, list, info)                                  |\n| `admin info`            | Display cluster information (cluster, server, disk)                                   |\n| `admin heal`            | Manage cluster healing operations (status, start, stop)                               |\n| `admin pool`            | List pools and inspect expansion/decommission status                                  |\n| `admin expand`          | Manage post-expansion data rebalancing (start, status, stop)                          |\n| `admin decommission`    | Manage server pool decommissioning (start, status, cancel)                            |\n| `admin rebalance`       | Manage post-expansion rebalancing (start, status, stop)                               |\n\n### ILM Subcommands\n\n| Command           | Description                              |\n|-------------------|------------------------------------------|\n| `ilm rule add`    | Add a lifecycle rule to a bucket         |\n| `ilm rule edit`   | Edit an existing lifecycle rule          |\n| `ilm rule list`   | List lifecycle rules on a bucket         |\n| `ilm rule remove` | Remove lifecycle rules from a bucket     |\n| `ilm rule export` | Export lifecycle configuration as JSON   |\n| `ilm rule import` | Import lifecycle configuration from JSON |\n| `ilm tier add`    | Add a remote storage tier                |\n| `ilm tier edit`   | Edit tier credentials                    |\n| `ilm tier list`   | List all configured storage tiers        |\n| `ilm tier info`   | Show details for a specific tier         |\n| `ilm tier remove` | Remove a storage tier                    |\n| `ilm restore`     | Restore a transitioned (archived) object |\n\n### Replicate Subcommands\n\n| Command            | Description                                |\n|--------------------|--------------------------------------------|\n| `replicate add`    | Add a new replication rule                 |\n| `replicate update` | Update an existing replication rule        |\n| `replicate list`   | List replication rules for a bucket        |\n| `replicate status` | Show replication status and metrics        |\n| `replicate remove` | Remove replication rules                   |\n| `replicate export` | Export replication configuration as JSON   |\n| `replicate import` | Import replication configuration from JSON |\n\n## Output Format\n\n### Human-Readable (default)\n\n```bash\nrc ls local/bucket\n[2024-01-15 10:30:00]     0B dir/\n[2024-01-15 10:30:00] 1.2MiB file.txt\n```\n\n### JSON Format\n\n```bash\nrc ls local/bucket --json\n```\n\n```json\n{\n  \"items\": [\n    {\n      \"key\": \"dir/\",\n      \"is_dir\": true\n    },\n    {\n      \"key\": \"file.txt\",\n      \"size_bytes\": 1258291,\n      \"size_human\": \"1.2 MiB\",\n      \"is_dir\": false\n    }\n  ],\n  \"truncated\": false\n}\n```\n\n## Shell Completion\n\nGenerate and install shell completion scripts:\n\n### Bash\n\n```bash\nrc completions bash \u003e ~/.bash_completion.d/rc\n# Or add to .bashrc:\n# source \u003c(rc completions bash)\n```\n\n### Zsh\n\n```bash\nrc completions zsh \u003e ~/.zfunc/_rc\n# Ensure ~/.zfunc is in your fpath (add to .zshrc):\n# fpath=(~/.zfunc $fpath)\n# autoload -Uz compinit \u0026\u0026 compinit\n```\n\n### Fish\n\n```bash\nrc completions fish \u003e ~/.config/fish/completions/rc.fish\n```\n\n### PowerShell\n\n```powershell\nrc completions powershell \u003e\u003e $PROFILE\n```\n\n## Configuration\n\nConfiguration file is located at `~/.config/rc/config.toml`:\n\n```toml\nschema_version = 1\n\n[defaults]\noutput = \"human\"\ncolor = \"auto\"\nprogress = true\n\n[[aliases]]\nname = \"local\"\nendpoint = \"http://localhost:9000\"\naccess_key = \"accesskey\"\nsecret_key = \"secretkey\"\nregion = \"us-east-1\"\n```\n\n## Exit Codes\n\n| Code | Description                     |\n|------|---------------------------------|\n| 0    | Success                         |\n| 1    | General error                   |\n| 2    | Usage/path error                |\n| 3    | Network error (retryable)       |\n| 4    | Authentication/permission error |\n| 5    | Resource not found              |\n| 6    | Conflict/precondition failed    |\n| 7    | Feature not supported           |\n| 130  | Interrupted (Ctrl+C)            |\n\n## Compatibility\n\n### Supported Backends\n\n| Backend             | Tier        | Description         |\n|---------------------|-------------|---------------------|\n| RustFS              | Tier 1      | Fully supported     |\n| MinIO               | Tier 2      | Fully supported     |\n| AWS S3              | Tier 3      | Best effort support |\n| Other S3-compatible | Best Effort | No guarantee        |\n\n### Minimum Rust Version\n\n- Rust 1.92 or higher (Edition 2024)\n\n## Development\n\n### Build\n\n```bash\ncargo build --workspace\n```\n\n### Test\n\n```bash\n# Unit tests\ncargo test --workspace\n\n# Integration tests (requires S3-compatible backend)\ndocker compose -f docker/docker-compose.yml up -d\ncargo test --workspace --features integration\ndocker compose -f docker/docker-compose.yml down\n```\n\n### Lint\n\n```bash\ncargo fmt --all --check\ncargo clippy --workspace -- -D warnings\n```\n\n## Contributing\n\nContributions are welcome! Please read [AGENTS.md](AGENTS.md) for development guidelines.\n\n## License\n\nThis project is dual-licensed under MIT or Apache-2.0. See [LICENSE-MIT](LICENSE-MIT)\nand [LICENSE-APACHE](LICENSE-APACHE).\n\n## Acknowledgments\n\n- [MinIO Client (mc)](https://github.com/minio/mc) - Inspiration for CLI design\n- [aws-sdk-s3](https://crates.io/crates/aws-sdk-s3) - AWS S3 SDK for Rust\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustfs%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustfs%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustfs%2Fcli/lists"}