Command Line Interface#

Palgen extensions can either be run from the project’s root folder or directly:

Using the palgen command#

By default, running the palgen command without any arguments executes all enabled extensions configured in the palgen.toml file.

Running a specific extension#

To run a specific extension, for instance, one named foobar, you can use the command palgen foobar. The extension should be defined somewhere within the project’s source or extension folders. To run multiple extensions at once, for example, foo and bar, you can use the compound command palgen foo bar.

Providing additional options#

You can also provide additional options for both the extension and palgen itself. These options will override configured settings from palgen.toml and can be required if a field of the Setting schema has no default and no value is given to it in the settings file. For example:

palgen --debug foo --zoinks=4 bar --baz "oh no"

This command executes palgen with debug printing enabled, runs the foo extension with the zoinks setting set to 4, and runs the bar extension with the baz setting set to "oh no".

Getting help#

To learn more about the available extensions and their settings, you can try running palgen --help. If you need help specifically for an extension (ie the foo extension), you can use the command palgen foo --help.

Executing the module directly#

It is also possible to execute palgen extensions directly using a Python interpreter. For example, you can execute python foobar.py if foobar.py contains exactly one palgen extension.

Warning

For this to work, ensure that you define only one palgen extension per Python module (that is, file).

Command line options and builtin commands#

palgen#

palgen [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options

-v, --version#

Show palgen version

--debug, --no-debug#
-j, --jobs <jobs>#

Amount of parallel tasks to use. Defaults to 2

-c, --config <config>#

Path to project configuration.

--extra-folders <extra_folders>#
--dependencies <dependencies>#
--output <output>#

Output path

palgen info#

Print project or extension info and exit. This is a builtin command.

palgen info [OPTIONS] [EXTENSION]

Arguments

EXTENSION#

Optional argument

palgen manifest#

Generate palgen.manifest for the current project. This is a builtin command.

palgen manifest [OPTIONS]

Options

-o, --output <output>#

Required Output path

-r, --relative#

Output relative paths instead of absolute ones.

palgen cmake#

Generates CMake helper scripts. This is a builtin command of the CMake integration.

palgen cmake [OPTIONS]

Options

-o, --outpath <outpath>#

Relative path to output folder

--toolchain#

Generate toolchain script

--project#

Generate project info script