🎯

dotnet-enable-autocomplete

🎯Skill

from im5tu/dotnet-skills

VibeIndex|
What it does

Enables dotnet CLI tab autocomplete across multiple shells, automatically detecting .NET version and configuring shell-specific completion scripts.

πŸ“¦

Part of

im5tu/dotnet-skills(10 items)

dotnet-enable-autocomplete

Installation

Quick InstallInstall with npx
npx skills add im5tu/dotnet-skills
πŸ“– Extracted from docs: im5tu/dotnet-skills
1Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Enables tab autocomplete for the dotnet CLI. Use when the user wants to set up shell completion for dotnet commands.

Overview

# .NET CLI Tab Completion

Enable tab autocomplete for the dotnet CLI in your preferred shell.

Steps

  1. Determine .NET version (CRITICAL - commands differ by version)

```bash

dotnet sdk check

```

- Parse output to identify installed SDK versions

- .NET 10+: Uses dotnet completions script (native completions)

- Pre-.NET 10: Uses dotnet complete --position (dynamic completions)

  1. Ask user which shells they use, allowing multi-select:

- PowerShell

- bash

- zsh

- fish

- nushell

For each user shell:

  1. Detect profile file location based on shell:

| Shell | Profile Path |

|-------|--------------|

| PowerShell | $PROFILE |

| bash | ~/.bashrc |

| zsh | ~/.zshrc |

| fish | ~/.config/fish/config.fish |

| nushell | ~/.config/nushell/config.nu |

  1. Check if completion already configured

- Read the profile file

- Search for existing dotnet completion setup

- If found, inform user and ask if they want to replace it

  1. Append completion script to profile based on .NET version and shell
  1. Inform user to restart their shell or source the profile

Completion Scripts

.NET 10+ (Native Completions)

PowerShell:

```powershell

dotnet completions script pwsh | Out-String | Invoke-Expression

```

bash:

```bash

eval "$(dotnet completions script bash)"

```

zsh:

```zsh

eval "$(dotnet completions script zsh)"

```

fish:

```fish

dotnet completions script fish | source

```

nushell:

See [.NET CLI docs](https://learn.microsoft.com/dotnet/core/tools/enable-tab-autocomplete) for config.nu setup.

Pre-.NET 10 (Dynamic Completions)

PowerShell:

```powershell

# dotnet CLI tab completion

Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {

param($wordToComplete, $commandAst, $cursorPosition)

dotnet complete --position $cursorPosition "$commandAst" | ForEach-Object {

[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)

}

}

```

bash:

```bash

# dotnet CLI tab completion

_dotnet_bash_complete() {

local cur="${COMP_WORDS[COMP_CWORD]}"

local IFS=$'\n'

local candidates

read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)

read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "$cur")

}

complete -f -F _dotnet_bash_complete dotnet

```

zsh:

```zsh

# dotnet CLI tab completion

_dotnet_zsh_complete() {

local completions=("$(dotnet complete --position ${CURSOR} "${BUFFER}" 2>/dev/null)")

reply=("${(ps:\n:)completions}")

}

compctl -K _dotnet_zsh_complete dotnet

```

fish:

```fish

# dotnet CLI tab completion

complete -f -c dotnet -a "(dotnet complete --position (commandline -cp) (commandline -op))"

```

nushell:

```nu

# Add to external_completer in config.nu

let external_completer = {|spans|

match $spans.0 {

dotnet => (

dotnet complete (

$spans | skip 1 | str join " "

) | lines

)

}

}

```

Error Handling

  • If dotnet sdk check fails: Ensure .NET SDK is installed
  • If profile file doesn't exist: Create it with the completion script
  • If profile file is read-only: Warn user and provide script to add manually

Notes

  • .NET 10+ provides native dotnet completions command
  • Pre-.NET 10 uses dotnet complete with dynamic scripts
  • Always back up profile before modifying
  • User must restart shell or source profile for changes to take effect

More from this repository9

🎯
dotnet-enable-testing-platform🎯Skill

Enables and configures testing platforms and frameworks for .NET projects, streamlining test setup and infrastructure.

🎯
dotnet-source-gen-logging🎯Skill

Transforms .NET logging calls to use LoggerMessage source generator for high-performance, AOT-compatible logging with zero boxing overhead.

🎯
dotnet-json-polymorphic🎯Skill

Converts JSON payloads with polymorphic type handling, enabling dynamic deserialization of complex .NET object hierarchies.

🎯
dotnet-source-gen-options-validation🎯Skill

Converts options validation to compile-time source generator for AOT-compatible, reflection-free validation at startup.

🎯
dotnet-source-gen-json🎯Skill

Generates JSON serialization and deserialization code for .NET classes using source generators, improving performance and reducing boilerplate.

🎯
dotnet-source-gen-regex🎯Skill

Converts .NET regex instances to compile-time source-generated implementations for improved performance and AOT compatibility.

🎯
dotnet-centralise-packages🎯Skill

Centralizes NuGet package versions across .NET projects by creating a single `Directory.Packages.props` file and updating project references.

🎯
dotnet-update-packages🎯Skill

Automatically lists and updates outdated NuGet packages in .NET projects, guiding users through dependency management with interactive confirmation.

🎯
dotnet-aot-analysis🎯Skill

Analyzes and configures .NET projects for Native AOT compatibility, applying source generators and optimizing AOT deployment settings.