Skip to content

Command Line Tools

Quick Start

You’ll ship a running Wheels app with one CRUD resource — a blog post with a title and body — wired through model, controller, views, migration, tests, and routes.

This page assumes wheels --version already works. If it doesn’t, run through Installation first.

From wherever you keep projects:

Terminal window
wheels new myblog --no-open-browser

wheels new scaffolds a fresh project directory named myblog with SQLite pre-wired as the zero-config datasource. The --no-open-browser flag skips the “pop open http://localhost:8080 once the server is ready” behavior — useful when you want to drive things manually.

example
cd myblog
wheels start

The dev server binds to port 8080 by default and runs in the background — the command returns once the server is up, leaving your terminal free. Stop it later with wheels stop. On first boot the wrapper resolves dependencies and compiles the application; subsequent starts are quick.

Override the port with --port=3000 if 8080 is busy.

Back in the same terminal (the server is already running in the background), generate the resource:

Terminal window
wheels generate scaffold Post title:string body:text

This generates the full CRUD stack — a Post model, Posts controller with seven actions, index/show/new/edit views, a CreatePosts migration with title (string) and body (text) columns, a test spec, and a resource route. Attribute syntax is name:type — types map to the Wheels migration column types (string, text, integer, boolean, decimal, datetime, date, time).

illustrative — requires running server
wheels migrate latest

This applies every pending migration — here, the CreatePosts migration the scaffold just wrote. Other subcommands: wheels migrate up (run the next migration), wheels migrate down (roll back one), wheels migrate info (show current state).

Open http://localhost:8080/posts in your browser. You should see the Posts index view — empty at first. Click “New Post”, create a record, and the full CRUD flow — list, show, edit, delete — is live against the SQLite database.

If you changed the port in step 2, substitute that port instead.

With the server still running in the background:

illustrative — requires running server
wheels test posts

The trailing positional is a directory scope, not a filename match — posts expands to tests.specs.posts. The scaffold generated PostSpec.cfc under tests/specs/models/ and PostsControllerSpec.cfc under tests/specs/controllers/, so on a fresh scaffold the posts scope matches neither directory and the run reports 0 passed. Use wheels test models or wheels test controllers to scope to the generated specs — though note that plain wheels test also reports 0 passed here, because the generated specs are empty describe stubs until you write expectations into them. A run with failing or erroring specs exits non-zero; a run with no failures exits 0.

The scaffold gives you CRUD, not a login flow. See Authentication Patterns for cookbook-style recipes — session-based, token-based, and third-party OAuth — that drop onto the scaffold you just generated.

To swap SQLite for a real database, tune the reload password, or wire per-environment settings, see Configuration and the Database guide. The datasource name defaults to the app name (myblog) and lives in config/settings.cfm.

The deployment story — Kamal-based single-command deploys to any VPS — lands in a later docs phase. For now: the app is a standard CFML application that runs on Lucee 6/7, Adobe ColdFusion 2018+, or BoxLang, so any host that speaks those runtimes will serve it. Concrete deployment guides are coming.