@gwigz/slua

Usage

Running @gwigz/slua-create, interactive prompts, and options

Running the CLI

Run without arguments to start the interactive wizard:

npx @gwigz/slua-create

Pass a directory name to skip the first prompt:

npx @gwigz/slua-create ./my-project

Flags and non-interactive mode

Every prompt can be answered with a flag instead, and any flag-answered question is skipped:

slua-create [directory] [options]

  -t, --template <single|multi>  project template (default: single)
  -e, --extras <list>            comma-separated extras, or "none"; repeatable
                                 (jsx, config, utilities, yield, stylua, linting, formatting)
      --git / --no-git           initialize a git repository (default: git)
      --install / --no-install   install dependencies (default: install)
  -y, --yes                      accept defaults for all unanswered prompts
  -h, --help                     show this help
  -v, --version                  show version

With --yes (or whenever the CLI is not attached to a terminal, e.g. in CI or piped scripts) no prompts are shown, defaults fill anything unanswered, and the directory argument is required:

npx @gwigz/slua-create my-project --yes
npx @gwigz/slua-create my-project -y -t multi -e config,yield --no-git

Interactive prompts

The CLI asks these in order:

  1. Project directory where to create the project (skipped if a positional argument is given)
  2. Template choose between single (one new-script.ts) or multi (custom build.ts with multiple entry points)
  3. Extras optional add-ons (see below)
  4. Git whether to initialize a Git repository
  5. Install packages whether to run the package manager install automatically

Extras

ExtraDescription
JSX templatesAdds @gwigz/jsx-inline for JSX template support
Config moduleVendors the config module source into your project
Utilities moduleVendors the utilities module source into your project
Yield moduleVendors the yield module source into your project
StyLua formattingAdds a StyLua config for Lua output formatting
LintingAdds oxlint for TypeScript linting
FormattingAdds oxfmt for TypeScript formatting

Package manager detection

The CLI detects which package manager you invoked it with (npm, pnpm, or bun) and uses that one for the install command and the suggested run script in the final message.

On this page