Skip to content

Commit c33d06d

Browse files
authored
Merge pull request #12 from UniverLab/feature/status-and-wizard-improvements
Feature/status and wizard improvements
2 parents 8d30dd9 + 6828101 commit c33d06d

10 files changed

Lines changed: 1245 additions & 80 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5+
workflow_dispatch:
56

67
jobs:
78
rust-ci:

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ path = "src/main.rs"
1515
[dependencies]
1616
anyhow = "1"
1717
clap = { version = "4", features = ["derive"] }
18+
serde = { version = "1", features = ["derive"] }
19+
toml = "0.8"
1820
ureq = "2"
1921

2022
[dev-dependencies]

README.md

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ Set up a git repo the way you actually work — one guided flow for hooks, `.git
3232
## Features
3333

3434
- **🪄 Guided repo setup** — Configure hooks, `.gitignore`, `.gitattributes`, and git config in one interactive flow.
35+
- **📊 Status overview** — See what's currently configured with `gitkit status`.
3536
- **🔁 Clone and bootstrap** — Clone a repo and drop straight into the setup wizard.
3637
- **🧰 Hook management** — Install, list, show, or remove built-in hooks, or wire up your own command.
3738
- **🧩 Ignore and attribute presets** — Browse built-in and gitignore.io templates, then apply line-ending or binary presets.
38-
- **⚙️ Curated git config** — Apply practical presets like auto-upstream, autocorrect, histogram diffs, zdiff3, rerere, and delta pager setup.
39+
- **⚙️ Curated git config** — Apply practical presets with `--global` or `--local` scope, with idempotency detection.
40+
- **💾 Save & reuse builds** — Save configurations and apply them to any project with one command.
3941
- **📦 Single binary** — No Node.js, no Python, no extra runtime.
4042

4143
---
@@ -84,18 +86,24 @@ Remove-Item "$env:LOCALAPPDATA\gitkit\gitkit.exe" -Force
8486

8587
## Quick Start
8688

87-
**Clone and configure a repo in one command:**
89+
**Run the wizard (no arguments needed):**
8890

8991
```bash
90-
gitkit clone https://github.com/user/repo
92+
gitkit
9193
```
9294

93-
Or configure an existing repo:
95+
Or explicitly:
9496

9597
```bash
9698
gitkit init
9799
```
98100

101+
**Clone and configure a repo in one command:**
102+
103+
```bash
104+
gitkit clone https://github.com/user/repo
105+
```
106+
99107
Or use commands directly:
100108

101109
```bash
@@ -107,21 +115,58 @@ gitkit config apply defaults
107115

108116
---
109117

118+
## `gitkit status`
119+
120+
Show what's currently configured in your repo and globally.
121+
122+
```bash
123+
gitkit status
124+
```
125+
126+
**Output example:**
127+
128+
```
129+
Hooks:
130+
✓ conventional-commits (commit-msg)
131+
✓ custom: pre-push → "cargo test"
132+
133+
.gitignore:
134+
✓ 14 patterns
135+
136+
.gitattributes:
137+
✓ line-endings (eol=lf)
138+
139+
Git config (local):
140+
(none)
141+
142+
Git config (global):
143+
✓ push.autoSetupRemote = true
144+
✓ help.autocorrect = prompt
145+
✓ diff.algorithm = histogram
146+
```
147+
148+
---
149+
110150
## `gitkit init`
111151

112-
Interactive wizard that guides you through configuring a repo step by step.
152+
Interactive wizard that guides you through configuring a repo step by step. Shows what's already configured and allows removal.
113153

114-
- Hooks — built-ins pre-selected, or add a custom command
154+
- Hooks — shows installed hooks, pre-selects them, allows removal
115155
- `.gitignore` — filterable search across all gitignore.io templates + built-ins
116156
- `.gitattributes` — line endings and binary file presets
117-
- Git config — 6 individual options, recommended ones pre-selected
157+
- Git config — shows current values, allows removal
158+
- Custom hooks — interactive picker for hook type selection
118159

119-
Automatically initializes a git repository if one doesn't exist:
160+
Run without arguments or explicitly:
120161

121162
```bash
163+
gitkit
164+
# or
122165
gitkit init
123166
```
124167

168+
Automatically initializes a git repository if one doesn't exist.
169+
125170
---
126171

127172
## `gitkit clone`
@@ -194,6 +239,50 @@ The wizard runs automatically after cloning, allowing you to configure hooks, `.
194239
| `gitkit config apply defaults` | `push.autoSetupRemote`, `help.autocorrect`, `diff.algorithm` |
195240
| `gitkit config apply advanced` | `merge.conflictstyle zdiff3`, `rerere.enabled` |
196241
| `gitkit config apply delta` | `core.pager delta` (requires `cargo`) |
242+
| `gitkit config show` | Show current git config values |
243+
244+
**Scope options:**
245+
246+
- `--global` — Apply to global git config (all repos)
247+
- `--local` — Apply to local repo config only
248+
- Default: `--local` if in a repo, `--global` otherwise
249+
250+
**Idempotency:**
251+
252+
Configs already set with the same value show `(already set)` and are skipped.
253+
254+
```bash
255+
$ gitkit config apply defaults --global
256+
✓ push.autoSetupRemote = true (already set)
257+
✓ help.autocorrect = prompt (already set)
258+
✓ diff.algorithm = histogram (already set)
259+
260+
All configs already applied.
261+
```
262+
263+
### Build
264+
265+
Save and reuse configurations across projects.
266+
267+
| Command | Description |
268+
|---|---|
269+
| `gitkit build list` | List saved builds |
270+
| `gitkit build save <name>` | Save current repo config as a build |
271+
| `gitkit build apply <name>` | Apply a saved build |
272+
| `gitkit build delete <name>` | Delete a saved build |
273+
274+
**Example:**
275+
276+
```bash
277+
# Save current configuration
278+
gitkit build save rust-dev --description "Rust development setup"
279+
280+
# Apply to another project
281+
cd /path/to/other/project
282+
gitkit build apply rust-dev
283+
```
284+
285+
Builds are saved to `~/.gitkit/builds/` as TOML files.
197286

198287
---
199288

0 commit comments

Comments
 (0)