Quick start
In a few minutes you will install the selm CLI, create a tiny project, and run it. No prior Elm experience required.
What you need
Before the commands below, make sure you have:
- Erlang/OTP 29:
erl,erlc, andescripton your PATH - GitHub CLI (
gh) with access to this private repo: for the release install curlandunzip: for package downloads
Full prerequisite details, Postgres for the todo example, Cargo installs, and checkout builds are on the Install page.
Install, init, run
Install the private release CLI (no clone), scaffold a project, and run it:
gh api repos/nathanjohnson320/selm/contents/scripts/install-cli.sh \
-H 'Accept: application/vnd.github.raw' | bash
selm init my-app
cd my-app
selm runselm init writes selm.toml, src/Main.selm, .gitignore, and a short README. The Main module is a Hello world that uses Debug.inspect:
module Main exposing (main)
main =
Debug.inspect "greeting" "Hello, world!"
selm run builds for the Erlang target, evaluates main, and exits. You should see greeting: Hello, world! in the console.
Try a fuller example
When you want a real HTTP server, run the counter from the repo (no database):
cd examples/02_counter
selm runThat starts a server on http://127.0.0.1:3000. Prefer a full-stack app with a browser UI and Postgres?
cd examples/03_todo_app
selm serveselm serve is like run, but it also creates a local Postgres database if needed. First visit sets a session cookie.