Edit

Share via


What is Aspire CLI configuration?

The Aspire CLI uses a configuration file to control its behavior. You can configure feature flags to enable or disable CLI features, and specify which AppHost project the CLI should use by default for an Aspire solution.

The settings file is stored in a .aspire folder and is named settings.json. Settings files can be stored locally or globally.

The following snippet is an example .aspire/settings.json file:

{
  "appHostPath": "../AspireShop/AspireShop.AppHost/AspireShop.AppHost.csproj",
  "features": {
    "deployCommandEnabled": "true"
  }
}

Config file locations

A global Aspire CLI settings file is stored at $HOME/.aspire/globalsettings.json, and is used as the default settings for the CLI. A local settings file overwrites the settings from the global file. Local settings files are stored at ./.aspire/settings.json.

Generating a config file

The CLI automatically generates a local settings file when you run a command that requires interaction with the AppHost, or if you set a config option. For example, aspire run searches for an AppHost project, and when found, generates the ./.aspire/settings.json file with the appHostPath setting set to the project it found.

Important

appHostPath can be set globally, but the CLI ignores it and only reads it in the local settings file.

Settings

The Aspire CLI supports two categories of configuration settings:

  • Feature flags
    These settings enable or disable specific CLI features. All feature flag setting names start with feature.

  • CLI behavior
    These settings control how the CLI operates. Currently, the only CLI behavior setting is appHostPath, which specifies the location of the AppHost project.

The following table lists the settings that can be set in the config file:

Setting Description
appHostPath The path to the AppHost project that the Aspire CLI uses by default. This setting is set by the Aspire CLI when you select a project or when Aspire is first run and detects an AppHost project.
features.execCommandEnabled Enables or disables the exec command in Aspire CLI. Set to true to allow execution features, or false to disable them.
features.minimumSdkCheckEnabled Enables or disables minimum SDK version checking in Aspire CLI. Set to true to enforce SDK version requirements, or false to disable the check.
features.orphanDetectionWithTimestampEnabled Enables or disables orphan resource detection with timestamp tracking in Aspire CLI. Set to true to enable enhanced orphan detection, or false to disable it.
features.packageSearchDiskCachingEnabled Enables or disables disk caching for package search results in Aspire CLI. Set to true to cache search results locally, or false to disable caching.
features.showDeprecatedPackages Controls whether deprecated packages are shown in search results and package listings. Set to true to show deprecated packages, or false to hide them.
features.singleFileAppHostEnabled Enables or disables support for single-file AppHost projects in Aspire CLI. Set to true to enable single-file AppHost support, or false to disable it.
features.stagingChannelEnabled Enables or disables access to staging channel packages and features in Aspire CLI. Set to true to enable staging channel access, or false to disable it.
features.updateNotificationsEnabled Enables or disables update notifications in Aspire CLI. Set to true to show notifications about available updates, or false to disable them.

CLI commands

Command Status Function
aspire config Stable Command driver for managing Aspire configuration.
aspire config list Stable List all configuration values.
aspire config get <key> Stable Get a configuration value.
aspire config set <key> <value> Stable Set a configuration value.
aspire config delete <key> Stable Delete a configuration value.