Documenting your projects with a Justfile
package.json file and in Elixir you would create Mix tasks.
Also, you might want to document your commands and list them for an overview. Some language specific tools provide you with a way of documenting tasks and even listing them. Often they list every possible task, also the ones that are provided by a certain framework and you loose some oversight quickly. In both cases you might start adding documentation about your project commands to your
README. This documentation then has to be kept in sync with your actual commands.
In some projects I worked on there were
Makefiles used to define and document commands. However,
Makefiles were not created for running tasks but as a utility “… which determines automatically which pieces of a large program need to be recompiled, and issues the commands to recompile them”. So you might run into weird cases where a command might not execute because
make decides not to or you have set it up in a certain way.
just to the rescue
justis a handy way to save and run project-specific commands.
just is exactly meant as a way to solve the issues described above. You define all your important commands in a
Justfile (similar to a
Makefile) and you optionally document them. In the
README you only need a hint to the usage of
just and that’s it. All your commands are easy to discover without out-of-date documentation.
And if you define the default command to be
just --list, all you need to do is to run
just and you know what’s possible in the project you want to work on.