Command Line Interface§
makex§
Makex command line program.
See https://meta.company/go/makex for the latest documentation.
usage: ... [-h] [--verbose] [--debug] [--color {off,auto,on}]
[--cache CACHE]
{run,path,dot,affected,inputs,outputs,evaluate,tasks,targets,completions,workspace,complete,version,fix,evolve}
...
- -h, --help§
show this help message and exit
- --verbose§
Verbosity of makex messaging. Specify multiple times or set to a number between 0 and 3. (The default is 0 and the maximum is 3).
- --debug§
Enable debug and logging to the maximum level.
- --color {off,auto,on}§
Print colored messaging.
- --cache <cache>§
The unified external cache/build path.
Note
At the moment, the global flags must be specified AFTER the [sub]command.
Commands§
Makex has several commands.
makex run§
Run a task or list of tasks.
usage: makex run [-h] [--directory DIRECTORY] [--force] [--dry] [--cpus CPUS]
tasks [tasks ...]
- tasks§
- -h, --help§
show this help message and exit
- --directory <directory>§
Change to directory before evaluating tasks.
- --force§
Always run all tasks even if they don’t need to be.
- --dry§
Do a dry run. Nothing will be executed.
- --cpus <cpus>§
Worker CPUs to use for parsing, evaluating and running tasks in parallel. (Default: 1)
makex tasks§
usage: makex tasks [-h] [--paths {absolute,workspace,relative}] [--prefix]
[path]
- path§
Path to a makex file or directory. The current directory is the default.
- -h, --help§
show this help message and exit
- --paths {absolute,workspace,relative}§
How to output paths of tasks. relative is relative to the current folder.
- --prefix§
May be used to prefix all paths.
makex path§
Get the output path of a task.
usage: makex path [-h] [--real] task
- task§
Name and optional path of a task. //path:name, //:name, :name are all valid.
- -h, --help§
show this help message and exit
- --real§
Return cache path. This may be slower as it must resolve Workspaces.
makex workspace§
Print the current workspace, or the workspace detected at path.
usage: makex workspace [-h] [path]
- path§
Path representing a workspace, or inside a workspace.
- -h, --help§
show this help message and exit
makex completions§
Generate completion files for shells.
usage: makex completions [-h] [--shell {bash,zsh}] [--internal] [file]
- file§
The output file to write the completions to. If not specified, will the completion will be written to standard out.
- -h, --help§
show this help message and exit
- --shell {bash,zsh}§
- --internal§
makex fix§
Fixes and evolves makex files to be compatible with new syntax. This should only be used as instructed.
usage: makex fix [-h] [--diff] [--edit] [--formatter FORMATTER] fix_name path
- fix_name§
The name of a fix. One of [‘syntax_2024’, ‘syntax_2025’]
- path§
Path to a makex file to fix.
- -h, --help§
show this help message and exit
- --diff§
Output a diff instead of the full contents.
- --edit§
Edit files in place. Does not output anything to the standard outpujt.
- --formatter <formatter>§
Specify a formatter executable to run after fixing the file. Arguments are space separated. The formatter must take source code from standard input, and print a formatted version to standard output.
Note
The fix tool requires LibCST, which, is not packaged with Makex.
LibCST must be installed, so it is available for Python and Makex to import (in a site-packages
folder).
To install the approriate LibCST, run pip install makex[fix]
.
Note
Some parts of the file may not be fully fixed after running this command.
Users should verify the fixed Makexfile is correct and functional.
Note
Comments may not be preserved after fixing a file, especially those within a Task definition.
Warning
Before running the fix command, make sure you’ve backed up your Makex files.
The --edit
flag will edit files in place potentially destroying them.
To fix all files in a folder or workspace, use fix command along with the system find
command. For example:
# replace with the fix name
FIX_NAME=""
EDIT=""
# Uncomment this line to make edits in place
#EDIT="--edit"
find -iname Makexfile -exec makex fix $(EDIT) $(FIX_NAME) {} ";" .