Skip to main content

๐Ÿ–ฅ Using Logto CLI

info

Logto CLI applies to Logto OSS only. If you are using Logto Cloud, you don't need to install Logto CLI.

Get startedโ€‹

Logto CLI provide a conveneient 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