Skip to content

Commit 163bab0

Browse files
committed
fix: address review feedback — restore name description and move backfill logic
1 parent 2d6b32c commit 163bab0

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/cli/commands/create/command.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ function printCreateSummary(
7676
/** Handle CLI mode with progress output */
7777
async function handleCreateCLI(options: CreateOptions): Promise<void> {
7878
const cwd = options.outputDir ?? getWorkingDirectory();
79-
const projectName = options.projectName ?? options.name!;
79+
const name = options.name ?? options.projectName;
80+
const projectName = options.projectName ?? name;
8081

8182
const validation = validateCreateOptions(options, cwd);
8283
if (!validation.valid) {
@@ -90,7 +91,7 @@ async function handleCreateCLI(options: CreateOptions): Promise<void> {
9091

9192
// Handle dry-run mode
9293
if (options.dryRun) {
93-
const result = getDryRunInfo({ name: options.name!, projectName, cwd, language: options.language });
94+
const result = getDryRunInfo({ name: name!, projectName, cwd, language: options.language });
9495
if (options.json) {
9596
console.log(JSON.stringify(result));
9697
} else {
@@ -122,14 +123,14 @@ async function handleCreateCLI(options: CreateOptions): Promise<void> {
122123

123124
const result = skipAgent
124125
? await createProject({
125-
name: projectName,
126+
name: projectName!,
126127
cwd,
127128
skipGit: options.skipGit,
128129
skipInstall: options.skipInstall,
129130
onProgress,
130131
})
131132
: await createProjectWithAgent({
132-
name: options.name!,
133+
name: name!,
133134
projectName,
134135
cwd,
135136
type: options.type as 'create' | 'import' | undefined,
@@ -158,7 +159,7 @@ async function handleCreateCLI(options: CreateOptions): Promise<void> {
158159
if (options.json) {
159160
console.log(JSON.stringify(result));
160161
} else if (result.success) {
161-
printCreateSummary(projectName, result.agentName, options.language, options.framework);
162+
printCreateSummary(projectName!, result.agentName, options.language, options.framework);
162163
if (options.skipInstall) {
163164
console.log(
164165
"\nDependency installation was skipped. Run 'npm install' in agentcore/cdk/ and 'uv sync' in your agent directory manually."
@@ -175,7 +176,7 @@ export const registerCreate = (program: Command) => {
175176
program
176177
.command('create')
177178
.description(COMMAND_DESCRIPTIONS.create)
178-
.option('--name <name>', 'Resource name [non-interactive]')
179+
.option('--name <name>', 'Resource name (agent or harness) [non-interactive]')
179180
.option(
180181
'--project-name <name>',
181182
'Project name (start with letter, alphanumeric only, max 23 chars) [non-interactive]'
@@ -249,9 +250,6 @@ export const registerCreate = (program: Command) => {
249250
);
250251

251252
if (hasAnyFlag) {
252-
if (options.agent === false) {
253-
options.name = options.name ?? options.projectName;
254-
}
255253
// Default language to Python (only supported option) for CLI mode
256254
options.language = options.language ?? 'Python';
257255
await handleCreateCLI(options as CreateOptions);

0 commit comments

Comments
 (0)