Skip to content

Commit d8dbeb4

Browse files
hi-leiclaude
andcommitted
feat: add self-update command, update README with install/update docs
- Add `verda update` command: downloads binary from GitHub Releases - `verda update` — update to latest - `verda update --version v1.0.0` — install specific version - `verda update --list` — list available versions - Cross-platform: detects OS/arch, extracts tar.gz or zip - Atomic binary replacement (temp file + rename) - No Go installation required - Update README with update command docs and release link Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d4c0b43 commit d8dbeb4

5 files changed

Lines changed: 467 additions & 0 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,8 @@ dist
357357
tmp/
358358
temp/
359359
tmp-test-*/
360+
361+
# VHS generated output (keep .tape files, ignore output)
362+
vhs/*.gif
363+
vhs/*.mp4
364+
vhs/*.webm

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ go install github.com/verda-cloud/verda-cli/cmd/verda@latest
5454
verda version
5555
```
5656

57+
### Update to latest version
58+
59+
```bash
60+
verda update
61+
```
62+
63+
Or install a specific version:
64+
65+
```bash
66+
verda update --version v1.0.0
67+
```
68+
5769
## Getting Started
5870

5971
### 1. Configure credentials
@@ -102,6 +114,7 @@ Resource Commands:
102114
103115
Other Commands:
104116
settings Manage CLI settings
117+
update Update Verda CLI to latest or specific version
105118
version Print version information
106119
```
107120

@@ -138,6 +151,14 @@ Other Commands:
138151

139152
Available themes: `default`, `dracula`, `catppuccin`, `catppuccin-latte`, `nord`, `tokyonight`, `github-light`, `solarized-light`
140153

154+
### Update
155+
156+
| Command | Description |
157+
|---------|-------------|
158+
| `verda update` | Update to the latest version |
159+
| `verda update --version v1.0.0` | Install a specific version (upgrade or downgrade) |
160+
| `verda update --list` | List available versions |
161+
141162
### Auth
142163

143164
| Command | Description |

internal/verda-cli/cmd/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/settings"
1111
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/sshkey"
1212
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/startupscript"
13+
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/update"
1314
cmdutil "github/verda-cloud/verda-cli/internal/verda-cli/cmd/util"
1415
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/version"
1516
"github/verda-cloud/verda-cli/internal/verda-cli/cmd/vm"
@@ -77,6 +78,7 @@ func NewRootCommand(ioStreams cmdutil.IOStreams) *cobra.Command {
7778
Message: "Other Commands:",
7879
Commands: []*cobra.Command{
7980
settings.NewCmdSettings(f, ioStreams),
81+
update.NewCmdUpdate(f, ioStreams),
8082
version.NewCmdVersion(f, ioStreams),
8183
},
8284
},

0 commit comments

Comments
 (0)