{"title":"amber new","description":"Create the supported Amber V2 beta web application","section":"cli","version":"v2","path":"cli/new","canonical_url":"https://amberframework.org/docs/v2/cli/new","markdown_url":"https://amberframework.org/docs/v2/cli/new.md","inherited":false,"content_markdown":"# `amber new`\n\n**Run from: any directory; `NAME` controls where the project is created.**\n\n```bash\namber new NAME [options]\n```\n\n## Options\n\n| Option | Default | Meaning |\n|---|---|---|\n| `--type web|native` | `web` | Web is supported; native is preview |\n| `-d`, `--database pg|mysql|sqlite` | `sqlite` | Selects the driver, connection, and environment URLs |\n| `-t`, `--template ecr` | `ecr` | Amber V2 supports ECR only |\n| `--no-deps` | off | Skip automatic `shards install` |\n| `-y`, `--assume-yes` | off | Disable interactive prompts |\n\n`NAME` may be a simple name, relative path, absolute path, or `.`. For a path,\nthe final component becomes the project name. Paths containing spaces are\nrejected.\n\n```bash\namber new my_app\namber new my_app --type web\namber new projects/admin --type web -d sqlite\namber new /tmp/amber_smoke --type web --no-deps\namber new . --type web\n```\n\nThe first two commands generate the same web application. Omitting `--type`\nis the recommended first run; the explicit form is useful in automation.\n\n## Web template contract\n\nThe generated web app contains:\n\n- `amberframework/amber` pinned to `2.0.0-beta.5`\n- Grant pinned to the reviewed V2 commit\n- SQLite by default, or the selected PostgreSQL/MySQL driver\n- `config/database.cr` and typed per-environment database URLs\n- Micrate-powered database commands in the compiled CLI\n- Crystal `>= 1.20.0, < 2.0`\n- ECR layout and homepage\n- authored CSS, JavaScript, images, fonts, and files under `app/assets/`\n- fingerprinted output and a strict manifest under ignored `public/assets/`\n- manifest-aware ECR helpers and `amber assets build|check`\n- typed development, test, and production YAML\n- web, API, and static pipelines plus routes\n- homepage request spec and `bin/` build directory\n- no attachment shard, personal Amber fork, moving framework branch, or\n  unselected database driver\n\nThe database option installs a complete persistence choice. SQLite is the\nzero-server first run; PostgreSQL and MySQL require their matching server.\n\nThe generator builds the initial manifest before it finishes, including with\n`--no-deps`. Authored files belong in source control; generated\n`public/assets/` output does not. See the [web template\nguide](../guides/web-template/) for the exact file map and ownership boundary.\n\n## After generation\n\n**Run from: the generated application root after `cd my_app`.**\n\n```bash\ncd my_app\n# Needed only when --no-deps was used:\nshards install\namber assets check\ncrystal spec\ncrystal build src/my_app.cr -o bin/my_app\namber generate scaffold Pet name:string:required species:string:required adopted:bool\namber database migrate\namber watch\n```\n\nVerify `/`, then follow the fingerprinted CSS, JavaScript, image, and font URLs\nrendered into the HTML and compiled CSS. Those URLs come from\n`public/assets/manifest.json`; a request to an old raw `/css` or `/js` path is\nnot an asset-manifest verification.\n\n`--type native` remains available for contributors and early adopters, but it\nis not part of the Amber V2 beta install/build guarantee. Read the [native\npreview guide](../guides/native-preview/) before evaluating it."}