# 4. The Command Line

Grails' command line system is built on Gant - a simple Groovy wrapper around Apache Ant.

However, Grails takes it a bit further through the use of convention and the `grails` command. When you type:

    grails [command name]

Grails does a search in the following directories for Gant scripts to execute:

- `USER_HOME/.grails/scripts`
- `PROJECT_HOME/scripts`
- `PROJECT_HOME/plugins/*/scripts`
- `GRAILS_HOME/scripts`

Grails will also convert command names that are in lower case form such as run-app into camel case. So typing

    grails run-app

Results in a search for the following files:

- `USER_HOME/.grails/scripts/RunApp.groovy`
- `PROJECT_HOME/scripts/RunApp.groovy`
- `PLUGINS_HOME/*/scripts/RunApp.groovy`
- `GLOBAL_PLUGINS_HOME/*/scripts/RunApp.groovy`
- `GRAILS_HOME/scripts/RunApp.groovy`

If multiple matches are found Grails will give you a choice of which one to execute. When Grails executes a Gant script, it invokes the "default" target defined in that script. If there is no default, Grails will quit with an error.

To get a list and some help about the available commands type:

    grails help

Which outputs usage instructions and the list of commands Grails is aware of:

    Usage (optionals marked with *):
    grails [environment]* [target] [arguments]*Examples:
    grails dev run-app
    grails create-app booksAvailable Targets (type grails help 'target-name' for more info):
    grails bootstrap
    grails bug-report
    grails clean
    grails compile
    ...

> Refer to the Command Line reference in left menu of the reference guide for more information about individual commands