Skip to content

Commit 4060459

Browse files
committed
feat(update): add self-update and guided setup
1 parent e1d832f commit 4060459

File tree

13 files changed

+1585
-33
lines changed

13 files changed

+1585
-33
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
77

88
## [Unreleased]
99

10+
## [0.1.4] - 2026-03-11
11+
12+
### Added
13+
- `xgit update` for release checks and self-updates on macOS/Linux.
14+
- Guided first-run setup via `xgit init --wizard` with numbered prompts and readiness hints.
15+
1016
## [0.1.3] - 2026-03-10
1117

1218
### Added

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,31 @@ xgit — AI-powered Git workflows: resolve conflicts, debug regressions, and rev
1515
curl -fsSL https://raw.githubusercontent.com/hjun1052/xgit/main/scripts/install.sh | bash
1616
```
1717

18+
The installer now offers a guided setup wizard by default. For unattended installs, use:
19+
20+
```bash
21+
curl -fsSL https://raw.githubusercontent.com/hjun1052/xgit/main/scripts/install.sh | XGIT_GUIDED_SETUP=never bash
22+
```
23+
1824
### Windows PowerShell
1925

2026
```powershell
2127
irm https://raw.githubusercontent.com/hjun1052/xgit/main/scripts/install.ps1 | iex
2228
```
2329

30+
For unattended installs on Windows:
31+
32+
```powershell
33+
$env:XGIT_GUIDED_SETUP = "never"; irm https://raw.githubusercontent.com/hjun1052/xgit/main/scripts/install.ps1 | iex
34+
```
35+
2436
### From source
2537

2638
```bash
2739
git clone https://github.com/hjun1052/xgit.git
2840
cd xgit
2941
go build -o xgit ./cmd/xgit
30-
./xgit init --provider mock --non-interactive
42+
./xgit init --wizard
3143
```
3244

3345
## Quick demo
@@ -147,6 +159,7 @@ In short: **xgit is not a new VCS**. It is a practical AI layer over the Git you
147159
- `xgit test-fix`: propose and validate fixes for failing tests
148160
- `xgit doc`: generate/update project docs
149161
- `xgit auto`: state-aware automation (conflict/test/diff driven)
162+
- `xgit update`: check the latest release and self-update on macOS/Linux
150163

151164
- **Workflow scaling**
152165
- `xgit alias`: compose multiple xgit commands into one reusable command
@@ -172,8 +185,9 @@ In short: **xgit is not a new VCS**. It is a practical AI layer over the Git you
172185
### 1) Initial setup
173186

174187
```bash
175-
xgit init --provider codex-cli --non-interactive
188+
xgit init --wizard
176189
# or:
190+
xgit init --provider codex-cli --non-interactive
177191
xgit config set provider openai
178192
xgit config set api-key-env openai OPENAI_API_KEY
179193
```
@@ -198,6 +212,9 @@ xgit explain history main..HEAD --limit 40
198212

199213
# Ask xgit which Git commands to run
200214
xgit do-git compare my branch with main before I merge
215+
216+
# Check for the latest release
217+
xgit update --check
201218
```
202219

203220
### 3) High-impact workflows

cmd/alias.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ var reservedAliasNames = map[string]bool{
186186
"alias": true,
187187
"init": true,
188188
"version": true,
189+
"update": true,
189190
"commit": true,
190191
"auto": true,
191192
"enhance": true,

cmd/command_flags_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,20 @@ func TestCommandFlagDefaults(t *testing.T) {
103103
t.Fatalf("expected compare --path default empty, got %v", got)
104104
}
105105
})
106+
107+
t.Run("update defaults", func(t *testing.T) {
108+
c := newUpdateCommand()
109+
if got, _ := c.Flags().GetString("repo"); got != "hjun1052/xgit" {
110+
t.Fatalf("expected update --repo default hjun1052/xgit, got %q", got)
111+
}
112+
if got, _ := c.Flags().GetString("version"); got != "latest" {
113+
t.Fatalf("expected update --version default latest, got %q", got)
114+
}
115+
if got, _ := c.Flags().GetBool("check"); got {
116+
t.Fatalf("expected update --check default false")
117+
}
118+
if got, _ := c.Flags().GetBool("yes"); got {
119+
t.Fatalf("expected update --yes default false")
120+
}
121+
})
106122
}

0 commit comments

Comments
 (0)