{"title":"CLI","description":"","section":"","version":"v1.5","path":"cli","canonical_url":"https://amberframework.org/docs/v1.5/cli","markdown_url":"https://amberframework.org/docs/v1.5/cli.md","inherited":true,"content_markdown":"# CLI\n\nAmber has a built in CLI tool, to make your life easier while developing applications.\n\nHere is a list of the available commands:\n\n* **db, database**  - Performs database maintenance tasks\n* **e, encrypt**    - Encrypts environment YAML file. \\[env \\| -e --editor \\| --noedit\\]\n* **x, exec**       - Executes Crystal code within the application scope\n* **g, generate**   - Generate Amber classes\n* **n, new**        - Generates a new Amber project\n* **routes**        - Prints all defined application routes\n* **w, watch**      - Starts amber development server and rebuilds on file changes\n\nRead a long this guide to learn more about these command and how much time and efficient it can make your development experience.\n\n## Getting Command Help\n\nYou can get help from each command by running `-h` or `--help` next to the command\n\nEg.\n\n```text\n$ amber --help\n```\n\nThis will output to your shell the following documentation.\n\n```text\namber [OPTIONS] SUBCOMMAND\n\nAmber - Command Line Interface\n\n  The `amber new` command creates a new Amber application with a default\n  directory structure and configuration at the path you specify.\n\n  You can specify extra command-line arguments to be used every time\n  `amber new` runs in the .amber.yml configuration file in your project\n  root directory\n\n  Note that the arguments specified in the .amber.yml file does not affect the\n  defaults values shown above in this help message.\n\n  Usage:\n  amber new [app_name] -d [pg | mysql | sqlite] -t [slang | ecr] -m [granite, crecto] --deps\n\nSubcommands:\n  db, database  # Performs database maintenance tasks\n  e, encrypt    # Encrypts environment YAML file. [env | -e --editor | --noedit]\n  x, exec       # Executes Crystal code within the application scope\n  g, generate   # Generate Amber classes\n  n, new        # Generates a new Amber project\n  routes        # Prints all defined application routes\n  w, watch      # Starts amber development server and rebuilds on file changes\n\nOptions:\n  -d, --database  # Preconfigure for selected database. Options: pg | mysql | sqlite (default: pg)\n  -m, --model     # Preconfigure for selected model. Options: granite (default: granite)\n  -t, --template  # Preconfigure for selected template engine. Options: slang | ecr (default: slang)\n  -h, --help      # Describe available commands and usages\n  -v, --version   # Prints Amber version\n\nExample:\n  amber new ~/Code/Projects/weblog\n  This generates a skeletal Amber installation in ~/Code/Projects/weblog.\n```\n\n## Usage\n\n```bash\namber new [your_app] -d [pg | mysql | sqlite] -t [slang | ecr] --deps\ncd [your_app]\n```\n\n### Options\n\n* `-d` defaults to pg\n* `-t` defaults to slang\n* `--deps` will run `crystal deps` for you."}