aspire resource command
Esta página aún no está disponible en tu idioma.
aspire resource - Execute a command on a resource.
Synopsis
Section titled “Synopsis”aspire resource <resource> <command> [options]Description
Section titled “Description”The aspire resource command executes a command exposed by a resource in a running AppHost. Use it to trigger actions such as start, stop, or restart without opening the dashboard.
The available command names depend on the selected resource. If a resource doesn’t expose the command you specify, Aspire returns an error.
When executed without the --apphost option, the command:
- Scans for all running AppHost processes.
- If multiple AppHosts are running within the current directory scope, prompts you to select which one to target.
- If only one AppHost is running in scope, connects to it directly.
- If no in-scope AppHosts are found but out-of-scope AppHosts exist, displays all running AppHosts for selection.
Arguments
Section titled “Arguments”-
<resource>The name of the resource to execute the command on.
-
<command>The name of the resource command to execute, such as
start,stop, orrestart.
Options
Section titled “Options”The following options are available:
-
--apphost <apphost>The path to the Aspire AppHost project file.
-
-?, -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”-
Restart a resource in the current AppHost:
Aspire CLI aspire resource cache restart -
Stop a specific resource:
Aspire CLI aspire resource worker stop -
Target a specific AppHost project:
Aspire CLI aspire resource api restart --apphost './src/MyApp.AppHost/MyApp.AppHost.csproj'