Problem
When deploying Agentuity projects, the deployment.domains configuration in agentuity.json only accepts a flat array of domain strings. All configured domains are applied to every deployment, regardless of which git branch is being deployed.
This means there's no way to associate specific custom domains with specific branches. For example, a common multi-environment setup would be:
main branch → app.example.com, www.example.com
staging branch → staging.example.com
dev branch → dev.example.com
Today, users must either:
- Manually edit
agentuity.json before deploying each branch
- Use separate profile files (
agentuity.staging.json) and remember to pass --profile on every deploy
- Handle it in CI with custom logic to swap domains before deploying
None of these are ergonomic for the common "branch = environment" pattern.
Proposed Solution
Extend the domains property to accept either its current format (flat array, backward compatible) or a branch-keyed map:
{
"deployment": {
"domains": {
"*": ["app.example.com", "www.example.com"],
"staging": ["staging.example.com"],
"dev": ["dev.example.com"]
}
}
}
Where:
* is the wildcard key matching default branches (main, master), or used when no branch is detected
- Other keys are exact branch name matches
- At deploy time, the CLI resolves the map to a flat array based on the current git branch (auto-detected or via
--branch flag)
- The API contract is unchanged — the server always receives a flat
string[]
CLI Support
Add a --branch flag to agentuity project add domain:
# Add domain for staging branch
agentuity project add domain staging.example.com --branch staging
# Add domain for default/main branch
agentuity project add domain app.example.com --branch "*"
# Existing flat array behavior (unchanged)
agentuity project add domain app.example.com
When --branch is first used on a project with an existing flat domain array, the existing domains are automatically migrated to the * key.
Problem
When deploying Agentuity projects, the
deployment.domainsconfiguration inagentuity.jsononly accepts a flat array of domain strings. All configured domains are applied to every deployment, regardless of which git branch is being deployed.This means there's no way to associate specific custom domains with specific branches. For example, a common multi-environment setup would be:
mainbranch →app.example.com,www.example.comstagingbranch →staging.example.comdevbranch →dev.example.comToday, users must either:
agentuity.jsonbefore deploying each branchagentuity.staging.json) and remember to pass--profileon every deployNone of these are ergonomic for the common "branch = environment" pattern.
Proposed Solution
Extend the
domainsproperty to accept either its current format (flat array, backward compatible) or a branch-keyed map:{ "deployment": { "domains": { "*": ["app.example.com", "www.example.com"], "staging": ["staging.example.com"], "dev": ["dev.example.com"] } } }Where:
*is the wildcard key matching default branches (main,master), or used when no branch is detected--branchflag)string[]CLI Support
Add a
--branchflag toagentuity project add domain:When
--branchis first used on a project with an existing flat domain array, the existing domains are automatically migrated to the*key.