Autocompletion

Setup Assegai completion for your terminal.

$ assegai completion

Description

The CLI's autocompletion feature allows you to easily discover and use commands by pressing the <TAB> key while typing in the terminal. This saves you the hassle of having to memorize all the available commands and options.

Automated setup

The Assegai CLI completion automatic setup process occurs every time the command assegai completion is run. This process checks if the script is already installed, and if it is not, it creates a new bash completion file. Once created, the file is moved to the target path (/usr/share/bash-completion/completions/assegai). This allows users to easily set up autocompletion for the Assegai CLI in their terminal, making it easier to discover and use CLI commands without needing to memorize them.

Manual setup

While the automated setup approach may be sufficient for most cases, some users may have more complex terminal configurations, with configuration files that are stored in a specific location or structure. If you want to have more control over where this configuration is stored, you can manually set it up by having your shell run at startup:

$ source <(assegai completion script)

This is equivalent to the configuration that is automatically set up by assegai completion, and allows users with advanced terminal setup preferences to have more control over their environment if desired.

Platform support

The Assegai CLI supports autocompletion for Bash and Zsh shells on MacOS and Linux. On Windows, autocompletion is supported in Git Bash and Windows Subsystem for Linux when using either Bash or Zsh.

Global install

To enable autocompletion for Assegai CLI, you will need to ensure that your terminal is able to execute the Assegai CLI on startup. This can typically be achieved by installing the Assegai CLI globally, which will place the binary in a location that is included in your user's $PATH. If you encounter an error message stating command not found: assegai, it is likely because the Assegai CLI is not installed globally or is not in your $PATH. To fix this issue, you can try installing the Assegai CLI globally by running the appropriate installation command for your system.

Options

Option Description Value Type Default Value
--help Shows a help message for this command in the console. bool

Completion commands

Script

$ assegai completion script

Create a real-time type-ahead autocompletion script for Bash and Zsh shells.