agentstack apply
Synopsis
Section titled “Synopsis”agentstack apply --profile-file <path> --to <tool> [--target-root <path>] [--dry-run]Description
Section titled “Description”apply is the provider materialization step.
Today it does three things:
- writes the native config files returned by the provider adapter
- materializes enabled local package skills into the provider skill directory when that provider has one in the current runtime mapping
- materializes provider instruction files for
claudeandgeminiwhen you pass an explicit--target-root
Before overwriting any native config file, AgentStack creates a backup.
Options
Section titled “Options”| Flag | Type | Required | Description |
|---|---|---|---|
--profile-file <path> | string | Yes | Path to the canonical agentstack.yaml |
--to <tool> | codex|claude|opencode|gemini | Yes | Target provider |
--target-root <path> | string | No | Root directory used for explicit repo-root writes such as provider instruction files |
--dry-run | boolean | No | Return the translation/materialization plan without writing files |
What gets written today
Section titled “What gets written today”Native config files
Section titled “Native config files”codex->~/.codex/config.tomlclaude->~/.claude/settings.jsonopencode->~/.config/opencode/opencode.jsongemini->~/.gemini/settings.json
Local skill materialization
Section titled “Local skill materialization”If your profile contains enabled local skills, apply also writes them to the provider skill dir used by the current runtime:
claude->~/.claude/skills/<skill-id>/SKILL.mdcodex->~/.agents/skills/<skill-id>/SKILL.mdopencode->~/.opencode/skills/<skill-id>/SKILL.mdgemini->~/.gemini/skills/<skill-id>/SKILL.md
Provider instruction files
Section titled “Provider instruction files”When --target-root is provided, apply can also copy provider instruction files from instructions.provider_files into the target repository root:
claude-><target-root>/CLAUDE.mdgemini-><target-root>/GEMINI.md
Current boundary:
- this slice only supports
claudeandgemini - the source file must be declared in
instructions.provider_files - without
--target-root, AgentStack does not write these repo-root instruction files
Examples
Section titled “Examples”agentstack apply \ --profile-file ~/.agentstack/profiles/main/agentstack.yaml \ --to codexagentstack apply \ --profile-file ~/.agentstack/profiles/main/agentstack.yaml \ --to claude \ --dry-runagentstack apply \ --profile-file ./agentstack.yaml \ --to opencode \ --target-root /workspaceagentstack apply \ --profile-file ~/.agentstack/profiles/main/agentstack.yaml \ --to claude \ --target-root /workspace/my-repo