@@ -50,6 +50,7 @@ const normalizeSecretsRoot = (value: string): string => trimRightChar(value, "/"
5050type RepoBasics = {
5151 readonly repoUrl : string
5252 readonly repoSlug : string
53+ readonly projectSlug : string
5354 readonly repoPath : string
5455 readonly repoRef : string
5556 readonly targetDir : string
@@ -63,7 +64,10 @@ const resolveRepoBasics = (raw: RawOptions): Either.Either<RepoBasics, ParseErro
6364 const resolvedRepo = resolveRepoInput ( rawRepoUrl )
6465 const repoUrl = resolvedRepo . repoUrl
6566 const repoSlug = deriveRepoSlug ( repoUrl )
66- const repoPath = deriveRepoPathParts ( repoUrl ) . pathParts . join ( "/" )
67+ const repoPathParts = deriveRepoPathParts ( repoUrl ) . pathParts
68+ const workspaceSuffix = resolvedRepo . workspaceSuffix
69+ const projectSlug = workspaceSuffix ? `${ repoSlug } -${ workspaceSuffix } ` : repoSlug
70+ const repoPath = workspaceSuffix ? [ ...repoPathParts , workspaceSuffix ] . join ( "/" ) : repoPathParts . join ( "/" )
6771 const repoRef = yield * _ (
6872 nonEmpty ( "--repo-ref" , raw . repoRef ?? resolvedRepo . repoRef , defaultTemplateConfig . repoRef )
6973 )
@@ -73,7 +77,7 @@ const resolveRepoBasics = (raw: RawOptions): Either.Either<RepoBasics, ParseErro
7377 const sshUser = yield * _ ( nonEmpty ( "--ssh-user" , raw . sshUser , defaultTemplateConfig . sshUser ) )
7478 const sshPort = yield * _ ( parsePort ( raw . sshPort ?? String ( defaultTemplateConfig . sshPort ) ) )
7579
76- return { repoUrl, repoSlug, repoPath, repoRef, targetDir, sshUser, sshPort }
80+ return { repoUrl, repoSlug, projectSlug , repoPath, repoRef, targetDir, sshUser, sshPort }
7781 } )
7882
7983type NameConfig = {
@@ -84,12 +88,12 @@ type NameConfig = {
8488
8589const resolveNames = (
8690 raw : RawOptions ,
87- repoSlug : string
91+ projectSlug : string
8892) : Either . Either < NameConfig , ParseError > =>
8993 Either . gen ( function * ( _ ) {
90- const derivedContainerName = `dg-${ repoSlug } `
91- const derivedServiceName = `dg-${ repoSlug } `
92- const derivedVolumeName = `dg-${ repoSlug } -home`
94+ const derivedContainerName = `dg-${ projectSlug } `
95+ const derivedServiceName = `dg-${ projectSlug } `
96+ const derivedVolumeName = `dg-${ projectSlug } -home`
9397 const containerName = yield * _ (
9498 nonEmpty ( "--container-name" , raw . containerName , derivedContainerName )
9599 )
@@ -111,7 +115,7 @@ type PathConfig = {
111115
112116const resolvePaths = (
113117 raw : RawOptions ,
114- repoSlug : string ,
118+ projectSlug : string ,
115119 repoPath : string
116120) : Either . Either < PathConfig , ParseError > =>
117121 Either . gen ( function * ( _ ) {
@@ -127,7 +131,7 @@ const resolvePaths = (
127131 : `${ normalizedSecretsRoot } /global.env`
128132 const defaultEnvProjectPath = normalizedSecretsRoot === undefined
129133 ? defaultTemplateConfig . envProjectPath
130- : `${ normalizedSecretsRoot } /${ repoSlug } .env`
134+ : `${ normalizedSecretsRoot } /${ projectSlug } .env`
131135 const defaultCodexAuthPath = normalizedSecretsRoot === undefined
132136 ? defaultTemplateConfig . codexAuthPath
133137 : `${ normalizedSecretsRoot } /codex`
@@ -163,8 +167,8 @@ export const buildCreateCommand = (
163167) : Either . Either < CreateCommand , ParseError > =>
164168 Either . gen ( function * ( _ ) {
165169 const repo = yield * _ ( resolveRepoBasics ( raw ) )
166- const names = yield * _ ( resolveNames ( raw , repo . repoSlug ) )
167- const paths = yield * _ ( resolvePaths ( raw , repo . repoSlug , repo . repoPath ) )
170+ const names = yield * _ ( resolveNames ( raw , repo . projectSlug ) )
171+ const paths = yield * _ ( resolvePaths ( raw , repo . projectSlug , repo . repoPath ) )
168172 const runUp = raw . up ?? true
169173 const force = raw . force ?? false
170174 const enableMcpPlaywright = raw . enableMcpPlaywright ?? false
0 commit comments