# interactive

## Purpose

The `interactive` command starts the Grails CLI in interactive mode.

## Example

    grails interactive

## Description

Usage:

    grails [environment]* interactive

Starts the Grails CLI (script runner) in interactive mode. Interactive mode behaves the same as running Grails commands from the command line, but keeps the JVM running in between scripts. A simple command shell allows running and re-running grails commands.

By keeping the JVM running, interactive mode avoids the (costly) JVM startup time for running successive Grails commands. It also allows the JVM JIT compiler to optimize Grails scripts, so repeated commands will execute more quickly after the initial run. This significantly speeds up repeated runs of unit tests for example.

See also `shell` and `console` commands for ways to interact with a running grails app.