This is the first command that you will run when generating a new Amber application. It creates a new Amber application with a default directory structure and configuration setting at the path you specify.
An .amber.yml
configuration file is generated a long with the default application directory structure. This stores some metadata for the Amber CLI to make use of for generating migrations, scaffolding templates, and more.
amber new [OPTIONS] NAME​Generates a new Amber project​Arguments:NAME name/path of project​Options:-d Select the database database engine, can be one of: pg | mysql | sqlite(default: pg)--deps Installs project dependencies, this is the equivalent of running (shards update)-m Select the model type, can be one of: granite(default: granite)--no-color Disable colored output-r Use a named recipe. See documentation at https://docs.amberframework.org/amber/cli/recipes.-t Selects the template engine language, can be one of: slang | ecr(default: slang)-h, --help show this help
See the Recipes option of the Command Line Tool for information about using recipes to generate applications.
Using amber new microsecond-blog
will generate a skeleton Amber application in ./microsecond-blog
. You can have a running web application in a matter of minutes:
amber new microsecond-blog -s sqlite --depscd microsecond-blogamber watchopen http://localhost:3000
Full example in terminal:
$ amber new microsecond-blogRendering App microsecond-blog in ./microsecond-blognew .amber.ymlnew .amber_secret_keynew .gitignorenew .travis.ymlnew config/application.crnew config/database.yml... [clipped]new src/views/layouts/_nav.slangnew src/views/layouts/application.slangnew src/microsecond-blog.cr$ cd microsecond-blog/$ shards installUpdating https://github.com/amberframework/amber.gitUpdating https://github.com/luislavena/radix.git... [clipped]Installing garnet_spec (0.1.1)$ amber watch02:58:23 Watcher | (INFO) Watching 22 files (server reload)...02:58:23 Watcher | (INFO) Building project microsecond-blog...02:58:31 Watcher | (INFO) Terminating app microsecond-blog...02:58:31 Watcher | (INFO) Starting microsecond-blog...02:58:31 Server | (INFO) Amber 0.7.2 serving application "microsecond-blog" at http://0.0.0.0:300002:58:31 Server | (INFO) Server started in development.02:58:31 Server | (INFO) Startup Time 00:00:00.00018200002:58:31 Watcher | Watching 10 client files...