Skip to main content

Logto CLI

Logto CLI provide a convenient way to install, maintain, and update your Logto instance without handling those boring tech stuff manually.

note

Currently we don't ship binaries, thus Node.js ^18.12.0 is required in the environment.

Install CLI globally​

Install via your preferred package manager to use logto command globally:

npm i @logto/cli -g

You can always append --help to show the help info of each command:

logto --help
logto db seed --help

Local CLI​

A built-in version of CLI is shipped with every Logto release since v1.0.0-beta.11. Say you already have a Logto instance in ~/logto, then you can run the commands below:

cd ~/logto
npm run cli # Invoke the local CLI

Note if you want to execute with options, you need to prepend a -- BEFORE the options for Logto CLI, e.g.:

npm run cli db seed -- --db-url postgresql://your-database-url

Use CLI by npx​

Another way to use Logto CLI is npx, which can execute a package without installation.

npx @logto/cli

This will be helpful for one-off invocations, e.g.:

npx @logto/cli db seed --db-url postgresql://your-database-url