All skills
encoredev avatar

/getting-started

@cb69bb1 official
by Encoreencoredev/skills28 stars
5

Bootstrap a brand-new Encore.ts project from zero. Only for first-time CLI install and `encore app create` β€” not for architecture or feature questions.

  • 1 file
  • 3.4 KB
  • Updated 5 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/encoredev/skills/getting-started

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ43 tokens always: the name and description. β‰ˆ692 when used: this file.

Getting Started with Encore.ts

Instructions

Install Encore CLI

# macOS
brew install encoredev/tap/encore

# Linux/WSL
curl -L https://encore.dev/install.sh | bash

# Windows (PowerShell)
iwr https://encore.dev/install.ps1 | iex

Create a New App

# Interactive - choose from templates
encore app create my-app

# Or start with a blank app
encore app create my-app --example=ts/hello-world

Project Structure

A minimal Encore.ts app:

my-app/
β”œβ”€β”€ encore.app           # App configuration
β”œβ”€β”€ package.json         # Dependencies
β”œβ”€β”€ tsconfig.json        # TypeScript config
β”œβ”€β”€ encore.service.ts    # Service definition
└── api.ts               # API endpoints

The encore.app File

// encore.app
{
    "id": "my-app"
}

This file marks the root of your Encore app. The id is your app's unique identifier.

Define a Service

Create encore.service.ts to define a service:

// encore.service.ts
import { Service } from "encore.dev/service";

export default new Service("my-service");

Create Your First API

// api.ts
import { api } from "encore.dev/api";

interface HelloResponse {
  message: string;
}

export const hello = api(
  { method: "GET", path: "/hello", expose: true },
  async (): Promise<HelloResponse> => {
    return { message: "Hello, World!" };
  }
);

Run Your App

# Start the development server
encore run

# Your API is now available at http://localhost:4000

Open the Local Dashboard

# Opens the local development dashboard
encore run
# Then visit http://localhost:9400

The dashboard shows:

  • All your services and endpoints
  • Request/response logs
  • Database queries
  • Traces and spans

Common CLI Commands

Command Description
encore run Start the local development server
encore test Run tests
encore db shell <db> Open a psql shell to a database
encore gen client Generate API client code
encore app link Link to an existing Encore Cloud app

Add a Database

// db.ts
import { SQLDatabase } from "encore.dev/storage/sqldb";

const db = new SQLDatabase("mydb", {
  migrations: "./migrations",
});

Create a migration:

-- migrations/1_create_table.up.sql
CREATE TABLE items (
    id SERIAL PRIMARY KEY,
    name TEXT NOT NULL
);

Next Steps

  • Add more endpoints (see encore-api skill)
  • Add authentication (see encore-auth skill)
  • Add Pub/Sub topics (encore-pubsub), cron jobs (encore-cron), buckets (encore-bucket), secrets (encore-secret), or caching (encore-cache)
  • Deploy to Encore Cloud: encore app link then git push encore

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at cb69bb1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 5 months ago
Other metadata
when_to_use
User has no Encore project yet and is asking how to install the Encore CLI, run `encore app create`, scaffold a hello-world app, or run their very first `encore run`. SKIP if the user already has an Encore project and is asking about architecture, services, endpoints, or specific features β€” those go to `encore-service`, `encore-api`, `encore-pubsub`, etc. Trigger phrases: "completely new to Encore", "first time", "install the CLI", "brew install encoredev", "encore app create", "hello world", "just starting out".

README badge

README badge for encoredev/skills/getting-started

Installs the Encore CLI and scaffolds a new Encore.ts project with services and API endpoints. Covers the `encore app create` workflow, project structure, and running the development server with the local dashboard.

Generated from the current SKILL.md.

How do I install the Encore CLI?
Use `brew install encoredev/tap/encore` on macOS, `curl -L https://encore.dev/install.sh | bash` on Linux/WSL, or `iwr https://encore.dev/install.ps1 | iex` on Windows PowerShell.
What does `encore app create` do?
It scaffolds a new Encore.ts project interactively or with a template flag like `--example=ts/hello-world`. The command creates the project structure including encore.app configuration, package.json, and initial service/API files.
How do I run my app locally?
Use `encore run` to start the development server. Your API will be available at http://localhost:4000 and the local dashboard at http://localhost:9400.
What is the encore.app file?
It marks the root of your Encore project and contains your app's unique identifier. It is required for Encore to recognize and run your project.

Generated from the current SKILL.md. These answers refresh after source changes.