Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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,agents

Example config file

Note: image.type is internal (the project's registry) or external (repository required) for services and jobs; self-hosted mcps also accept platform, a self-hosted image from iai mcps catalog with no repository.

Note: replicas and autoscaling are mutually exclusive for services. To use autoscaling instead:

Note: a remote mcp takes exactly one of catalogId or endpointUrl, an auth.type of 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 with iai 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?