Tab completion
The Magnolia CLI provides tab autocompletion support for Bash and Windows PowerShell.
Enabling tab completion
Navigate to your project root and run the following command:
npm run mgnl -- tab-completion
You’ll be prompted to choose the installation type:
? Which tab completion installation do you want? (Use arrow keys)
❯ Local only (using: `npm run mgnl` or `yarn mgnl` command)
Global only (using: `mgnl` command)
Both local and global
To reinstall tab completion with a different option, use:
npm run mgnl -- tab-completion --reinstall
After a successful installation, the CLI adds the a completion script to the appropriate configuration files and sets tabCompletion: true in the mgnl.config.js file.
| You must restart your terminal for the changes to take effect. |
To test whether tab completion is working, type npm run mgnl (or mgnl if installed globally) and press the Tab key to view the list of available commands and options.
| On the first run, there might be a short delay while the script loads and caches available commands. |
Disabling tab completion
To disable tab completion for the current project, run:
npm run mgnl -- tab-completion --disable
Alternatively, you can manually set tabCompletion: false in the mgnl.config.js file.
The --disable flag doesn’t remove the installed script.
It only disables autocompletion for the current project.
Other projects with tabCompletion: true will still support command suggestions.
|
Uninstalling tab completion
To completely remove tab completion, use the following command:
npm run mgnl -- tab-completion --uninstall
This command sets tabCompletion: false in the current project and removes the installed scripts.
Projects with tabCompletion: true will no longer support tab completion unless the scripts are reinstalled.
|