Documentation

amber watch

Updated
Browse documentation

Published 2026-08-13. V2 is a prerelease; the web core is release-gated and other previews are named separately. What beta means.

Read this page as HTML, Markdown, or structured JSON—or open the published Markdown with an AI assistant. Gemini receives the prompt through your clipboard because its signed-out page does not reliably prefill URL text; paste when the new tab opens. External assistants need the public site URL.

amber watch

Run from: the generated application root beside shard.yml.

Terminal
amber watch

The default V2 watch configuration rebuilds when Crystal source, environment YAML, ECR views, or authored assets change. It builds assets first, creates bin/, builds the app target, runs it, and restarts after matching files change.

YAML
watch:
  run:
    build_commands:
      - mkdir -p bin
      - crystal build ./src/my_app.cr -o bin/my_app
    run_commands:
      - bin/my_app
    include:
      - ./config/**/*.cr
      - ./config/environments/*.yml
      - ./src/**/*.cr
      - ./src/**/*.ecr
      - ./app/assets/**/*

Use environment variables normally:

Terminal
AMBER_SERVER_PORT=8080 amber watch

Stop the watcher with Ctrl-C. If a rebuild fails, run the printed build command directly to get the complete compiler error.

Asset-aware watch cycle

CLI 2.0.6 runs the same build-time compiler as amber assets build before application compilation. A deleted asset, missing CSS image/font reference, missing local JavaScript dependency, or invalid manifest entry therefore stops the rebuild instead of becoming a browser 404.