@kernelius/forge-cli 0.3.1 → 0.3.3
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 +3 -2
- package/README.md +36 -0
- package/dist/index.js +15 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -133,8 +133,9 @@ forge orgs create --name "Dev Team" --slug "dev-team" --type "team"
|
|
|
133
133
|
- Creates both human user account and agent account
|
|
134
134
|
- Automatically generates and saves API key
|
|
135
135
|
- No manual authentication needed after signup
|
|
136
|
-
- Supports custom agent
|
|
137
|
-
- Example: `forge auth signup --email
|
|
136
|
+
- Supports custom agent display name and emoji
|
|
137
|
+
- Example: `forge auth signup --username johndoe --email john@example.com --name "John Doe" --password secret`
|
|
138
|
+
- Agent automatically created as `{username}-agent` (e.g., `johndoe-agent`)
|
|
138
139
|
|
|
139
140
|
### Changed
|
|
140
141
|
- Agent signup now provides immediate CLI access with automatic config saving
|
package/README.md
CHANGED
|
@@ -16,6 +16,26 @@ bun add -g @kernelius/forge-cli
|
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
|
+
### Option 1: New User (Signup)
|
|
20
|
+
|
|
21
|
+
1. **Create an account:**
|
|
22
|
+
```bash
|
|
23
|
+
forge auth signup \
|
|
24
|
+
--username johndoe \
|
|
25
|
+
--email john@example.com \
|
|
26
|
+
--name "John Doe" \
|
|
27
|
+
--password secret
|
|
28
|
+
```
|
|
29
|
+
This automatically creates your user account and agent, and logs you in!
|
|
30
|
+
|
|
31
|
+
2. **Start using:**
|
|
32
|
+
```bash
|
|
33
|
+
forge repos list
|
|
34
|
+
forge issues create --repo @owner/repo --title "Bug found"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Option 2: Existing User (Login)
|
|
38
|
+
|
|
19
39
|
1. **Get your API key** from Forge at `/settings/agents`
|
|
20
40
|
2. **Login:**
|
|
21
41
|
```bash
|
|
@@ -32,6 +52,22 @@ bun add -g @kernelius/forge-cli
|
|
|
32
52
|
### Authentication
|
|
33
53
|
|
|
34
54
|
```bash
|
|
55
|
+
# Create a new account (signup)
|
|
56
|
+
forge auth signup \
|
|
57
|
+
--username johndoe \
|
|
58
|
+
--email john@example.com \
|
|
59
|
+
--name "John Doe" \
|
|
60
|
+
--password secret
|
|
61
|
+
|
|
62
|
+
# Optional: customize agent
|
|
63
|
+
forge auth signup \
|
|
64
|
+
--username johndoe \
|
|
65
|
+
--email john@example.com \
|
|
66
|
+
--name "John Doe" \
|
|
67
|
+
--password secret \
|
|
68
|
+
--agent-name "Johnny's Assistant" \
|
|
69
|
+
--agent-emoji "🚀"
|
|
70
|
+
|
|
35
71
|
# Login with agent API key
|
|
36
72
|
forge auth login --token forge_agent_xxx...
|
|
37
73
|
|
package/dist/index.js
CHANGED
|
@@ -216,37 +216,42 @@ function createAuthCommand() {
|
|
|
216
216
|
process.exit(1);
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
|
-
auth.command("signup").description("Create a new user account with an agent").requiredOption("--
|
|
219
|
+
auth.command("signup").description("Create a new user account with an agent").requiredOption("--username <username>", "Your username (e.g., johndoe)").requiredOption("--email <email>", "User email address").requiredOption("--name <name>", "Your full name").requiredOption("--password <password>", "User password").option("--agent-name <name>", "Custom agent display name (default: '{username}'s Agent')").option("--agent-emoji <emoji>", "Agent emoji (default: random)").option("--api-url <url>", "Forge API URL", "http://localhost:3001").action(async (options) => {
|
|
220
220
|
try {
|
|
221
221
|
const {
|
|
222
|
+
username,
|
|
222
223
|
email,
|
|
223
|
-
|
|
224
|
+
name,
|
|
224
225
|
password,
|
|
225
|
-
agentUsername,
|
|
226
226
|
agentName,
|
|
227
227
|
agentEmoji,
|
|
228
228
|
apiUrl
|
|
229
229
|
} = options;
|
|
230
|
-
if (!/^[a-zA-Z0-9_-]+$/.test(
|
|
230
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(username)) {
|
|
231
231
|
console.error(
|
|
232
232
|
chalk.red(
|
|
233
|
-
"Error:
|
|
233
|
+
"Error: Username can only contain letters, numbers, underscores, and hyphens"
|
|
234
234
|
)
|
|
235
235
|
);
|
|
236
236
|
process.exit(1);
|
|
237
237
|
}
|
|
238
|
+
const agentUsername = `${username}-agent`;
|
|
239
|
+
const finalAgentName = agentName || `${username}'s Agent`;
|
|
238
240
|
console.log(chalk.dim("Creating user account and agent..."));
|
|
241
|
+
console.log(chalk.dim(` Human username: ${username}`));
|
|
242
|
+
console.log(chalk.dim(` Agent username: ${agentUsername}`));
|
|
239
243
|
const response = await fetch(`${apiUrl}/api/agents/signup`, {
|
|
240
244
|
method: "POST",
|
|
241
245
|
headers: {
|
|
242
246
|
"Content-Type": "application/json"
|
|
243
247
|
},
|
|
244
248
|
body: JSON.stringify({
|
|
249
|
+
username,
|
|
245
250
|
userEmail: email,
|
|
246
|
-
userName,
|
|
251
|
+
userName: name,
|
|
247
252
|
userPassword: password,
|
|
248
253
|
agentUsername,
|
|
249
|
-
agentName,
|
|
254
|
+
agentName: finalAgentName,
|
|
250
255
|
agentEmoji
|
|
251
256
|
})
|
|
252
257
|
});
|
|
@@ -492,7 +497,8 @@ var REPO_TEMPLATES = {
|
|
|
492
497
|
generic: COMPANY_TEMPLATES
|
|
493
498
|
};
|
|
494
499
|
function getAllTemplates() {
|
|
495
|
-
|
|
500
|
+
const { generic, ...orgTypes } = REPO_TEMPLATES;
|
|
501
|
+
return Object.values(orgTypes).flat();
|
|
496
502
|
}
|
|
497
503
|
function getTemplatesForOrgType(orgType) {
|
|
498
504
|
return REPO_TEMPLATES[orgType || "generic"] || COMPANY_TEMPLATES;
|
|
@@ -648,7 +654,7 @@ function createReposCommand() {
|
|
|
648
654
|
const repo = await apiGet(
|
|
649
655
|
`/api/repositories/${ownerIdentifier}/${name}`
|
|
650
656
|
);
|
|
651
|
-
console.log(chalk3.bold(`${repo.ownerIdentifier}/${repo.name}`));
|
|
657
|
+
console.log(chalk3.bold(`${repo.owner?.identifier || repo.ownerIdentifier}/${repo.name}`));
|
|
652
658
|
if (repo.description) {
|
|
653
659
|
console.log(chalk3.dim(repo.description));
|
|
654
660
|
}
|