gh-manager-cli 1.24.0 → 1.24.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.
- package/CHANGELOG.md +7 -0
- package/README.md +9 -9
- package/dist/{chunk-GFBV3TQA.js → chunk-4A3TGHG7.js} +53 -3
- package/dist/{github-O7QMBYSD.js → github-64JCWV7P.js} +5 -1
- package/dist/index.js +768 -398
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.24.1](https://github.com/wiiiimm/gh-manager-cli/compare/v1.24.0...v1.24.1) (2025-09-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* restore accidentally deleted features from refactor ([bcc9f12](https://github.com/wiiiimm/gh-manager-cli/commit/bcc9f123cba0abe274a1351168bfc5583cc9382f))
|
|
7
|
+
|
|
1
8
|
# [1.24.0](https://github.com/wiiiimm/gh-manager-cli/compare/v1.23.0...v1.24.0) (2025-09-05)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Interactive terminal app to browse and manage your personal GitHub repositories.
|
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
# Run with npx (no install)
|
|
45
|
-
npx gh-manager-cli
|
|
45
|
+
npx gh-manager-cli@latest
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
On first run, you'll be prompted to authenticate with GitHub (OAuth recommended).
|
|
@@ -99,7 +99,7 @@ brew install gh-manager-cli
|
|
|
99
99
|
Run instantly without installing:
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
-
npx gh-manager-cli
|
|
102
|
+
npx gh-manager-cli@latest
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
### NPM Global Install
|
|
@@ -214,8 +214,8 @@ Launch the app, then use the keys below:
|
|
|
214
214
|
- Examples:
|
|
215
215
|
- `gh-manager-cli --org acme`
|
|
216
216
|
- `gh-manager-cli -o acme`
|
|
217
|
-
- `npx gh-manager-cli --org=@acme`
|
|
218
|
-
- `npx gh-manager-cli -o=@acme`
|
|
217
|
+
- `npx gh-manager-cli@latest --org=@acme`
|
|
218
|
+
- `npx gh-manager-cli@latest -o=@acme`
|
|
219
219
|
- Notes:
|
|
220
220
|
- Leading `@` is optional.
|
|
221
221
|
- Personal usernames are not supported by `--org`/`-o` (use default personal context).
|
|
@@ -362,7 +362,7 @@ gh-manager-cli includes built-in Apollo Client caching to reduce GitHub API call
|
|
|
362
362
|
|
|
363
363
|
Run with `GH_MANAGER_DEBUG=1` to enable debugging features:
|
|
364
364
|
```bash
|
|
365
|
-
GH_MANAGER_DEBUG=1 npx gh-manager-cli
|
|
365
|
+
GH_MANAGER_DEBUG=1 npx gh-manager-cli@latest
|
|
366
366
|
```
|
|
367
367
|
|
|
368
368
|
Debug mode provides:
|
|
@@ -398,16 +398,16 @@ Even with caching enabled, API credits may decrease due to:
|
|
|
398
398
|
|
|
399
399
|
```bash
|
|
400
400
|
# Number of repositories to fetch per page (1-50, default: 15)
|
|
401
|
-
REPOS_PER_FETCH=10 npx gh-manager-cli
|
|
401
|
+
REPOS_PER_FETCH=10 npx gh-manager-cli@latest
|
|
402
402
|
|
|
403
403
|
# Custom cache TTL (milliseconds) - default: 30 minutes
|
|
404
|
-
APOLLO_TTL_MS=1800000 npx gh-manager-cli
|
|
404
|
+
APOLLO_TTL_MS=1800000 npx gh-manager-cli@latest
|
|
405
405
|
|
|
406
406
|
# Enable debug mode to see cache performance
|
|
407
|
-
GH_MANAGER_DEBUG=1 npx gh-manager-cli
|
|
407
|
+
GH_MANAGER_DEBUG=1 npx gh-manager-cli@latest
|
|
408
408
|
|
|
409
409
|
# Combine multiple environment variables
|
|
410
|
-
REPOS_PER_FETCH=5 GH_MANAGER_DEBUG=1 npx gh-manager-cli
|
|
410
|
+
REPOS_PER_FETCH=5 GH_MANAGER_DEBUG=1 npx gh-manager-cli@latest
|
|
411
411
|
```
|
|
412
412
|
|
|
413
413
|
## Troubleshooting
|
|
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
|
|
28
|
-
// src/github.ts
|
|
28
|
+
// src/services/github.ts
|
|
29
29
|
import { graphql as makeGraphQL } from "@octokit/graphql";
|
|
30
30
|
import { ApolloClient, InMemoryCache, HttpLink, gql } from "@apollo/client/core/index.js";
|
|
31
31
|
import { persistCache } from "apollo3-cache-persist";
|
|
@@ -33,7 +33,7 @@ import fs2 from "fs";
|
|
|
33
33
|
import path2 from "path";
|
|
34
34
|
import envPaths2 from "env-paths";
|
|
35
35
|
|
|
36
|
-
// src/logger.ts
|
|
36
|
+
// src/lib/logger.ts
|
|
37
37
|
import fs from "fs";
|
|
38
38
|
import path from "path";
|
|
39
39
|
import envPaths from "env-paths";
|
|
@@ -199,7 +199,7 @@ ${contextStr}`;
|
|
|
199
199
|
};
|
|
200
200
|
var logger = Logger.getInstance();
|
|
201
201
|
|
|
202
|
-
// src/github.ts
|
|
202
|
+
// src/services/github.ts
|
|
203
203
|
function makeClient(token) {
|
|
204
204
|
return makeGraphQL.defaults({
|
|
205
205
|
headers: { authorization: `token ${token}` }
|
|
@@ -1245,6 +1245,54 @@ async function fetchRestRateLimits(token) {
|
|
|
1245
1245
|
return null;
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
+
async function updateCacheAfterRename(token, repositoryId, newName, nameWithOwner) {
|
|
1249
|
+
try {
|
|
1250
|
+
const ap = await makeApolloClient(token);
|
|
1251
|
+
if (!ap || !ap.client) return;
|
|
1252
|
+
ap.client.cache.modify({
|
|
1253
|
+
id: `Repository:${repositoryId}`,
|
|
1254
|
+
fields: {
|
|
1255
|
+
name: () => newName,
|
|
1256
|
+
nameWithOwner: () => nameWithOwner
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
} catch {
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
async function renameRepositoryById(client, repositoryId, newName) {
|
|
1263
|
+
logger.info("Renaming repository", {
|
|
1264
|
+
repositoryId,
|
|
1265
|
+
newName
|
|
1266
|
+
});
|
|
1267
|
+
const mutation = (
|
|
1268
|
+
/* GraphQL */
|
|
1269
|
+
`
|
|
1270
|
+
mutation RenameRepo($repositoryId: ID!, $name: String!) {
|
|
1271
|
+
updateRepository(input: { repositoryId: $repositoryId, name: $name }) {
|
|
1272
|
+
repository {
|
|
1273
|
+
id
|
|
1274
|
+
name
|
|
1275
|
+
nameWithOwner
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
`
|
|
1280
|
+
);
|
|
1281
|
+
try {
|
|
1282
|
+
const result = await client(mutation, { repositoryId, name: newName });
|
|
1283
|
+
logger.info("Repository renamed successfully", {
|
|
1284
|
+
repositoryId,
|
|
1285
|
+
newName: result?.updateRepository?.repository?.name
|
|
1286
|
+
});
|
|
1287
|
+
} catch (error) {
|
|
1288
|
+
logger.error("Failed to rename repository", {
|
|
1289
|
+
repositoryId,
|
|
1290
|
+
newName,
|
|
1291
|
+
error: error.message
|
|
1292
|
+
});
|
|
1293
|
+
throw error;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1248
1296
|
async function inspectCacheStatus() {
|
|
1249
1297
|
try {
|
|
1250
1298
|
const fs3 = await import("fs");
|
|
@@ -1314,5 +1362,7 @@ export {
|
|
|
1314
1362
|
updateCacheAfterVisibilityChange,
|
|
1315
1363
|
updateCacheWithRepository,
|
|
1316
1364
|
fetchRestRateLimits,
|
|
1365
|
+
updateCacheAfterRename,
|
|
1366
|
+
renameRepositoryById,
|
|
1317
1367
|
inspectCacheStatus
|
|
1318
1368
|
};
|
|
@@ -14,14 +14,16 @@ import {
|
|
|
14
14
|
inspectCacheStatus,
|
|
15
15
|
makeClient,
|
|
16
16
|
purgeApolloCacheFiles,
|
|
17
|
+
renameRepositoryById,
|
|
17
18
|
searchRepositoriesUnified,
|
|
18
19
|
syncForkWithUpstream,
|
|
19
20
|
unarchiveRepositoryById,
|
|
20
21
|
updateCacheAfterArchive,
|
|
21
22
|
updateCacheAfterDelete,
|
|
23
|
+
updateCacheAfterRename,
|
|
22
24
|
updateCacheAfterVisibilityChange,
|
|
23
25
|
updateCacheWithRepository
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4A3TGHG7.js";
|
|
25
27
|
export {
|
|
26
28
|
archiveRepositoryById,
|
|
27
29
|
changeRepositoryVisibility,
|
|
@@ -37,11 +39,13 @@ export {
|
|
|
37
39
|
inspectCacheStatus,
|
|
38
40
|
makeClient,
|
|
39
41
|
purgeApolloCacheFiles,
|
|
42
|
+
renameRepositoryById,
|
|
40
43
|
searchRepositoriesUnified,
|
|
41
44
|
syncForkWithUpstream,
|
|
42
45
|
unarchiveRepositoryById,
|
|
43
46
|
updateCacheAfterArchive,
|
|
44
47
|
updateCacheAfterDelete,
|
|
48
|
+
updateCacheAfterRename,
|
|
45
49
|
updateCacheAfterVisibilityChange,
|
|
46
50
|
updateCacheWithRepository
|
|
47
51
|
};
|