CLI

Catnip ships as a standalone executable and does not require any additional files to run other than the dependency shared libraries. The default user config is embedded directly into the executable itself.

The available CLI options are documented below.

-h, --help

Prints the help text and exits.

> catnip --help
usage: catnip [OPTION]
  -c, --config FILE     specify lua config path
  -l, --loglevel LEVEL  specify log level, must be one of:
                        silent, error, warning, info, debug
  -t, --types           print LuaCATS annotations and exit
  -d, --default         print default user config and exit
  -v, --version         print help and exit
  -h, --help            print version and exit

-v, --version

Prints the version and exits.

> catnip --version
0.1.0

-c, --config FILE

Specifies the path to the Lua config file to use. This may be either an absolute path or a path relative to the directory where the catnip executable is run.

> catnip --config ~/dots/catnip/init.lua

If unspecified, catnip will by default check the following paths (in the given order):

  1. $XDG_CONFIG_HOME/catnip/init.lua
  2. ~/.config/catnip/init.lua

-l, --log LEVEL

Specifies the granularity for logging. The granularity from least to most verbose is given as follows:

  1. silent
  2. error
  3. warning
  4. info
  5. debug
> catnip --loglevel info

By default, catnip uses --loglevel error.

-d, --default

Prints the default user config and exits.

> catnip --default
print('LUA DEFAULT CONFIG')
...