It took me a few minutes to figure out that when you want help on Play Framework console commands (i.e., the Play command line tool), you may get more useful help by typing
help play instead of just
help. Using the first command shows information on commands like
console, etc., which is what I'm more interested in.
To take a quick look at this, here's what you get when you type
[MyApp] $ help play Welcome to Play 2.0! These commands are available: ----------------------------- classpath Display the project classpath. clean Clean all generated files. compile Compile the current application. console Launch the interactive Scala console (use :quit to exit). dependencies Display the dependencies summary. dist Construct standalone application package. exit Exit the console. h2-browser Launch the H2 Web browser. license Display licensing informations. package Package your application as a JAR. play-version Display the Play version. publish Publish your application in a remote repository. publish-local Publish your application in the local repository. reload Reload the current application build file. run <port> Run the current application in DEV mode. test Run Junit tests and/or Specs from the command line eclipsify generate eclipse project file idea generate Intellij IDEA project file sh <command to run> execute a shell command start <port> Start the current application in another JVM in PROD mode. update Update application dependencies. Type `help` to get the standard sbt help.
Now that you've seen basic help on these commands, you can type 'help [command]' to show additional information about each command:
[MyApp] $ help clean Deletes files produced by the build, such as generated sources, compiled classes, and task caches. [MyApp] $ help console Starts the Scala interpreter with the project classes on the classpath. [MyApp] $ help package Produces the main artifact, such as a binary jar. This is typically an alias for the task that actually does the packaging.
Before I learned that you need to type
help play to see those commands, I was just typing
help. Here's what you get when you do that:
[MyApp] $ help play Enter the play console help command* Displays this help message or prints detailed help on requested commands. about Displays basic information about sbt and the build. reboot [full] Reboots sbt and then executes the remaining commands. < file* Reads command lines from the provided files. !! Execute the last command again !: Show all previous commands !:n Show the last n commands !n Execute the command with index n, as shown by the !: command !-n Execute the nth command before this one !string Execute the most recent command starting with 'string' !?string Execute the most recent command containing 'string' ~ <command> Executes the specified command whenever source files change. exit Terminates the build. reload Loads the project in the current directory projects Displays the names of available projects. project [project] Displays the current project or changes to the provided `project`. - command Registers 'command' to run if a command fails. iflast command If there are no more commands after this one, 'command' is run. ( ; command )+ Runs the provided semicolon-separated commands. shell Provides an interactive prompt from which commands can be run. set <setting-expression> Evaluates the given Setting and applies to the current project. tasks Displays the tasks defined for the current project. inspect <key> Prints the value for 'key', the defining scope, delegates, related definitions, and dependencies. eval <expression> Evaluates the given Scala expression and prints the result and type. alias Adds, removes, or prints command aliases. append command Appends `command` to list of commands to run. last <key> Prints the last output associated with 'key'. last-grep <pattern> <key> Shows lines from the last output for 'key' that match 'pattern'. session ... Manipulates session settings. For details, run 'help session'.. show <key> Displays the result of evaluating the setting or task associated with 'key'.
That's also useful, but typically I want to see the commands that are listed when I type
help play, hence this short blog post.
The output shown comes from the Play Framework 2.0.4 command line. For more information and help on using the Play console, see the Play Console documentation.