feat: completion + README — polish and docs

This commit is contained in:
2026-07-28 16:12:14 +08:00
parent 096492dd82
commit 146ad50295
2 changed files with 68 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
# ry — Multi-Cloud CLI
A `gh`-style CLI for managing cloud resources across providers.
## Install
```bash
go install git.yoresee.cc/nightstar/ry/cmd/ry@latest
```
## Quick Start
```bash
ry provider add rainyun
# Enter your API key when prompted
ry server list
ry server start <id>
ry server vnc <id>
```
## Commands
- `ry provider` — manage cloud providers (add, use, list)
- `ry server` — manage cloud servers (list, get, start, stop, reboot, reinstall, reset-password, vnc)
- `ry domain` — manage domains and DNS records
- `ry storage` — manage object storage and buckets
- `ry billing` — view orders
- `ry config` — manage configuration (show, set, path)
- `ry completion` — shell completion for bash/zsh/fish
## Global Flags
| Flag | Description |
|------|-------------|
| `-p, --provider` | Override cloud provider |
| `-o, --output` | Output format: table, json, yaml |
| `--raw` | Raw API response |
| `--debug` | Debug output |
## Supported Providers
- **雨云 (Rainyun)** — full support
- More coming soon
## Config
`~/.config/ry/config.toml`
+20
View File
@@ -88,4 +88,24 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&flagOutput, "output", "o", "", "Output format: table, json, yaml, raw")
rootCmd.PersistentFlags().BoolVar(&flagRaw, "raw", false, "Output raw API response")
rootCmd.PersistentFlags().BoolVar(&flagDebug, "debug", false, "Enable debug output")
completionCmd := &cobra.Command{
Use: "completion [bash|zsh|fish]",
Short: "Generate shell completion script",
Annotations: map[string]string{"skipProvider": "true"},
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
switch args[0] {
case "bash":
return rootCmd.GenBashCompletion(os.Stdout)
case "zsh":
return rootCmd.GenZshCompletion(os.Stdout)
case "fish":
return rootCmd.GenFishCompletion(os.Stdout, true)
default:
return fmt.Errorf("unsupported shell: %s", args[0])
}
},
}
rootCmd.AddCommand(completionCmd)
}