@andreprado/agentkit 0.1.0-alpha.24 → 0.1.0-alpha.25

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/README.md CHANGED
@@ -24,12 +24,15 @@ Generated capsules use the built-in `test/fake` provider by default, so the firs
24
24
  ## What To Know First
25
25
 
26
26
  ```sh
27
- agentkit new <name> [--template blank|support|dentista] [--no-install]
27
+ agentkit new [name] [--template blank|support|dentista] [--no-install]
28
+ agentkit new .
28
29
  agentkit dev
29
30
  agentkit chat --message <text> [--conversation-id <id>]
30
31
  agentkit inspect
31
32
  ```
32
33
 
34
+ Run `agentkit new` without a name in an interactive terminal to be prompted for the project folder. Use `agentkit new .` to create the capsule in the current directory.
35
+
33
36
  Once the capsule is running:
34
37
 
35
38
  ```sh
@@ -39,6 +39,18 @@ cd support-demo
39
39
  npm run agentkit -- tool lookup_order --input '{"orderId":"A100"}'
40
40
  ```
41
41
 
42
+ `agentkit new` can prompt for the project folder name when run in an interactive terminal:
43
+
44
+ ```sh
45
+ npx @andreprado/agentkit@alpha new
46
+ ```
47
+
48
+ Use `.` to create the capsule in the current directory:
49
+
50
+ ```sh
51
+ npx @andreprado/agentkit@alpha new . --template blank
52
+ ```
53
+
42
54
  ## Windows PowerShell
43
55
 
44
56
  If PowerShell blocks `npm.ps1` or `npx.ps1` with `PSSecurityException`, run the same commands through the Windows command shims:
@@ -33,7 +33,8 @@ The capsule root is the runtime boundary. Run AgentKit commands from the directo
33
33
  Current commands:
34
34
 
35
35
  ```sh
36
- agentkit new <name> [--template blank|support|dentista] [--no-install]
36
+ agentkit new [name] [--template blank|support|dentista] [--no-install]
37
+ agentkit new .
37
38
  agentkit dev [--port <number>]
38
39
  agentkit open
39
40
  agentkit chat-ui --deploy
@@ -139,6 +140,8 @@ npm run agentkit -- conversations list
139
140
  npm run agentkit -- inspect
140
141
  ```
141
142
 
143
+ Run `agentkit new` without a name in an interactive terminal to be prompted for the project folder. Use `agentkit new .` to create the capsule in the current directory. Non-interactive scripts should pass a name or `.` explicitly.
144
+
142
145
  Expected first chat output:
143
146
 
144
147
  ```txt
package/docs/llms.txt CHANGED
@@ -35,8 +35,9 @@ Task guides:
35
35
  Current local commands:
36
36
 
37
37
  ```sh
38
- agentkit new <name> --template blank|support|dentista
39
- agentkit new <name> --template blank --no-install
38
+ agentkit new [name] --template blank|support|dentista
39
+ agentkit new . --template blank
40
+ agentkit new [name] --template blank --no-install
40
41
  agentkit docs full
41
42
  agentkit env set <NAME> --stdin
42
43
  agentkit env list
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andreprado/agentkit",
3
- "version": "0.1.0-alpha.24",
3
+ "version": "0.1.0-alpha.25",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
package/src/cli/help.ts CHANGED
@@ -13,7 +13,7 @@ Usage:
13
13
  agentkit <command> [options]
14
14
 
15
15
  Start:
16
- agentkit new <name> [--template blank|support|dentista] [--no-install]
16
+ agentkit new [name] [--template blank|support|dentista] [--no-install]
17
17
  agentkit dev
18
18
  agentkit open
19
19
  agentkit chat-ui --deploy
@@ -59,7 +59,7 @@ export function renderCommandReference(): string {
59
59
  return `AgentKit Command Reference
60
60
 
61
61
  Usage:
62
- agentkit new <name> [--template blank|support|dentista] [--no-install]
62
+ agentkit new [name] [--template blank|support|dentista] [--no-install]
63
63
  agentkit dev [--port <number>]
64
64
  agentkit open
65
65
  agentkit chat-ui --deploy [--port <number>] [--token-file <path>]
@@ -189,13 +189,15 @@ Examples:
189
189
  agentkit tool lookup_order --input '{"orderId":"A100"}'
190
190
  agentkit eval run
191
191
 
192
+ agentkit new
193
+ agentkit new .
192
194
  agentkit new clara-dentista --template dentista
193
195
  `;
194
196
  }
195
197
 
