Skip to content

PSCompletions and argc-completions

TIP

WARNING

  • Some completions may be garbled due to encoding errors.
  • You may need to set the output encoding to UTF-8.
powershell
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

Use Scoop

  1. Add the abyss bucket via Github or Gitee.

    sh
    scoop bucket add abyss https://github.com/abgox/abyss
    sh
    scoop bucket add abyss https://gitee.com/abgox/abyss
  2. Install it.

    shell
    scoop install abyss/sigoden.Argc-completions
  3. Add the following content into $Profile.

powershell
# argc-completions
Set-Alias ch chezmoi # Set alias for chezmoi
$argc_scripts = @("gh", "chezmoi")
argc --argc-completions powershell $argc_scripts | Out-String | Invoke-Expression
$PSCompletions.argc_completions($argc_scripts) 

Don't use Scoop

  1. You need a quick start to argc-completions.

Please refer to the latest argc-completions repo.

bash
  git clone https://github.com/sigoden/argc-completions.git
  cd argc-completions
  ./scripts/download-tools.sh
  ./scripts/setup-shell.sh powershell
  1. Add the following content into $Profile.
powershell
# argc-completions
Set-Alias ch chezmoi # Set alias for chezmoi
$env:ARGC_COMPLETIONS_ROOT = 'D:\argc-completions'
$env:PATH = $env:ARGC_COMPLETIONS_ROOT + '\bin' + [IO.Path]::PathSeparator + $env:PATH
$argc_scripts = @("gh", "chezmoi")
argc --argc-completions powershell $argc_scripts | Out-String | Invoke-Expression
$PSCompletions.argc_completions($argc_scripts)