iai stacks sync
Sync services, agents, databases, mcps, and jobs from a stack config file
Synopsis
Sync services, agents, databases, mcps, and jobs in a project from a stack configuration file.
Services, agents, databases, mcps, and jobs are created and updated to match the config file. Resources the config file no longer mentions are NOT deleted by default: a config that omits a resource looks identical to a stale one, so the sync refuses each deletion, reports it on stderr, and continues with the creates and updates. Pass --allow-delete with the resource types you intend to decommission (services, agents, databases, mcps, jobs, or all) to delete them; within each resource type, deletes run after that type's creates and updates.
Resource types sync in order: services, databases, mcps, then agents once the self-hosted mcps are ready, and finally jobs. Remote mcps are registered on the platform.
Updates replace the whole live spec of each resource. For every service, agent, mcp, or job that changes, the live revision being replaced is printed to stderr so a sync from a stale config file is visible. Changing or deleting a job requires all its runs to finish.
Script jobs reference their files with scriptFile and pyprojectFile, resolved relative to the config file.
Use --dry-run to preview changes without applying anything.
The organization and project are read from the config file, flags, or resolved via 'iai organizations select' / 'iai projects select'.
iai stacks sync [flags]Examples
iai stacks sync --file stack.yaml
iai stacks sync --file stack.yaml --project my-project --organization my-org
iai stacks sync --file stack.yaml --dry-run
iai stacks sync --file stack.yaml --wait-timeout 10m
iai stacks sync --file stack.yaml --allow-delete services,agentsExample config file
Note:
image.typeisinternal(the project's registry) orexternal(repositoryrequired) for services and jobs; self-hosted mcps also acceptplatform, a self-hosted image fromiai mcps catalogwith norepository.
Note:
replicasandautoscalingare mutually exclusive for services. To use autoscaling instead:
Note: a remote mcp takes exactly one of
catalogIdorendpointUrl, anauth.typeof none, bearer, api_key or custom, and none of the self-hosted keys; a catalog entry supplies its own endpoint and auth headers. Create oauth and client_credentials mcps withiai mcps create; a stack never manages them.
Options
Options inherited from parent commands
SEE ALSO
iai stacks - Declarative resource sync from config files
Last updated
Was this helpful?