196
198
  export function renderCommandHelp(command: string): string {
197
199
  const usage: Record<string, string> = {
198
- new: "agentkit new <name> [--template blank|support|dentista] [--no-install]",
200
+ new: "agentkit new [name] [--template blank|support|dentista] [--no-install]",
199
201
  dev: "agentkit dev [--port <number>]",
200
202
  open: "agentkit open",
201
203
  "chat-ui": "agentkit chat-ui --deploy [--port <number>] [--token-file <path>]",
package/src/cli/index.ts CHANGED
@@ -31,6 +31,7 @@ import { inspectAgentCapsule } from "../runtime/inspect";
31
31
  import { AgentKitError, isAgentKitError } from "../runtime/errors";
32
32
  import { prepareVpsDeploy } from "../runtime/targets/vps/deploy";
33
33
  import { parseArgs, isHelpRequested, type ParsedArgs } from "./args";
34
+ import { resolveNewProjectName } from "./new-command";
34
35
  import {
35
36
  defaultAgentKitDevPort,
36
37
  defaultDeployChatAccessTokenName,
@@ -114,14 +115,10 @@ async function main() {
114
115
  warnIfUnsupportedNode();
115
116
 
116
117
  if (args.command === "new") {
117
- const [name] = args.positional;
118
+ const name = await resolveNewProjectName(args.positional);
118
119
  const template = String(args.flags.template ?? "blank");
119
120
  const shouldInstall = args.flags["no-install"] !== true;
120
121
 
121
- if (!name) {
122
- throw new Error("Missing project name. Usage: agentkit new <name> [--template blank|support|dentista] [--no-install]");
123
- }
124
-
125
122
  const result = await createProject({ name, template, cwd: process.cwd() });
126
123
  console.log(`Created ${result.name} at ${result.path}`);
127
124
 
@@ -0,0 +1,41 @@
1
+ import { createInterface } from "node:readline/promises";
2
+
3
+ const newUsage = "agentkit new [name] [--template blank|support|dentista] [--no-install]";
4
+
5
+ export async function resolveNewProjectName(
6
+ positional: string[],
7
+ promptProjectName: () => Promise<string> = promptForProjectName,
8
+ ): Promise<string> {
9
+ const [name] = positional;
10
+
11
+ if (name) {
12
+ return name;
13
+ }
14
+
15
+ const promptedName = (await promptProjectName()).trim();
16
+
17
+ if (!promptedName) {
18
+ throw new Error(`Project name is required. Usage: ${newUsage}`);
19
+ }
20
+
21
+ return promptedName;
22
+ }
23
+
24
+ async function promptForProjectName(): Promise<string> {
25
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
26
+ throw new Error(
27
+ `Missing project name. Usage: ${newUsage}. Run \`agentkit new\` in an interactive terminal to be prompted, or pass \`agentkit new <name>\` / \`agentkit new .\` in scripts.`,
28
+ );
29
+ }
30
+
31
+ const readline = createInterface({
32
+ input: process.stdin,
33
+ output: process.stdout,
34
+ });
35
+
36
+ try {
37
+ return await readline.question("Project folder name (or . for current directory): ");
38
+ } finally {
39
+ readline.close();
40
+ }
41
+ }
@@ -7,7 +7,7 @@ description: Use when the owner gives a natural-language brief for a new or chan
7
7
 
8
8
  Use this when the owner asks for an agent in plain language.
9
9
 
10
- The owner should only need to run `agentkit new <name>`, open the capsule in Codex or another coding agent, and say what agent they want. Do not send them back to the CLI for a brief wizard. Treat their chat message as the brief and build the first useful local capsule.
10
+ The owner should only need to run `agentkit new [name]` or `agentkit new .`, open the capsule in Codex or another coding agent, and say what agent they want. Do not send them back to the CLI for a brief wizard. Treat their chat message as the brief and build the first useful local capsule.
11
11
 
12
12
  ## Workflow
13
13
 
@@ -9,7 +9,7 @@ Use this first inside an AgentKit Agent Capsule.
9
9
 
10
10
  ## Owner-To-Codex Contract
11
11
 
12
- The owner has already done the setup work by running `agentkit new <name>` and opening this folder in a coding agent. When they ask for an agent in natural language, that message is the brief.
12
+ The owner has already done the setup work by running `agentkit new [name]` or `agentkit new .` and opening this folder in a coding agent. When they ask for an agent in natural language, that message is the brief.
13
13
 
14
14
  - Do not ask the owner to run a wizard, fill a form, or prepare `AGENT_SPEC.md`.
15
15
  - Route immediately to `skills/agentkit-build-agent/SKILL.md`.