Skip to main content
The complete command generates a completion script for your shell. This enables autocompletion for the tree-sitter CLI.
Aliases: comp

Options

shell
required
The shell for which to generate the completion script.Supported values:
  • bash
  • elvish
  • fish
  • powershell (or power-shell)
  • zsh
  • nushell

Installation by Shell

Bash

Add to your ~/.bashrc:
Or generate and save the completion script:

Zsh

Add to your ~/.zshrc:
Or save to a file in your fpath:
Then add to your ~/.zshrc before compinit:

Fish

Save to the Fish completions directory:

PowerShell

Add to your PowerShell profile:
To find your profile location:

Elvish

Add to your ~/.elvish/rc.elv:

Nushell

Add to your Nushell config:
Then source it in your config.nu:

Examples

Generate Bash Completions

Generate Zsh Completions

Generate Fish Completions

Save to File

Features

Once installed, you can:
  • Tab-complete command names:
  • Tab-complete option names:
  • See available options:

Troubleshooting

Completions Not Working

  1. Verify the completion script was loaded:
  2. Restart your shell or source your config:
  3. Check file permissions:

Wrong Completions

If completions are outdated:
  1. Regenerate the completion script
  2. Restart your shell
  3. Clear any completion cache if applicable