aspire agent init command
aspire agent init - Initialize AI agent configuration for detected agent environments.
Synopsis
Section titled “Synopsis”aspire agent init [options]Description
Section titled “Description”The aspire agent init command edits the selected AI coding agents’ settings files to enable plugins and skill catalogs. It can also install companion tools and configure the Aspire MCP server.
When you run this command interactively:
- Select GitHub Copilot, Claude Code, or OpenCode. The CLI pre-selects detected agents, or GitHub Copilot if it detects none.
- Select
aspireand any companion tools you need. - Choose the project scope for repository settings or the global scope for user-level settings.
To configure the Aspire Model Context Protocol (MCP) server, opt in at the standalone setup prompt or pass --mcp. Setup operations that were chained from aspire new or aspire init commands skip MCP configuration.
Agent configuration files
Section titled “Agent configuration files”For GitHub Copilot and Claude Code, the CLI adds marketplaces to extraKnownMarketplaces and enables their plugins in enabledPlugins. The built-in plugin is aspire@aspire-skills. For OpenCode, the CLI adds catalog URLs to the skills setting.
The default settings file locations are:
| Agent | Project scope | Global scope |
|---|---|---|
| GitHub Copilot | .github/copilot/settings.json | ~/.copilot/settings.json |
| Claude Code | .claude/settings.json | ~/.claude/settings.json |
| OpenCode | opencode.jsonc | ~/.config/opencode/opencode.jsonc |
Client-specific directory overrides change the user-level paths. OpenCode reuses existing JSON or JSONC configuration files, including project files under .opencode/.
Each agent downloads and loads its configured plugins or skills. After the CLI configures the Aspire skill sources, it can remove stale copies of Aspire skills that older CLI versions wrote and that the plugin now replaces. See Remove copied Aspire skills.
In a Copilot agent environment, the Aspire plugin also provides canvas extensions for environment checks, AppHost resources, and wiring proposals.
Remove copied Aspire skills
Section titled “Remove copied Aspire skills”Older Aspire CLIs copied Aspire skills into skill folders such as .agents/skills/aspire. Configured skill sources replace those copies, but the copies become stale and nothing removes them automatically.
After configuring the Aspire skill sources, aspire agent init lists the copies that the plugin replaces at the selected scope and asks whether to delete them. The prompt defaults to No. Use --remove-skill-copies to answer ahead of time:
--remove-skill-copiesdeletes the copies.--remove-skill-copies=falsekeeps them.- When you omit the option, the CLI asks in an interactive terminal and keeps the copies in non-interactive runs. Nothing is deleted unless you opt in.
The CLI looks only where older versions wrote copies (their --skill-location choices): .agents/skills, .claude/skills, .github/skills, and .opencode/skill in each directory from the current directory up to the workspace root, and ~/.agents/skills. It doesn’t read agent-specific settings such as CLAUDE_CONFIG_DIR or OpenCode skills.paths.
After the Configured sources in ... line, the CLI reports Removed copied Aspire skills in ... or Kept copied Aspire skills in .... If you pass --remove-skill-copies but the plugin doesn’t replace the copies at the selected scope (for example, because the default source is disabled), the CLI keeps them and explains why.
The same option applies to aspire init, aspire new, and aspire mcp init, which chain into agent setup. If copies remain, aspire doctor warns about them in the Environment category and points you to aspire agent init.
Skills and tools
Section titled “Skills and tools”The CLI selects aspire by default in standalone and chained setup operations. This choice applies every enabled skillSources entry. Set skillSources.default.enabled to false to configure other plugins or catalogs without adding the built-in Aspire source. Selecting aspire doesn’t override that exclusion.
Select playwright-cli or dotnet-inspect separately for companion tools. The CLI offers dotnet-inspect only for applicable .NET AppHosts.
The Aspire plugin provides its workflow skills together. Select aspire rather than individual workflow IDs such as aspireify. Enabling the plugin doesn’t run its workflows; review and approve migration or AppHost-wiring changes before the agent applies them.
Options
Section titled “Options”The following options are available:
-
--workspace-root <workspace-root>Path to the workspace root directory. When not specified, the current directory is used as the workspace root.
-
--agents <agents>Comma-separated agent IDs:
copilot,claude, oropencode. Useallfor every supported agent ornoneto skip agent configuration. By default, the CLI selects detected agents, or GitHub Copilot if it detects none. -
--scope <project|global>Write agent settings and companion skill files at the project or user scope. Interactive setup prompts for a scope; non-interactive setup defaults to
project.Plugins, skills, and MCP configuration follow the selected scope. Telemetry hooks for GitHub Copilot and Claude Code are always written to user-level configuration (
~/.copilot/hooks/aspire-telemetry.jsonand~/.claude/settings.json), even with--scope project, so they apply in every repository where that agent runs. For what the hooks record and how to opt out, see AI agent skill usage. -
--skills <skills>Comma-separated choices:
aspire,playwright-cli, ordotnet-inspect. Thedotnet-inspectskill requires a C# AppHost in the workspace. Useallfor every applicable choice ornoneto skip them. Defaults toaspire, which applies all enabled skill sources. MCP setup is separate. -
--remove-skill-copiesDelete copied Aspire skill files that older CLI versions wrote and that the configured plugin now replaces. Pass
--remove-skill-copies=falseto keep them. When omitted, the CLI prompts in an interactive terminal and keeps the copies in non-interactive runs. -
--mcpConfigure the Aspire MCP server for the selected agents. Non-interactive setup skips MCP unless you pass this option.
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Examples
Section titled “Examples”-
Initialize AI agent configuration for detected agent environments:
Aspire CLI aspire agent init -
Enable skill sources for GitHub Copilot at project scope:
Aspire CLI aspire agent init --agents copilot --skills aspire --scope project --non-interactive -
Configure all supported agents and applicable companion tools at global scope:
Aspire CLI aspire agent init --agents all --skills all --scope global --non-interactive -
Configure Copilot and delete stale copied Aspire skills:
Aspire CLI aspire agent init --agents copilot --skills aspire --remove-skill-copies --non-interactive -
Initialize agent configuration from a specific workspace root:
Aspire CLI aspire agent init --workspace-root ./src