@kroszborg/sugi 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +153 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # sugi
1
+ # sugi
2
2
 
3
- > Terminal UI git client — faster than lazygit, with AI commit messages and GitHub/GitLab PR integration.
3
+ > A terminal UI git client — GitHub/GitLab PRs, AI commit messages, interactive rebase, bisect, worktrees, multi-account management, and more.
4
4
 
5
- ![sugi screenshot](https://github.com/Kroszborg/sugi/raw/master/image.png)
5
+ ![sugi screenshot](https://github.com/Kroszborg/sugi/raw/master/public/image.png)
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```sh
10
- npm install -g @kroszborg/sugi
10
+ npm install -g sugi
11
11
  ```
12
12
 
13
13
  Or via Homebrew:
@@ -22,37 +22,162 @@ go install github.com/Kroszborg/sugi/cmd/sugi@latest
22
22
 
23
23
  ## Usage
24
24
 
25
- Run inside any git repo:
26
-
27
25
  ```sh
28
- sugi
26
+ sugi # open in current git repo
27
+ sugi /path/repo # open a specific repo
28
+ sugi version # print version
29
29
  ```
30
30
 
31
- ## Keybindings
31
+ ## Panels
32
+
33
+ | Panel | Key | Description |
34
+ |-------|-----|-------------|
35
+ | Files | `1` | Stage, unstage, discard, hunk-level staging, multi-select (`ctrl+space`) |
36
+ | Branches | `2` | Checkout, create, rename, delete, merge, rebase, open in browser |
37
+ | Commits | `3` | Log, graph, cherry-pick, revert, reset, interactive rebase, blame |
38
+ | Diff | `4` | Unified diff, hunk navigation, stage/unstage hunks, AI summary |
39
+ | Accounts | `A` | Manage multiple GitHub/GitLab named accounts |
40
+ | PRs / MRs | `P` | GitHub & GitLab pull requests with CI and review badges |
41
+ | Stash | `z` | List, apply, pop, drop stashes with diff preview |
42
+ | Blame | `b` | File blame per line — author, date, hash |
43
+ | Reflog | `R` | Reflog with undo capability |
44
+ | Worktrees | `W` | List, add, remove git worktrees |
45
+ | Remotes | `E` | List, add, remove, fetch remotes |
46
+ | Bisect | `B` | Interactive git bisect session |
47
+ | Interactive Rebase | `i` | Reorder/squash/fixup/drop commits |
48
+ | Conflict Resolver | auto | Opens on conflicted files — pick ours/theirs |
49
+ | File History | `L` | Commits touching the selected file |
50
+ | Command Palette | `ctrl+p`/`alt+p` | Fuzzy search all actions |
51
+ | Help | `?` | Scrollable keybinding reference |
52
+ | Settings | `O` | Edit config in-app, saved instantly |
53
+
54
+ ## Key bindings
55
+
56
+ ### Navigation
57
+ | Key | Action |
58
+ |-----|--------|
59
+ | `tab` / `shift+tab` | cycle panels |
60
+ | `1` `2` `3` `4` | jump to panel |
61
+ | `j` `k` / `↑` `↓` | move up/down |
62
+ | `pgup` / `pgdn` | page up/down |
63
+ | `/` | search / filter |
64
+ | `esc` | back / cancel |
65
+
66
+ ### Files
67
+ | Key | Action |
68
+ |-----|--------|
69
+ | `space` | stage / unstage |
70
+ | `ctrl+space` | multi-select |
71
+ | `a` | stage all |
72
+ | `d` | discard (with confirmation) |
73
+ | `c` | commit form |
74
+ | `ctrl+a` | amend HEAD |
75
+ | `P` / `p` | push / pull |
76
+ | `F` | force push with-lease |
77
+ | `Z` | stash all changes |
78
+ | `L` | file history |
79
+ | `s` | toggle staged/unstaged diff |
80
+
81
+ ### Branches
82
+ | Key | Action |
83
+ |-----|--------|
84
+ | `enter` | checkout |
85
+ | `n` | new branch |
86
+ | `R` | rename branch |
87
+ | `D` | delete branch |
88
+ | `m` | merge into current |
89
+ | `r` | rebase onto branch |
90
+ | `o` | open on GitHub/GitLab |
91
+ | `P` / `p` | push / pull |
92
+
93
+ ### Commits
94
+ | Key | Action |
95
+ |-----|--------|
96
+ | `y` | copy hash |
97
+ | `C` | cherry-pick |
98
+ | `v` | revert |
99
+ | `X` | reset HEAD (soft/mixed/hard) |
100
+ | `i` | interactive rebase |
101
+ | `o` | open on GitHub/GitLab |
102
+ | `g` | toggle graph |
103
+ | `b` | blame at this commit |
104
+ | `R` | reflog |
105
+ | `ctrl+a` | amend HEAD |
106
+
107
+ ### Diff
108
+ | Key | Action |
109
+ |-----|--------|
110
+ | `[` / `]` | prev / next hunk |
111
+ | `space` | stage hunk |
112
+ | `u` | unstage hunk |
113
+ | `s` | toggle staged/unstaged |
114
+ | `ctrl+i` | AI-summarise diff |
115
+
116
+ ### Accounts (`A` — from any panel)
117
+ | Key | Action |
118
+ |-----|--------|
119
+ | `tab` | GitHub / GitLab tab |
120
+ | `enter` | activate account |
121
+ | `n` | add new account |
122
+ | `D` | delete account |
123
+ | `esc` | close |
32
124
 
125
+ ### Global
33
126
  | Key | Action |
34
127
  |-----|--------|
35
- | `1` / `2` / `3` / `4` | Switch panels (Files / Branches / Commits / Diff) |
36
- | `tab` | Next field |
37
- | `s` | Stage / unstage file |
38
- | `c` | Open commit form |
39
- | `ctrl+g` / `alt+g` | Generate AI commit message (requires Groq API key) |
40
- | `ctrl+s` | Commit |
41
- | `b` | Blame view |
42
- | `z` | Stash panel |
43
- | `R` | Reflog |
44
- | `O` | Settings (add Groq API key here) |
45
- | `?` | Help |
46
- | `q` | Quit |
47
-
48
- ## AI Commit Messages
49
-
50
- sugi uses [Groq](https://console.groq.com) (free tier available) to generate conventional commit messages from your staged diff.
51
-
52
- 1. Press `O` to open Settings
53
- 2. Add your Groq API key
128
+ | `c` | commit form |
129
+ | `ctrl+g` / `alt+g` | AI-generate commit message |
130
+ | `ctrl+p` / `alt+p` | command palette |
131
+ | `O` | settings |
132
+ | `?` | help |
133
+ | `q` | quit |
134
+
135
+ ## AI Commit Messages (free)
136
+
137
+ sugi uses [Groq](https://console.groq.com) to generate conventional commit messages from your staged diff.
138
+
139
+ 1. Sign up at [console.groq.com](https://console.groq.com) (free, no credit card)
140
+ 2. Press `O` in sugi → paste your API key in Settings
54
141
  3. Stage your changes, open commit form with `c`
55
- 4. Press `ctrl+g` or `alt+g` to generate
142
+ 4. Press `ctrl+g` (or `alt+g` in VS Code terminal) to generate
143
+
144
+ ## Multi-Account Management
145
+
146
+ Switch between personal and work GitHub/GitLab accounts without editing config:
147
+
148
+ 1. Press `A` to open the Accounts panel
149
+ 2. Press `n` to add a named account (name → token → optional custom host)
150
+ 3. Press `enter` to activate — the active account appears in the status bar as `⬡ name`
151
+ 4. Accounts persist across sessions in `~/.config/sugi/config.json`
152
+
153
+ ## GitHub / GitLab
154
+
155
+ sugi auto-detects the forge from your `origin` remote.
156
+
157
+ **Simple (single account):**
158
+ - **GitHub:** set `GITHUB_TOKEN` or sugi reads from `gh` CLI automatically
159
+ - **GitLab:** set `GITLAB_TOKEN`
160
+
161
+ **Multiple accounts:** use the Accounts panel (`A`) described above.
162
+
163
+ ## Config file
164
+
165
+ `~/.config/sugi/config.json` (auto-created on first run):
166
+
167
+ ```json
168
+ {
169
+ "groq_api_key": "gsk_...",
170
+ "groq_model": "llama-3.1-8b-instant",
171
+ "github_token": "ghp_...",
172
+ "gitlab_token": "",
173
+ "gitlab_host": "",
174
+ "github_accounts": [
175
+ { "name": "personal", "token": "ghp_..." },
176
+ { "name": "work", "token": "ghp_...", "host": "github.company.com" }
177
+ ],
178
+ "active_github_account": "work"
179
+ }
180
+ ```
56
181
 
57
182
  ## License
58
183
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kroszborg/sugi",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Terminal UI git client — PRs, AI commits, interactive rebase, bisect, worktrees",
5
5
  "keywords": [
6
6
  "git",