CLI Reference
The Encore CLI lets you run your local environment and much more.
Running
Run
Runs your application.
$ encore run [--debug] [--watch=true] [--port=<number>] [--listen=<addr>] [flags]
Flags
Test
Tests your application.
Runs the test script defined in your package.json.
$ encore test [flags]
Additional flags recognized by encore test:
Check
Checks your application for compile-time errors using Encore's compiler.
$ encore check [flags]
Flags
Exec
Runs executable scripts against the local Encore app.
Takes a command that it will execute with the local Encore app environment setup.
$ encore exec -- <command>
Flags
Example
Run a database seed script
$ encore exec -- npx tsx ./seed.ts
App
Commands to create and link Encore apps
Clone
Clone an existing Encore app from the Encore platform to your computer
$ encore app clone [app-id] [directory]
Create
Create a new Encore app
$ encore app create [name] [flags]
Flags
Init
Register an existing local repo as a new app on the Encore platform
$ encore app init [name] [flags]
Flags
Link
Link an existing local repo to an existing Encore app
$ encore app link [app-id] [flags]
Flags
Auth
Commands to authenticate with Encore
Login
Log in to Encore
$ encore auth login [flags]
Flags
Logout
Logs out the currently logged in user
$ encore auth logout
Signup
Create a new Encore account
$ encore auth signup
Whoami
Show the current logged in user
$ encore auth whoami
Daemon
Encore CLI daemon commands
Restart
If you experience unexpected behavior, try restarting the daemon using:
$ encore daemon
Env
Outputs Encore environment information
$ encore daemon env
Database Management
Database management commands
Connect to database via shell
Connects to the database via psql shell
Defaults to connecting to your local environment. Specify --env to connect to another environment.
Use --test to connect to databases used for integration testing.
Use --shadow to connect to the shadow database, used for database drift detection when using tools like Prisma.
--test and --shadow imply --env=local.
$ encore db shell [DATABASE_NAME] [--env=<name>] [flags]
encore db shell defaults to read-only permissions. Use --write, --admin and --superuser flags to modify which permissions you connect with.
Flags
Connection URI
Outputs a database connection string. Defaults to connecting to your local environment. Specify --env to connect to another environment.
$ encore db conn-uri [<db-name>] [--env=<name>] [flags]
Flags
Proxy
Sets up local proxy that forwards any incoming connection to the databases in the specified environment.
$ encore db proxy [--env=<name>] [flags]
Flags
Reset
Resets the databases for the given services. Use --all to reset all databases.
$ encore db reset <database-names...|--all> [flags]
Flags
Code Generation
Code generation commands
Generate client
Generates an API client for your app. For more information about the generated clients, see this page.
By default, encore gen client generates the client based on the version of your application currently running in your local environment.
You can change this using the --env flag and specifying the environment name.
Use --lang=<lang> to specify the language. Supported language codes are:
go: A Go client using the net/http packagetypescript: A TypeScript client using the in-browser Fetch APIjavascript: A JavaScript client using the in-browser Fetch APIopenapi: An OpenAPI spec
$ encore gen client [<app-id>] [--env=<name>] [--lang=<lang>] [flags]
Flags
Logs
Streams logs from your application
$ encore logs [--env=prod] [--json] [flags]
Flags
Kubernetes
Kubernetes management commands
Configure
Updates your kubectl config to point to the Kubernetes cluster(s) for the specified environment
$ encore k8s configure --env=ENV_NAME
Secrets Management
Secret management commands
Set
Set a secret value for a specific environment:
$ encore secret set --env <env-name> <secret-name>
Set a secret value for an environment type:
$ encore secret set --type <types> <secret-name>
Where <types> defines which environment types the secret value applies to. Use a comma-separated list of production, development, preview, and local. Shorthands: prod, dev, pr.
Examples
Entering a secret directly in terminal:
$ encore secret set --type dev MySecretEnter secret value: ...Successfully created secret value for MySecret.
Piping a secret from a file:
$ encore secret set --type dev,local MySecret < my-secret.txtSuccessfully created secret value for MySecret.
Note that this strips trailing newlines from the secret value.
List
Lists secrets, optionally for a specific key
$ encore secret list [keys...]
Delete
Deletes a secret value
$ encore secret delete <id>
Namespaces
Manage infrastructure namespaces for isolating local infrastructure. See Infrastructure Namespaces for more details.
List
List infrastructure namespaces
$ encore namespace list [--output=columns|json]
Create
Create a new infrastructure namespace
$ encore namespace create NAME
Delete
Delete an infrastructure namespace
$ encore namespace delete NAME
Switch
Switch to a different infrastructure namespace. Subsequent commands will use the given namespace by default.
Use - as the namespace name to switch back to the previously active namespace.
$ encore namespace switch [--create] NAME
Flags
Config
Gets or sets configuration values for customizing the behavior of the Encore CLI.
Configuration options can be set both for individual Encore applications, as well as globally for the local user.
$ encore config <key> [<value>] [flags]
When running encore config within an Encore application, it automatically sets and gets configuration for that application. To set or get global configuration, use the --global flag.
Flags
Telemetry
Reports the current telemetry status
$ encore telemetry
Enable
Enables telemetry reporting
$ encore telemetry enable
Disable
Disables telemetry reporting
$ encore telemetry disable
MCP
MCP (Model Context Protocol) commands for integrating with AI assistants. See MCP for more details.
Start
Starts an SSE-based MCP session and prints the SSE URL
$ encore mcp start [--app=<app-id>]
Run
Runs a stdio-based MCP session
$ encore mcp run [--app=<app-id>]
Random
Utilities for generating cryptographically secure random data.
UUID
Generates a random UUID (defaults to version 4)
$ encore rand uuid [-1|-4|-6|-7]
Flags
Bytes
Generates random bytes and outputs them in the specified format
$ encore rand bytes BYTES [-f <format>]
Flags
Words
Generates random 4-5 letter words for memorable passphrases
$ encore rand words [--sep=SEPARATOR] NUM
Flags
Deploy
Deploy an Encore app to a cloud environment.
Requires either --commit or --branch to be specified.
$ encore alpha deploy --env=<env-name> (--commit=<sha> | --branch=<name>) [flags]
Flags
Version
Reports the current version of the encore application
$ encore version
Update
Checks for an update of encore and, if one is available, runs the appropriate command to update it.
$ encore version update
Build
Generates an image for your app, which can be used to self-host your app.
Docker
Builds a portable Docker image of your Encore application.
$ encore build docker IMAGE_TAG [flags]
Flags
LLM Rules
Generate LLM rules in an existing app
Init
Initialize the LLM rules files
$ encore llm-rules init [flags]
Flags