@kernelius/forge-cli 0.3.3 → 0.3.4
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/SKILL.md +74 -1
- package/dist/index.js +18 -12
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -40,7 +40,18 @@ Before using any forge commands, ensure the user is authenticated:
|
|
|
40
40
|
forge auth whoami
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
If not authenticated, the user
|
|
43
|
+
If not authenticated, the user can either:
|
|
44
|
+
|
|
45
|
+
**Option 1: Create a new account (signup)**
|
|
46
|
+
```bash
|
|
47
|
+
forge auth signup \
|
|
48
|
+
--username johndoe \
|
|
49
|
+
--email john@example.com \
|
|
50
|
+
--name "John Doe" \
|
|
51
|
+
--password secret
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Option 2: Login with existing API key**
|
|
44
55
|
1. Get an agent API key from Forge at `/settings/agents`
|
|
45
56
|
2. Login with: `forge auth login --token forge_agent_xxx...`
|
|
46
57
|
|
|
@@ -106,6 +117,24 @@ forge issues close --repo @owner/repo --number 42
|
|
|
106
117
|
forge issues comment --repo @owner/repo --number 42 --body "This is fixed now"
|
|
107
118
|
```
|
|
108
119
|
|
|
120
|
+
**List comments on an issue:**
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
forge issues comments --repo @owner/repo --number 42
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Reopen an issue:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
forge issues reopen --repo @owner/repo --number 42
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Edit an issue:**
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
forge issues edit --repo @owner/repo --number 42 --title "New title" --body "Updated description"
|
|
136
|
+
```
|
|
137
|
+
|
|
109
138
|
## Pull Requests
|
|
110
139
|
|
|
111
140
|
**List pull requests:**
|
|
@@ -148,6 +177,50 @@ forge prs close --repo @owner/repo --number 10
|
|
|
148
177
|
forge prs comment --repo @owner/repo --number 10 --body "Looks good to me!"
|
|
149
178
|
```
|
|
150
179
|
|
|
180
|
+
**Submit a review:**
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Approve a PR
|
|
184
|
+
forge prs review --repo @owner/repo --number 10 --state approve --body "LGTM!"
|
|
185
|
+
|
|
186
|
+
# Request changes
|
|
187
|
+
forge prs review --repo @owner/repo --number 10 --state request_changes --body "Please fix X"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**View PR diff:**
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
forge prs diff --repo @owner/repo --number 10
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**List commits in a PR:**
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
forge prs commits --repo @owner/repo --number 10
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Templates
|
|
203
|
+
|
|
204
|
+
**List available templates:**
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
forge templates list
|
|
208
|
+
# Filter by organization type:
|
|
209
|
+
forge templates list --org-type healthcare
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**View template details:**
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
forge templates view patient-record
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Create repository from template:**
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
forge repos create --name my-patient-repo --template patient-record --visibility private
|
|
222
|
+
```
|
|
223
|
+
|
|
151
224
|
## Important Notes
|
|
152
225
|
|
|
153
226
|
- **Always specify `--repo @owner/repo`** when working with issues or PRs
|
package/dist/index.js
CHANGED
|
@@ -1049,9 +1049,10 @@ function createIssuesCommand() {
|
|
|
1049
1049
|
issues.command("labels").description("List repository labels").requiredOption("--repo <repo>", "Repository (@owner/name)").action(async (options) => {
|
|
1050
1050
|
try {
|
|
1051
1051
|
const [ownerIdentifier, name] = parseRepoArg2(options.repo);
|
|
1052
|
-
const
|
|
1052
|
+
const result = await apiGet(
|
|
1053
1053
|
`/api/repositories/${ownerIdentifier}/${name}/labels`
|
|
1054
1054
|
);
|
|
1055
|
+
const labels = result.labels || [];
|
|
1055
1056
|
if (labels.length === 0) {
|
|
1056
1057
|
console.log(chalk4.yellow("No labels found"));
|
|
1057
1058
|
return;
|
|
@@ -1369,7 +1370,8 @@ function createPrsCommand() {
|
|
|
1369
1370
|
const pr = await apiGet(
|
|
1370
1371
|
`/api/repositories/${ownerIdentifier}/${name}/pulls/${options.number}`
|
|
1371
1372
|
);
|
|
1372
|
-
const
|
|
1373
|
+
const result = await apiGet(`/api/pulls/${pr.id}/reviews`);
|
|
1374
|
+
const reviews = result.reviews || [];
|
|
1373
1375
|
if (reviews.length === 0) {
|
|
1374
1376
|
console.log(chalk5.yellow("No reviews found"));
|
|
1375
1377
|
return;
|
|
@@ -1403,7 +1405,8 @@ function createPrsCommand() {
|
|
|
1403
1405
|
const pr = await apiGet(
|
|
1404
1406
|
`/api/repositories/${ownerIdentifier}/${name}/pulls/${options.number}`
|
|
1405
1407
|
);
|
|
1406
|
-
const
|
|
1408
|
+
const result = await apiGet(`/api/pulls/${pr.id}/commits`);
|
|
1409
|
+
const commits = result.commits || [];
|
|
1407
1410
|
if (commits.length === 0) {
|
|
1408
1411
|
console.log(chalk5.yellow("No commits found"));
|
|
1409
1412
|
return;
|
|
@@ -1546,7 +1549,8 @@ function createOrgsCommand() {
|
|
|
1546
1549
|
});
|
|
1547
1550
|
orgs.command("members").description("List organization members").argument("<slug>", "Organization slug").action(async (slug) => {
|
|
1548
1551
|
try {
|
|
1549
|
-
const
|
|
1552
|
+
const result = await apiGet(`/api/orgs/${slug}/members`);
|
|
1553
|
+
const members = result.members || [];
|
|
1550
1554
|
if (members.length === 0) {
|
|
1551
1555
|
console.log(chalk6.yellow("No members found"));
|
|
1552
1556
|
return;
|
|
@@ -1564,7 +1568,7 @@ function createOrgsCommand() {
|
|
|
1564
1568
|
});
|
|
1565
1569
|
orgs.command("member-add").description("Add a member to organization").argument("<slug>", "Organization slug").argument("<username>", "Username to add").option("--role <role>", "Member role (owner/admin/member)", "member").action(async (slug, username, options) => {
|
|
1566
1570
|
try {
|
|
1567
|
-
await apiPost(`/api/
|
|
1571
|
+
await apiPost(`/api/orgs/${slug}/members`, {
|
|
1568
1572
|
username,
|
|
1569
1573
|
role: options.role
|
|
1570
1574
|
});
|
|
@@ -1576,7 +1580,7 @@ function createOrgsCommand() {
|
|
|
1576
1580
|
});
|
|
1577
1581
|
orgs.command("member-remove").description("Remove a member from organization").argument("<slug>", "Organization slug").argument("<username>", "Username to remove").action(async (slug, username) => {
|
|
1578
1582
|
try {
|
|
1579
|
-
await apiDelete(`/api/
|
|
1583
|
+
await apiDelete(`/api/orgs/${slug}/members/${username}`);
|
|
1580
1584
|
console.log(chalk6.green(`\u2713 Removed @${username} from @${slug}`));
|
|
1581
1585
|
} catch (error) {
|
|
1582
1586
|
console.error(chalk6.red(`Error: ${error.message}`));
|
|
@@ -1585,7 +1589,8 @@ function createOrgsCommand() {
|
|
|
1585
1589
|
});
|
|
1586
1590
|
orgs.command("teams").description("List organization teams").argument("<slug>", "Organization slug").action(async (slug) => {
|
|
1587
1591
|
try {
|
|
1588
|
-
const
|
|
1592
|
+
const result = await apiGet(`/api/orgs/${slug}/teams`);
|
|
1593
|
+
const teams = result.teams || [];
|
|
1589
1594
|
if (teams.length === 0) {
|
|
1590
1595
|
console.log(chalk6.yellow("No teams found"));
|
|
1591
1596
|
return;
|
|
@@ -1605,7 +1610,7 @@ function createOrgsCommand() {
|
|
|
1605
1610
|
});
|
|
1606
1611
|
orgs.command("team-create").description("Create a team in organization").argument("<slug>", "Organization slug").requiredOption("--name <name>", "Team name").option("--description <desc>", "Team description").action(async (slug, options) => {
|
|
1607
1612
|
try {
|
|
1608
|
-
const team = await apiPost(`/api/
|
|
1613
|
+
const team = await apiPost(`/api/orgs/${slug}/teams`, {
|
|
1609
1614
|
name: options.name,
|
|
1610
1615
|
description: options.description
|
|
1611
1616
|
});
|
|
@@ -1617,9 +1622,10 @@ function createOrgsCommand() {
|
|
|
1617
1622
|
});
|
|
1618
1623
|
orgs.command("team-members").description("List team members").argument("<slug>", "Organization slug").argument("<team>", "Team name").action(async (slug, team) => {
|
|
1619
1624
|
try {
|
|
1620
|
-
const
|
|
1621
|
-
`/api/
|
|
1625
|
+
const result = await apiGet(
|
|
1626
|
+
`/api/orgs/${slug}/teams/${team}/members`
|
|
1622
1627
|
);
|
|
1628
|
+
const members = result.members || [];
|
|
1623
1629
|
if (members.length === 0) {
|
|
1624
1630
|
console.log(chalk6.yellow("No team members found"));
|
|
1625
1631
|
return;
|
|
@@ -1637,7 +1643,7 @@ function createOrgsCommand() {
|
|
|
1637
1643
|
orgs.command("team-add-member").description("Add a member to team").argument("<slug>", "Organization slug").argument("<team>", "Team name").argument("<username>", "Username to add").action(async (slug, team, username) => {
|
|
1638
1644
|
try {
|
|
1639
1645
|
await apiPost(
|
|
1640
|
-
`/api/
|
|
1646
|
+
`/api/orgs/${slug}/teams/${team}/members`,
|
|
1641
1647
|
{
|
|
1642
1648
|
username
|
|
1643
1649
|
}
|
|
@@ -1651,7 +1657,7 @@ function createOrgsCommand() {
|
|
|
1651
1657
|
orgs.command("team-remove-member").description("Remove a member from team").argument("<slug>", "Organization slug").argument("<team>", "Team name").argument("<username>", "Username to remove").action(async (slug, team, username) => {
|
|
1652
1658
|
try {
|
|
1653
1659
|
await apiDelete(
|
|
1654
|
-
`/api/
|
|
1660
|
+
`/api/orgs/${slug}/teams/${team}/members/${username}`
|
|
1655
1661
|
);
|
|
1656
1662
|
console.log(chalk6.green(`\u2713 Removed @${username} from team ${team}`));
|
|
1657
1663
|
} catch (error) {
|