@@ -38,6 +38,18 @@ describe('create command', () => {
3838 expect ( json . success ) . toBe ( false ) ;
3939 expect ( json . error . includes ( 'conflicts' ) ) . toBeTruthy ( ) ;
4040 } ) ;
41+
42+ it ( 'creates project-only scaffold with --project-name and no --name' , async ( ) => {
43+ const projectName = `ProjOnly${ Date . now ( ) } ` ;
44+ const result = await runCLI ( [ 'create' , '--project-name' , projectName , '--no-agent' , '--json' ] , testDir ) ;
45+
46+ expect ( result . exitCode , `stderr: ${ result . stderr } , stdout: ${ result . stdout } ` ) . toBe ( 0 ) ;
47+
48+ const json = JSON . parse ( result . stdout ) ;
49+ expect ( json . success ) . toBe ( true ) ;
50+ expect ( json . projectPath ) . toMatch ( new RegExp ( `/${ projectName } $` ) ) ;
51+ expect ( await exists ( join ( json . projectPath , 'agentcore' ) ) ) . toBeTruthy ( ) ;
52+ } ) ;
4153 } ) ;
4254
4355 describe ( 'with agent' , ( ) => {
@@ -144,6 +156,44 @@ describe('create command', () => {
144156 expect ( episodic ?. namespaces ) . toEqual ( [ '/episodes/{actorId}/{sessionId}' ] ) ;
145157 expect ( episodic ?. reflectionNamespaces ) . toEqual ( [ '/episodes/{actorId}' ] ) ;
146158 } ) ;
159+
160+ it ( 'uses --project-name for project and --name for agent resource' , async ( ) => {
161+ const projectName = `AgentProj${ Date . now ( ) . toString ( ) . slice ( - 6 ) } ` ;
162+ const agentName = `AgentResource${ randomUUID ( ) . replace ( / - / g, '' ) . slice ( 0 , 16 ) } ` ;
163+ const result = await runCLI (
164+ [
165+ 'create' ,
166+ '--project-name' ,
167+ projectName ,
168+ '--name' ,
169+ agentName ,
170+ '--language' ,
171+ 'Python' ,
172+ '--framework' ,
173+ 'Strands' ,
174+ '--model-provider' ,
175+ 'Bedrock' ,
176+ '--memory' ,
177+ 'none' ,
178+ '--skip-git' ,
179+ '--skip-install' ,
180+ '--json' ,
181+ ] ,
182+ testDir
183+ ) ;
184+
185+ expect ( result . exitCode , `stdout: ${ result . stdout } , stderr: ${ result . stderr } ` ) . toBe ( 0 ) ;
186+
187+ const json = JSON . parse ( result . stdout ) ;
188+ expect ( json . success ) . toBe ( true ) ;
189+ expect ( json . projectPath ) . toMatch ( new RegExp ( `/${ projectName } $` ) ) ;
190+ expect ( json . agentName ) . toBe ( agentName ) ;
191+ expect ( await exists ( join ( json . projectPath , 'app' , agentName ) ) ) . toBeTruthy ( ) ;
192+
193+ const projectSpec = JSON . parse ( await readFile ( join ( json . projectPath , 'agentcore/agentcore.json' ) , 'utf-8' ) ) ;
194+ expect ( projectSpec . name ) . toBe ( projectName ) ;
195+ expect ( projectSpec . runtimes [ 0 ] . name ) . toBe ( agentName ) ;
196+ } ) ;
147197 } ) ;
148198
149199 describe ( '--defaults' , ( ) => {
@@ -167,6 +217,21 @@ describe('create command', () => {
167217 expect ( result . stdout . includes ( 'would create' ) || result . stdout . includes ( 'Dry run' ) ) . toBeTruthy ( ) ;
168218 expect ( await exists ( join ( testDir , name ) ) , 'Should not create directory' ) . toBe ( false ) ;
169219 } ) ;
220+
221+ it ( 'uses project-name for project paths and name for app paths' , async ( ) => {
222+ const projectName = `DryProj${ Date . now ( ) . toString ( ) . slice ( - 6 ) } ` ;
223+ const agentName = `DryAgent${ Date . now ( ) . toString ( ) . slice ( - 6 ) } ` ;
224+ const result = await runCLI (
225+ [ 'create' , '--project-name' , projectName , '--name' , agentName , '--defaults' , '--dry-run' , '--json' ] ,
226+ testDir
227+ ) ;
228+
229+ expect ( result . exitCode ) . toBe ( 0 ) ;
230+ const json = JSON . parse ( result . stdout ) ;
231+ expect ( json . projectPath ) . toMatch ( new RegExp ( `/${ projectName } $` ) ) ;
232+ expect ( json . wouldCreate ) . toContain ( `${ json . projectPath } /app/${ agentName } /` ) ;
233+ expect ( await exists ( join ( testDir , projectName ) ) , 'Should not create directory' ) . toBe ( false ) ;
234+ } ) ;
170235 } ) ;
171236
172237 describe ( '--skip-git' , ( ) => {
0 commit comments