gh-manager-cli 1.2.0
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.
- package/CHANGELOG.md +52 -0
- package/LICENSE +21 -0
- package/README.md +193 -0
- package/dist/index.js +1595 -0
- package/package.json +108 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/wiiiimm/gh-manager-cli/compare/v1.1.1...v1.2.0) (2025-08-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add npx support as primary installation method ([eeae1c8](https://github.com/wiiiimm/gh-manager-cli/commit/eeae1c8e60f0b4bd1f3076a16b65aec01cf5afdf))
|
|
7
|
+
* re-enable NPM publishing and update installation docs ([e6d5cff](https://github.com/wiiiimm/gh-manager-cli/commit/e6d5cffc64678899ecc89cf294c4413fab4cdf66))
|
|
8
|
+
|
|
9
|
+
## [1.1.1](https://github.com/wiiiimm/gh-manager-cli/compare/v1.1.0...v1.1.1) (2025-08-31)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* temporarily disable NPM publishing due to 2FA requirement ([2ab09ca](https://github.com/wiiiimm/gh-manager-cli/commit/2ab09ca8d543c771f97c999ad6beb6ebf36747be))
|
|
15
|
+
|
|
16
|
+
# [1.1.0](https://github.com/wiiiimm/gh-manager-cli/compare/v1.0.0...v1.1.0) (2025-08-31)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* re-enable NPM publishing with NPM_TOKEN configured ([a0c3520](https://github.com/wiiiimm/gh-manager-cli/commit/a0c3520ca53092941d4a761d6f94a66a500753dd))
|
|
22
|
+
|
|
23
|
+
# 1.0.0 (2025-08-31)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **delete:** use GitHub REST API DELETE /repos/{owner}/{repo} with token; update UI and docs accordingly ([e921ab9](https://github.com/wiiiimm/gh-manager-cli/commit/e921ab9917e27d368fc73f326bbe98081386ca18))
|
|
29
|
+
* resolve pnpm lockfile compatibility in CI workflow ([ece890f](https://github.com/wiiiimm/gh-manager-cli/commit/ece890f9b8d1b0c91dcb8cf1ab9275537483ea4f))
|
|
30
|
+
* update GitHub Actions workflow to use pnpm instead of npm ([42a0269](https://github.com/wiiiimm/gh-manager-cli/commit/42a02698d1490cf9f562633eddca86f0c54d10a3))
|
|
31
|
+
* update pkg targets to use node18 instead of node20 ([6302567](https://github.com/wiiiimm/gh-manager-cli/commit/6302567f15076e177dbad875f87c363ea5679486))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add fork sync, improved error handling, and UI enhancements ([165e03e](https://github.com/wiiiimm/gh-manager-cli/commit/165e03e983feb15f2d08301b59d125717b3ba937))
|
|
37
|
+
* add logout functionality with Ctrl+L shortcut ([f51c8b8](https://github.com/wiiiimm/gh-manager-cli/commit/f51c8b85c8890b063812a734a9c01651478fa4e2))
|
|
38
|
+
* add repository visibility toggle TODO item ([0b42fa0](https://github.com/wiiiimm/gh-manager-cli/commit/0b42fa04721209add85dc2dca4339ed5b1ffd79e))
|
|
39
|
+
* add server-side sorting and loading screens ([a082410](https://github.com/wiiiimm/gh-manager-cli/commit/a082410dcbd7125957b0fa9b3982d29eed53317a))
|
|
40
|
+
* complete fork tracking system with comprehensive improvements ([4621e10](https://github.com/wiiiimm/gh-manager-cli/commit/4621e1025d603acf14defb031c4d36de21c11846))
|
|
41
|
+
* disable NPM publishing temporarily to focus on binary releases ([df7718d](https://github.com/wiiiimm/gh-manager-cli/commit/df7718d324ec52e244b9176101aedc5f56a5a22d))
|
|
42
|
+
* implement automated release workflow with compiled binaries ([195ca17](https://github.com/wiiiimm/gh-manager-cli/commit/195ca174857eeef9ce08b6bbfce03ab61f185aa8))
|
|
43
|
+
* initial commit with semantic release setup ([62c4919](https://github.com/wiiiimm/gh-manager-cli/commit/62c4919c1c9061f7a5153c2a363398c9d571e9db))
|
|
44
|
+
* **prefs:** persist UI preferences (s/d/t) in config; load on startup ([bba426a](https://github.com/wiiiimm/gh-manager-cli/commit/bba426a0321e652d74c0dd5d340ff26cc3b98283))
|
|
45
|
+
* **ui:** add Delete Confirmation title and side-by-side buttons with shortcut hints in modal ([2073fd2](https://github.com/wiiiimm/gh-manager-cli/commit/2073fd277506c6f802c1dd46142900597a16c3f1))
|
|
46
|
+
* **ui:** centered delete modal with dimmed list (B-center); increase padding; show confirmation code as placeholder ([04434ba](https://github.com/wiiiimm/gh-manager-cli/commit/04434ba92ad621b1c68985bf3a61e3094f21aa5d))
|
|
47
|
+
* **ui:** density toggle, delete modal with 2-step confirm, centered modal; docs and TODOs updates; dim UI during modal ([27f90c7](https://github.com/wiiiimm/gh-manager-cli/commit/27f90c7e7ba096798bb0b930a3cf707f04218671))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Performance Improvements
|
|
51
|
+
|
|
52
|
+
* reduce production page size from 25 to 15 ([168c79a](https://github.com/wiiiimm/gh-manager-cli/commit/168c79a0b69704c7c29fb8c95e039127e9b50d6d))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 William Li
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# gh-manager-cli
|
|
2
|
+
|
|
3
|
+
Interactive terminal app to browse and manage your personal GitHub repositories. Built with Ink (React for CLIs) and the GitHub GraphQL API.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Option 1: Run with npx (no installation required)
|
|
9
|
+
npx github:wiiiimm/gh-manager-cli
|
|
10
|
+
|
|
11
|
+
# Option 2: Install globally via NPM
|
|
12
|
+
npm install -g gh-manager-cli
|
|
13
|
+
gh-manager
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
On first run, you'll be prompted for a GitHub Personal Access Token.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
### Core Repository Management
|
|
21
|
+
- **Token Authentication**: Secure PAT storage with validation and persistence
|
|
22
|
+
- **Repository Listing**: Browse all your personal repositories with metadata (stars, forks, language, etc.)
|
|
23
|
+
- **Live Pagination**: Infinite scroll with automatic page prefetching
|
|
24
|
+
- **Real-time Sorting**: Server-side sorting by updated, pushed, name, or stars (with direction toggle)
|
|
25
|
+
- **Smart Filtering**: Client-side search through repository names and descriptions
|
|
26
|
+
- **Repository Actions**:
|
|
27
|
+
- Open in browser (Enter/`o`)
|
|
28
|
+
- Delete repository (`Del`/Backspace) with secure two-step confirmation
|
|
29
|
+
- Archive/unarchive repositories (`a`) with confirmation prompts
|
|
30
|
+
|
|
31
|
+
### User Interface & Experience
|
|
32
|
+
- **Keyboard Navigation**: Full keyboard control (arrow keys, PageUp/Down, `g`/`G`)
|
|
33
|
+
- **Display Density**: Toggle between compact/cozy/comfy spacing (`t`)
|
|
34
|
+
- **Visual Indicators**: Fork status, private/archived badges, language colors
|
|
35
|
+
- **Loading States**: Contextual loading screens for sorting and refreshing operations
|
|
36
|
+
- **Rate Limit Monitoring**: Live API usage display with visual warnings
|
|
37
|
+
|
|
38
|
+
### Technical Features
|
|
39
|
+
- **Preference Persistence**: UI settings (sort, density) saved between sessions
|
|
40
|
+
- **Cross-platform**: Works on macOS, Linux, and Windows
|
|
41
|
+
- **Secure Storage**: Token stored with proper file permissions (0600)
|
|
42
|
+
- **Error Handling**: Graceful error recovery with retry mechanisms
|
|
43
|
+
- **Performance**: Efficient GraphQL queries with virtualized rendering
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
### NPX (Recommended - No Installation Required)
|
|
48
|
+
|
|
49
|
+
Run instantly without installing:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Run directly from GitHub
|
|
53
|
+
npx github:wiiiimm/gh-manager-cli
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### NPM Global Install
|
|
57
|
+
|
|
58
|
+
Install globally for persistent `gh-manager` command:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install -g gh-manager-cli
|
|
62
|
+
gh-manager
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Pre-built Binaries (No Node.js Required)
|
|
66
|
+
|
|
67
|
+
Download standalone executables from [GitHub Releases](https://github.com/wiiiimm/gh-manager-cli/releases):
|
|
68
|
+
|
|
69
|
+
- **Linux**: `gh-manager-linux-x64`
|
|
70
|
+
- **macOS**: `gh-manager-macos-x64`
|
|
71
|
+
- **Windows**: `gh-manager-windows-x64.exe`
|
|
72
|
+
|
|
73
|
+
Make the binary executable (Linux/macOS):
|
|
74
|
+
```bash
|
|
75
|
+
chmod +x gh-manager-*
|
|
76
|
+
./gh-manager-*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### From Source
|
|
80
|
+
|
|
81
|
+
Prerequisites:
|
|
82
|
+
- Node.js 18+
|
|
83
|
+
- pnpm
|
|
84
|
+
|
|
85
|
+
Install and build:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm install
|
|
89
|
+
pnpm build
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Run locally:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
node dist/index.js
|
|
96
|
+
# Or add to PATH for dev
|
|
97
|
+
pnpm link
|
|
98
|
+
gh-manager
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Token & Security
|
|
102
|
+
|
|
103
|
+
The app needs a GitHub token to read your repositories.
|
|
104
|
+
|
|
105
|
+
- Provide via env var: `GITHUB_TOKEN` or `GH_TOKEN`, or enter when prompted on first run.
|
|
106
|
+
- Recommended: classic PAT with `repo` scope for listing both public and private repos (read is sufficient).
|
|
107
|
+
- Validation: a minimal `viewer { login }` request verifies the token.
|
|
108
|
+
- Storage: token is saved as JSON in your OS user config directory with POSIX perms `0600`.
|
|
109
|
+
- macOS: `~/Library/Preferences/gh-manager-cli/config.json`
|
|
110
|
+
- Linux: `~/.config/gh-manager-cli/config.json`
|
|
111
|
+
- Windows: `%APPDATA%\gh-manager-cli\config.json`
|
|
112
|
+
- Revocation: you can revoke the PAT at any time in your GitHub settings.
|
|
113
|
+
|
|
114
|
+
Note: Tokens are stored in plaintext on disk with restricted permissions. Future work may add OS keychain support.
|
|
115
|
+
|
|
116
|
+
## Usage
|
|
117
|
+
|
|
118
|
+
Launch the app, then use the keys below:
|
|
119
|
+
|
|
120
|
+
- Navigation: Up/Down, PageUp/PageDown, `Ctrl+G` (top), `G` (bottom)
|
|
121
|
+
- Refresh: `R`
|
|
122
|
+
- Filter: `/` to enter, type query, Enter to apply (Esc cancels)
|
|
123
|
+
- Sorting: `S` to cycle field (updated → pushed → name → stars → forks), `D` to toggle direction
|
|
124
|
+
- Display density: `T` to toggle compact/cozy/comfy
|
|
125
|
+
- Open in browser: Enter or `O`
|
|
126
|
+
- Delete repository: `Del` or `Ctrl+Backspace` (with confirmation modal)
|
|
127
|
+
- Uses GitHub REST API (requires `delete_repo` scope and admin rights)
|
|
128
|
+
- Two-step confirm: type code → confirm (Y/Enter)
|
|
129
|
+
- Confirm: press `Y` or Enter
|
|
130
|
+
- Cancel: press `C` or Esc
|
|
131
|
+
- Archive/Unarchive: `Ctrl+A`
|
|
132
|
+
- Logout: `Ctrl+L`
|
|
133
|
+
- Toggle fork metrics: `F`
|
|
134
|
+
- Quit: `Q`
|
|
135
|
+
- Esc: cancels modals or exits filter mode (does not quit)
|
|
136
|
+
|
|
137
|
+
Status bar shows loaded count vs total. A rate-limit line displays `remaining/limit` and the reset time; it turns yellow when remaining ≤ 10% of the limit.
|
|
138
|
+
|
|
139
|
+
## Pagination Details
|
|
140
|
+
|
|
141
|
+
- Uses GitHub GraphQL `viewer.repositories` with `ownerAffiliations: OWNER`, ordered by `UPDATED_AT DESC`.
|
|
142
|
+
- Fetches 50 repos per page and updates `totalCount` each time.
|
|
143
|
+
- Prefetches the next page when your selection nears the end of the loaded list.
|
|
144
|
+
|
|
145
|
+
## Development
|
|
146
|
+
|
|
147
|
+
Stack:
|
|
148
|
+
- UI: `ink`, `ink-text-input`, `ink-spinner`
|
|
149
|
+
- API: `@octokit/graphql`
|
|
150
|
+
- Config paths: `env-paths`
|
|
151
|
+
- Language: TypeScript
|
|
152
|
+
- Build: `tsup` (CJS output with shebang)
|
|
153
|
+
|
|
154
|
+
Scripts:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pnpm build # build to dist/
|
|
158
|
+
pnpm build:binaries # build cross-platform binaries to ./binaries/
|
|
159
|
+
pnpm dev # watch mode
|
|
160
|
+
pnpm start # node dist/index.js
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Notes:
|
|
164
|
+
- In development mode (set `NODE_ENV=development` or `GH_MANAGER_DEV=1`), the app fetches 5 repos per page to speed iteration.
|
|
165
|
+
|
|
166
|
+
Project layout:
|
|
167
|
+
- `src/index.tsx` — CLI entry and error handling
|
|
168
|
+
- `src/ui/App.tsx` — token bootstrap, renders `RepoList`
|
|
169
|
+
- `src/ui/RepoList.tsx` — list UI, keys, filtering, sorting, infinite scroll
|
|
170
|
+
- `src/github.ts` — GraphQL client and queries (repos + rateLimit)
|
|
171
|
+
- `src/config.ts` — token read/write and file perms
|
|
172
|
+
- `src/types.ts` — shared types
|
|
173
|
+
|
|
174
|
+
## Troubleshooting
|
|
175
|
+
|
|
176
|
+
- Invalid token: enter a valid PAT (recommended scope: `repo`).
|
|
177
|
+
- Rate limited: wait for the reset shown in the banner or reduce navigation.
|
|
178
|
+
- Network errors: check connectivity and press `r` to retry.
|
|
179
|
+
|
|
180
|
+
## Todo & Roadmap
|
|
181
|
+
|
|
182
|
+
For the up-to-date task board, see [TODOs.md](./TODOs.md).
|
|
183
|
+
|
|
184
|
+
Highlights on deck:
|
|
185
|
+
- Density toggle for row spacing (compact/cozy/comfy)
|
|
186
|
+
- Repo actions (archive/unarchive, delete) with confirmations
|
|
187
|
+
- Organization support and switching
|
|
188
|
+
- Server-side search; cached first page for faster startup
|
|
189
|
+
- Optional OS keychain storage via `keytar`
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
MIT
|