How plugins work
When you run:
abstrax <command> [arguments]
Abstrax:
- Checks whether
<command>is a built-in command (built-ins always win). - If not, searches for an executable named
abstrax-<command>. - If found, runs the plugin with remaining arguments unchanged.
- Attaches stdin, stdout, and stderr directly to the plugin process.
- Passes through the current environment plus Abstrax-specific variables.
- Returns the plugin's exit code to the shell.
Example:
abstrax deploy production
abstrax example hello --name Mike
Plugin naming convention
Plugin binaries must be named:
abstrax-<plugin-name>
Examples:
abstrax-deploy
abstrax-backup
abstrax-example
The plugin name (used on the command line) is the part after abstrax-.
Plugin directories
Abstrax searches for plugins in this order (first match wins):
| Order | Directory |
|---|---|
| 1 | Plugin install directory (where abstrax plugin install places binaries) |
| 2 | /usr/local/lib/abstrax/plugins/ |
| 3 | /usr/lib/abstrax/plugins/ |
| 4 | ~/.local/share/abstrax/plugins/ (non-root only) |
| 5 | Each directory in PATH (looks for abstrax-<name> only) |
Abstrax never searches the current working directory.
When running as root, abstrax plugin install installs to /usr/local/lib/abstrax/plugins/. Installation records and caches are stored under /var/lib/abstrax/plugins/.