This is the multi-page printable view of this section. Click here to print.
Plug-in
1 - VM driver plugins
2 - CLI plugins
⚡ Requirement | Lima >= 2.0 |
---|
Lima supports a plugin-like command aliasing system similar to git
, kubectl
, and docker
. When you run a limactl
command that doesn’t exist, Lima will automatically look for an external program named limactl-<command>
in your system’s PATH.
Creating Custom Aliases
To create a custom alias, create an executable script with the name limactl-<alias>
and place it somewhere in your PATH.
Example: Creating a ps
alias for listing instances
Create a script called
limactl-ps
:#!/bin/sh # Show instances in a compact format limactl list --format table "$@"
Make it executable and place it in your PATH:
chmod +x limactl-ps sudo mv limactl-ps /usr/local/bin/
Now you can use it:
limactl ps # Shows instances in table format limactl ps --quiet # Shows only instance names
Example: Creating an sh
alias
#!/bin/sh
# limactl-sh - Connect to an instance shell
limactl shell "$@"
After creating this alias:
limactl sh default # Equivalent to: limactl shell default
limactl sh myinstance bash # Equivalent to: limactl shell myinstance bash
How It Works
- When you run
limactl <unknown-command>
, Lima first tries to find a built-in command - If no built-in command is found, Lima searches for
limactl-<unknown-command>
in your PATH - If found, Lima executes the external program and passes all remaining arguments to it
- If not found, Lima shows the standard “unknown command” error
This system allows you to:
- Create personal shortcuts and aliases
- Extend Lima’s functionality without modifying the core application
- Share custom commands with your team by distributing scripts