Creating a project
howdy new my_app
howdy new creates a Howdy project in a new folder. The project is a Gleam
application with:
-
a themed home page built from Howdy UI, rendered
through a layout in
src/<project>/layouts/ -
static assets served from
priv/public -
hot reload for development, with the admin at
/_howdyand a console ready to attach -
a test suite, and
howdy checkto run it -
a
Dockerfileand a health check at/up, ready to deploy -
AGENTS.md,CLAUDE.mdand.claude/skills/, guides for coding agents working on the project
By default it also has a PostgreSQL database with an example todo list: a
migration, a todos feature with its record, database operations and a JSON
API at /api/todos, and a live todo list on the home page, rendered as a
live component. A factory for the todos and a
seed script in dev/ fill the development database with a few of them
when you run howdy db seed; see Seeds and factories.
Project names
The name must be a valid Gleam project name: lowercase letters, digits and
underscores, starting with a letter. It cannot be the name of a module that
ships with Erlang, such as pg, auth or timer, which the project's own
module would replace.
You can give a path instead, and the last segment becomes the project name:
howdy new apps/my_app
Choosing a database
--database picks the database, and postgres is the default. The app
connects to PostgreSQL through a connection pool configured from
DATABASE_URL, and the project gets a docker-compose.yml that starts
PostgreSQL with a development database and a test database.
howdy new my_app --database sqlite
--database sqlite builds the same project on SQLite, which needs no
setup: the database is a file, created and migrated the first time the app
starts.
howdy new my_app --no-database
--no-database leaves out the database and the todo list, which gives you a
page-only project. The howdy create commands that
write a table, and the howdy add packages that keep
their data in the database, need one, so they do not work in a project made
this way.
--database and --no-database cannot be used together.
Leaving things out
howdy new my_app --minimal
--minimal leaves out the dev admin, telemetry and the console, for a
project that wants nothing beyond the server.
howdy new my_api --api-only
--api-only makes a JSON backend with no pages. It leaves out Howdy UI,
Lustre, the home page, the layouts, the static files and the HTML 404 page.
With a database it keeps the todos JSON API. Packages added later follow suit: howdy add auth in
such a project adds the JSON API without the sign-in pages.
howdy new my_app --no-agents
--no-agents leaves out AGENTS.md, CLAUDE.md and .claude/skills/.
howdy new my_app --no-docker
--no-docker leaves out the Dockerfile, .dockerignore and bin/start,
for an app deployed some other way. The rest of
Ready to deploy still applies, and
howdy add docker adds the files later.
Packages from the start
howdy new my_app --with auth,storage,jobs,notifications,i18n
--with sets up more Howdy packages as the project is made, each added and
wired into the app, the dev server and the tests exactly as the matching
howdy add command would:
| Package | Sets up |
|---|---|
mail | a mailer in the services, an example email and the dev outbox |
auth | sign-in by an emailed link or code, and roles; brings mail |
flags | feature flags kept in the database, and tasks/flags |
storage | files in the services: an S3-compatible bucket or a local folder |
jobs | background jobs kept in the database, run beside the server, and tasks/jobs |
notifications | an inbox for each user at /notifications, emailed by jobs; brings mail and jobs |
i18n | catalogues in locales/, a generated messages module and each request's locale |
openapi | an OpenAPI document at /openapi.json, read at /docs |
remote | typed calls between services, over the cluster or POST /rpc/... |
Name them separated by commas, or repeat the flag. They are added in the
order above whatever order you give them in, so mail is shared, and with
auth the notifications inbox asks it who is signed in. auth, flags,
jobs and notifications keep their data in the database, so they are
refused with --no-database, as is a name howdy new does not know.
With --dry-run, the project and its packages are made in a temporary
folder, so the list of files includes everything the packages add.
Ready to deploy
Every project runs in production the way it runs in development, and a platform can manage it:
-
GET /upanswers{"status":"ok"}while the app runs, for load balancers and container platforms. It is a health check, answered before the routes and middleware and never logged. -
mainstarts the server as an OTP application, so onSIGTERMit stops taking connections and gives requests in flight 8 seconds to finish. See Supervision and shutdown. -
With a database, the app applies pending migrations as it starts, holding
a lock so copies that start together take turns.
MIGRATE_ON_START=falseleaves them to a step of their own. -
HOSTandPORTsay where it listens; it reads its configuration from the environment.
It also gets three files for containers:
-
Dockerfilebuilds an image of the app withgleam export erlang-shipment, on the Gleam and Erlang/OTP versions installed where you ranhowdy new, and runs it as an unprivileged user with aHEALTHCHECKon/up. -
.dockerignorekeepsbuild/,.envand local databases out of it. -
bin/startstarts the app in the image:runserves it,migrateapplies the migrations and exits, andremoteopens a shell inside the running app.
With PostgreSQL, docker-compose.yml can also run the image beside the
database, with docker compose --profile app up --build.
Deploying takes it from there.
What happens
howdy new works through these steps, and shows its progress as it goes:
-
It checks that
gleamis installed, and warns you iferlis missing. - It writes the project files.
-
It formats them with
gleam format. -
It downloads the dependencies with
gleam deps download. - It prints what to do next.
Downloading the dependencies needs a network connection, and Git too
with --source git. Pass
--skip-deps to leave that step out, and run gleam deps download yourself
later:
howdy new my_app --skip-deps
To see the files a command would write without writing them:
howdy new my_app --dry-run --json
Which Howdy release
Every Howdy package in a new project comes from Hex, as a range from its
version in one Howdy release up to its next major, such as
howdy_ui = ">= 1.0.0 and < 2.0.0", so the packages always work together.
By default that is the release the CLI's templates were written for. Pass
--howdy to choose another:
howdy new my_app --howdy 1.0.0
A release the templates predate may need changes to the generated code. The project's README says which release it uses and how to upgrade it.
The packages are versioned separately, so the CLI reads each release's versions from the list it was built with, or for a newer release from the release's tag on GitHub.
Pass --source git to take every package from the release's tag on GitHub
instead, such as ref = "v1.0.0", for a release that is not on Hex yet or
a fork named by repository in the config file. That
needs Git installed, and the project's Dockerfile installs Git too.
howdy new my_app --source git
howdy add follows the project: it reads whether howdy comes from Git or
Hex in gleam.toml, and adds its package the same way.
Your own defaults
If you pass the same flags every time, put them in a config file instead:
[new]
database = "sqlite"
with = ["mail", "auth"]
A flag on the command line always wins over the file, and --no-config
ignores the file altogether. A project made with a config file says which
file it read.
Flags
-
--database postgresor--database sqlite: the database to use. Defaults topostgres. -
--no-database: leave out the database and the todo list example. -
--minimal: leave out the admin, telemetry and the console. -
--api-only: a JSON backend only, without Howdy UI, pages, layouts or static files. -
--no-agents: leave outAGENTS.md,CLAUDE.mdand.claude/skills/. -
--no-docker: leave out theDockerfile,.dockerignoreandbin/start. -
--with auth,jobs: more Howdy packages to set up:mail,auth,flags,storage,jobs,notifications,i18n,openapiandremote. -
--howdy 1.0.0: the Howdy release to depend on. Defaults to the one the CLI was written for. -
--source hexor--source git: where to download the Howdy packages from. Defaults tohex. -
--no-config: ignore the config file and use the CLI's own defaults. -
--skip-deps: do not rungleam deps downloadafter creating the files. -
--dry-run: show which files would be created, without writing them. -
--json: print the result as one JSON object. -
--plain: print progress as plain lines instead of animating.
Next
Move into the project and start it with howdy dev. On PostgreSQL, the
default, start the database first with docker compose up -d.
Getting started walks through the first run.
