Skip to content

Commit eb2cc23

Browse files
authored
fix(create): make --defaults create a harness project (#1644)
Harness is now the default for `agentcore create`, so `--defaults` no longer creates a Python/Strands/Bedrock agent. Drop the agent-default backfill that ran when `--defaults` was combined with an agent-path flag, so the flag is purely "create with default (harness) settings" and behaves identically to passing no routing flags at all. Update the `--defaults` help text and every doc usage to match: standalone quick-starts drop the flag (harness is implicit) and agent-oriented flows (gateway, knowledge bases, payments, config bundles, recommendations) use the explicit `--framework Strands --model-provider Bedrock` agent path. Strengthen the `--defaults` unit test to assert the harness contract (`harnessName` + `app/<name>/harness.json`) so the routing can't silently regress.
1 parent aba397a commit eb2cc23

8 files changed

Lines changed: 23 additions & 23 deletions

File tree

docs/commands.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ Create a new AgentCore project.
3030
# Interactive wizard
3131
agentcore create
3232

33-
# Fully non-interactive with defaults
34-
agentcore create --name MyProject --defaults
33+
# Non-interactive harness project (this is the default)
34+
agentcore create --name MyProject
35+
36+
# Non-interactive agent project
37+
agentcore create --name MyProject --framework Strands --model-provider Bedrock
3538

3639
# Custom configuration
3740
agentcore create \
@@ -44,7 +47,8 @@ agentcore create \
4447
# With networking
4548
agentcore create \
4649
--name MyProject \
47-
--defaults \
50+
--framework Strands \
51+
--model-provider Bedrock \
4852
--network-mode VPC \
4953
--subnets subnet-abc,subnet-def \
5054
--security-groups sg-123
@@ -60,7 +64,7 @@ agentcore create \
6064
--model-provider Bedrock
6165

6266
# Preview without creating
63-
agentcore create --name MyProject --defaults --dry-run
67+
agentcore create --name MyProject --framework Strands --model-provider Bedrock --dry-run
6468

6569
# Import from Bedrock Agents
6670
agentcore create \
@@ -77,7 +81,7 @@ agentcore create \
7781
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
7882
| `--name <name>` | Agent (resource) name; also used as project directory name when `--project-name` is omitted |
7983
| `--project-name <name>` | Project directory name (alphanumeric, starts with letter, max 23 chars) |
80-
| `--defaults` | Use defaults (Python, Strands, Bedrock, no memory) |
84+
| `--defaults` | Create a harness project with default settings (this is the default) |
8185
| `--no-agent` | Skip agent creation |
8286
| `--type <type>` | `create` (default) or `import` |
8387
| `--language <lang>` | `Python` (default) or `TypeScript` (Strands-only; see [Frameworks](frameworks.md#supported-languages)) |
@@ -1492,7 +1496,7 @@ agentcore deploy -y --json # Deploy with auto-confirm
14921496
### Scripted Project Setup
14931497

14941498
```bash
1495-
agentcore create --name MyProject --defaults
1499+
agentcore create --name MyProject --framework Strands --model-provider Bedrock
14961500
cd MyProject
14971501
agentcore add memory --name SharedMemory --strategies SEMANTIC
14981502
agentcore deploy -y

docs/config-bundles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ invocation time from whichever bundle version is active.
2020
Create an agent with a pre-wired config bundle that injects system prompt and tool descriptions at runtime:
2121

2222
```bash
23-
agentcore create --name MyProject --defaults --with-config-bundle
23+
agentcore create --name MyProject --framework Strands --model-provider Bedrock --with-config-bundle
2424
```
2525

2626
This creates a `{AgentName}Config` bundle with smart defaults and generates a template that uses

docs/gateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ the gateway client code.
1010

1111
```bash
1212
# 1. Create a project
13-
agentcore create --name MyProject --defaults
13+
agentcore create --name MyProject --framework Strands --model-provider Bedrock
1414
cd MyProject
1515

1616
# 2. Add a gateway

docs/knowledge-bases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ code is wired to call `retrieve` against the KB through the gateway.
1111

1212
```bash
1313
# 1. Create a project
14-
agentcore create --name MyProject --defaults
14+
agentcore create --name MyProject --framework Strands --model-provider Bedrock
1515
cd MyProject
1616

1717
# 2. Add a gateway

docs/payments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ guide.
1212

1313
```bash
1414
# 1. Create a project with payments capability
15-
agentcore create --name MyProject --defaults
15+
agentcore create --name MyProject --framework Strands --model-provider Bedrock
1616
cd MyProject
1717

1818
# 2. Add a payment manager
@@ -367,7 +367,7 @@ The complete path from a fresh project to a settled on-chain payment. Steps 1–
367367

368368
```bash
369369
# 1. Create a project and add the payment manager + connector
370-
agentcore create --name MyProject --defaults && cd MyProject
370+
agentcore create --name MyProject --framework Strands --model-provider Bedrock && cd MyProject
371371
agentcore add payment-manager --name MyManager
372372
agentcore add payment-connector --manager MyManager --name MyCDPConnector --provider CoinbaseCDP \
373373
--api-key-id "$CDP_API_KEY_ID" --api-key-secret "$CDP_API_KEY_SECRET" --wallet-secret "$CDP_WALLET_SECRET"

docs/recommendations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ When using `--bundle-name`, the completed result also includes `configurationBun
129129
1. Create agent with config bundle:
130130

131131
```bash
132-
agentcore create --name MyAgent --defaults --with-config-bundle
132+
agentcore create --name MyAgent --framework Strands --model-provider Bedrock --with-config-bundle
133133
agentcore deploy
134134
```
135135

src/cli/commands/create/__tests__/create.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,17 @@ describe('create command', () => {
241241
});
242242

243243
describe('--defaults', () => {
244-
it('creates project with defaults', async () => {
245-
const name = `Defaults${Date.now()}`;
244+
// --defaults creates a harness project (the default), identical to passing no routing flags.
245+
// The harness path returns `harnessName` and writes app/<name>/harness.json.
246+
it('creates a harness project', async () => {
247+
const name = `Def${Date.now().toString().slice(-6)}`;
246248
const result = await runCLI(['create', '--name', name, '--defaults', '--json'], testDir);
247249

248250
expect(result.exitCode, `stderr: ${result.stderr}`).toBe(0);
249251
const json = JSON.parse(result.stdout);
250252
expect(json.success).toBe(true);
251-
expect(await exists(join(testDir, name))).toBeTruthy();
253+
expect(json.harnessName).toBe(name);
254+
expect(await exists(join(json.projectPath, 'app', name, 'harness.json'))).toBeTruthy();
252255
});
253256
});
254257

src/cli/commands/create/command.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ export const registerCreate = (program: Command) => {
447447
'Project name (start with letter, alphanumeric only, max 23 chars) [non-interactive]'
448448
)
449449
.option('--no-agent', 'Skip agent creation [non-interactive]')
450-
.option('--defaults', 'Use defaults (Python, Strands, Bedrock, no memory) [non-interactive]')
450+
.option('--defaults', 'Create a harness project with default settings (this is the default) [non-interactive]')
451451
.option('--build <type>', 'Build type: CodeZip or Container (default: CodeZip) [non-interactive]')
452452
.option('--language <language>', 'Target language: Python or TypeScript (default: Python) [non-interactive]')
453453
.option(
@@ -633,13 +633,6 @@ export const registerCreate = (program: Command) => {
633633

634634
// Agent path: any agent-specific flag triggers it
635635
if (isAgentPath(opts)) {
636-
if (opts.defaults) {
637-
opts.language = opts.language ?? 'Python';
638-
opts.build = opts.build ?? 'CodeZip';
639-
opts.framework = opts.framework ?? 'Strands';
640-
opts.modelProvider = opts.modelProvider ?? 'Bedrock';
641-
opts.memory = opts.memory ?? 'none';
642-
}
643636
opts.language = opts.language ?? 'Python';
644637
await handleCreateCLI(opts);
645638
return;

0 commit comments

Comments
 (0)