Usage
How to create a new console, handle seeding, migrations, create admin users, and configure environment variables from any terminal.
Create New Console
With the CLI installed, you can now create a new console. Follow the steps to configure your Console with your DATABASE_URL
. In your terminal, execute:
Make sure Docker is running!🐳
2bttns-cli new
Behind the scenes, this will:
create a
docker-compose.yml
file in the current directory.launch your Console,
apply migrations to your specified database,
seed the database with examples (optional)
Database Migration & Seeding
Migrations
Migrate a specified database or the one set in your configuration.
2bttns-cli db migrate -d <database-url> # pass database-url if not already set
Seeding
Seed a specified database.
IMPORTANT: Ensure the database is migrated before seeding.
2bttns-cli db seed -d <database-url> # pass database-url if not already set
Creating Admins
Interactive
Create an admin interactively (recommended):
2bttns-cli admin create -d <database-url> -s <nextauth-secret>
Command Line
Create an admin using command line arguments:
## Using credentials:
2bttns-cli admin create credentials -u <username> -p <password> -d <database-url> -s <nextauth-secret>
## Using OAuth:
2bttns-cli admin create oauth-allow -e <email> -d <database-url> -s <nextauth-secret>
Configuration Values
DATABASE_URL
The URL of the Postgres database to connect to.
NEXTAUTH_SECRET
The secret used by NextAuth.
NEXTAUTH_URL
The URL of the 2bttns app.
GITHUB_ID
The GitHub OAuth app ID, if you want to allow admin users to sign in via GitHub.
GITHUB_SECRET
The GitHub OAuth app secret that corresponds to your GITHUB_ID.
SERVER_LOG_LEVEL
The log level for the server.
SERVER_LOG_LOCALE
The log locale for the server.
Was this helpful?