A wrapper for Just, enabling custom commands without the need to write, modify, or extend a Justfile.
just_wrapper
is a wrapper for the just
command in the form of a custom Zsh plugin. This plugin enables the use of custom commands without the need to write, modify, or extend a Justfile.
- Custom Commands: Commands specific to your workflow, but don't belong in a project's Justfile
- Overriding Commands: Commands that overwrite ones defined in a project's Justfile to suit your needs
- Shortcut Commands: Commands that simplify or shorten existing commands (e.g.
just tp
forjust test_playwright
) - Roadblocks: Commands that are used frequently, but project maintainers are hesitant to add to the Justfile
While just_wrapper
offers great flexibility, there's a potential downside: lost wisdom. If team members add custom commands without sharing them, valuable improvements to a project's just
commands might be missed. Encourage your team to share useful commands to ensure everyone benefits from collective knowledge.
To install the just_wrapper
plugin, follow these simple steps.
just_wrapper
requires the following to work:
- Install the plugin
bash <(curl -s https://raw.githubusercontent.com/swils23/just_wrapper/main/install_script) "$ZSH_CUSTOM"
- (Recommended) Alias
just
tojust_wrapper
by adding the following line in~/.zshrc
:alias just=just_wrapper
- Finally, reload your shell by running
exec $SHELL
Manual Installation
1. TODOjust_wrapper
comes with a few built-in commands that can be used globally. These commands are:
just_wrapper_edit
- Opens VS Code in the commands directoryjust_wrapper_reload
- Reloads the shell to apply changesjust_wrapper_update
- Updates the plugin to the latest version
All commands are in the $ZSH_CUSTOM/plugins/just_wrapper/commands/
directory.
$ZSH_CUSTOM/plugins/just_wrapper/commands/
├── .commands - (add simple commands here by defining new functions)
├── example_command - (add more complex commands here as script files)
└── ...more scripts here
You can add custom commands to just_wrapper
in two ways:
-
Defining functions in the
.commands
file# define commands here function custom_command() { echo "This is a custom command" } # ...
-
Adding scripts to the commands directory
These can all be called using just <command>
(or just_wrapper <command>
if you didn't alias just
to just_wrapper
).
~ ➜ just custom_command
This is a custom command
- Project-specific commands (i.e. multiple
just download_db
that are specific to different projects) - Get aliases from
~/.zshrc
working - Recursion for nested
just_wrapper
commands - Interactive installer to set up
just_wrapper
and aliases - Versioning
-
just --version
orjust just_wrapper_version
-
- Handle scripts ending in
.sh
See the open issues for a full list of proposed features (and known issues).
Sam Wilson - [email protected]