Lunaria CLI
Lunaria comes with the built-in lunaria
command-line interface (CLI) program to help you use Lunaria from your terminal window.
Use the CLI by running one of the commands listed below, optionally including any options to modify the command’s default behavior.
You can check all the available commands and global options by typing lunaria --help
in your terminal:
npx lunaria --help
pnpm lunaria --help
yarn lunaria --help
This command will display the following message in your terminal window:
lunaria [command] [...options]
Commands
build Build your dashboard and status to disk. init Initialize Lunaria in your project. preview Preview your built dashboard locally. stdout Log your config and status in the console. sync Sync your config fields based on your project.
Global Options
--help Show this help message.--config <path> Specify the location of your config file.
Commands
lunaria build
Builds your dashboard and status to disk. By default, the files will be output in dist/lunaria
, named index.html
and status.json
respectively.
Options
--skip-status
Skips status generation and uses the latest already available status on disk instead.
This option is recommended when you want to rebuild your dashboard constantly (e.g. to test styling changes) without waiting for the status to be built.
lunaria init
Initializes Lunaria in your project, prompting you with a few questions and setting up a new lunaria.config.json
file.
lunaria preview
Starts a local server to serve your latest localization dashboard built by lunaria build
.
This command is not meant for being used in production. For production hosting, see our specific deploy instructions.
Options
--port <number>
Specifies which port to open the preview server on. By default, 3000
will be used. If 3000
or your specified port isn’t available, a random available port will be used instead.
lunaria stdout
Logs your configuration and status in the console.
This command is meant for interfacing with Lunaria without necessarily depending on the package, e.g. to build a GitHub Action that uses the already set up Lunaria in a repository.
lunaria sync
Syncs your configuration file’s files
, defaultLocale
, and/or locales
fields according to your project’s structure.
This command works by analyzing your project’s package.json
for packages Lunaria can infer the configuration, generally from its own configuration file or default content structure.
The currently supported packages in lunaria sync
are vitepress
and @astrojs/starlight
.
Options
--package <package>
Specifies the package you want to sync with, skipping the selection prompt in case several supported packages are found in the same project.
--skip-questions
Skips all the individual confirmation prompts to changes the files
, defaultLocale
, and/or locales
fields of your configuration.
Global Options
--help
Prints the help message.
--config <path>
Specifies the path to Lunaria’s configuration file relative to the project’s root. By default, Lunaria expects a lunaria.config.json
at the root of the project.
Use this option if you wish to locate your configuration file in other directory or with a different name.