跳转到内容
Docs Try Aspire
Docs Try

aspire docs api search command

此内容尚不支持你的语言。

aspire docs api search - Search Aspire API reference documentation by keyword.

Aspire CLI
aspire docs api search <query> [options]

The aspire docs api search command performs a keyword-based search across the Aspire API reference index from aspire.dev. Use it to find types, methods, extension methods, or other API members by name or concept, without needing to know the exact package hierarchy.

Results are ranked by relevance and include the identifier and display name for each match. Use the identifier returned in search results with the aspire docs api get command to retrieve the full content of an API reference entry.

Optionally filter results to a specific language using the --language option.

  • <query>

    The search query. Use type names, method names, or keywords to describe the API you are looking for. For example, AddRedis, IResourceBuilder, or WithReference.

The following options are available:

  • --language <language>

    Filter results to a specific language. Supported values are csharp and typescript. When omitted, results from all supported languages are returned.

  • --format <Table|Json>

    Output format. Choose Table for a human-readable table or Json for machine-readable JSON output. Defaults to Table.

  • -n, --limit <limit>

    Maximum number of search results to return. Defaults to 5.

  • -?, -h, --help

    Prints 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-interactive

    Run the command in non-interactive mode, disabling all interactive prompts and spinners.

  • --nologo

    Suppress the startup banner and telemetry notice.

  • --banner

    Display the animated Aspire CLI welcome banner.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • Search for API entries related to Redis:

    Aspire CLI
    aspire docs api search "AddRedis"
  • Search in C# only:

    Aspire CLI
    aspire docs api search "IResourceBuilder" --language csharp
  • Search in TypeScript only:

    Aspire CLI
    aspire docs api search "withReference" --language typescript
  • Search with a custom result limit:

    Aspire CLI
    aspire docs api search "WithCommand" --language csharp --limit 10
  • Search and output results in JSON format:

    Aspire CLI
    aspire docs api search "service defaults" --format Json