Skip to content

Commit 7efc718

Browse files
committed
Further updates to grails-shell-cli and grails-forge-cli documentation
1 parent 0d59b36 commit 7efc718

16 files changed

+69
-66
lines changed

grails-doc/src/en/guide/REST/restProfile.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
1717
under the License.
1818
////
1919

20-
Since Grails 3.1, Grails supports a tailored profile for creating REST applications that provides a more focused set of dependencies and commands.
20+
Grails supports a tailored profile for creating REST applications that provides a more focused set of dependencies and commands.
2121

2222
To get started with the REST profile using the Grails Shell CLI, create an application specifying `rest-api` as the name of the profile:
2323

@@ -30,7 +30,7 @@ This will create a new REST application that provides the following features:
3030

3131
* Default set of commands for creating and generating REST endpoints
3232
* Defaults to using JSON views for rendering responses (see the next section)
33-
* Fewer plugins than the default Grails plugin (no GSP, no Asset Pipeline, nothing HTML related)
33+
* Fewer plugins than the default Grails web profile (no GSP, no Asset Pipeline, nothing HTML related)
3434
3535
You will notice for example in the `grails-app/views` directory that there are `*.gson` files for rendering the default index page and as well as any 404 and 500 errors.
3636

@@ -44,7 +44,7 @@ $ grails generate-all my.api.Book
4444

4545
Instead of CRUD HTML interface a REST endpoint is generated that produces JSON responses. In addition, the generated functional and unit tests by default test the REST endpoint.
4646

47-
To generate a REST application using the Forge CLI (Grails 7), use the following:
47+
To generate a REST application using the Forge CLI, use the following:
4848

4949
[source,console]
5050
----

grails-doc/src/en/guide/commandLine/creatingProject.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,28 @@ specific language governing permissions and limitations
1717
under the License.
1818
////
1919

20-
Creating a project is the primary usage of the Forge CLI.
21-
2220
[NOTE]
2321
====
24-
The `create-app` and related commands are available in both the Grails Shell CLI and the Forge CLI.
22+
The `create-app` and related commands are available in both the Grails Shell CLI and the Grails Forge CLI.
2523
26-
- To create a basic project using the default Shell CLI:
24+
- To create a project using the default Grails Shell CLI:
2725
`$ grails create-app myapp`
2826
- To use Forge-specific options (such as `--java-version`, `--features`, etc.):
2927
`$ grails -t forge create-app myapp`
3028
31-
Use the Forge CLI only when you need advanced scaffolding options. Otherwise, the traditional Shell CLI is preferred and supports typical project creation.
3229
====
3330

31+
The primary command for creating a new project is `create-app`, which creates a standard Grails web application that communicates over HTTP. For other types of applications, see the documentation below.
32+
33+
Creating a project is the primary usage of the Grails Forge CLI. You can also generate an application with grails-shell, which uses profiles for generation.
34+
3435
The `create-app` and other advanced scaffolding commands support extended options in Forge, which must be run using the following format:
3536

3637
[source,console]
3738
----
3839
$ ./grails -t forge create-app myapp
3940
----
4041

41-
You can generate an application with grails-shell, which uses profiles. The primary command for creating a new project is create-app, which creates a standard Grails web application that communicates over HTTP. For other types of applications, see the documentation below.
42-
4342
After generating a project with Forge, switch to the created directory and use the default Grails shell CLI (`./grails`) to manage, run, test, and deploy your application.
4443

4544
[cols="1,3,4a,8a"]
@@ -148,7 +147,7 @@ The "create-*" commands are used to produce a fundamental Grails project, allowi
148147
|
149148
[source,shell]
150149
----
151-
--java-version 11
150+
--java-version 21
152151
----
153152
154153
| -s, --servlet

grails-doc/src/en/guide/commandLine/gradleBuild/gradlePlugins.adoc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,32 @@ under the License.
1919

2020
The `create-app` command is available in both the Grails Shell CLI and the Forge CLI.
2121

22-
- Use `grails create-app myapp` to generate a default project using the Grails Shell CLI. This is the most common usage and supports standard application scaffolding.
22+
- Use `grails create-app myapp` to generate a default project using the Grails Shell CLI. This is the most common usage.
2323
- Use `grails -t forge create-app myapp` to access advanced application generation options such as `--jdk`, `--gorm`, and other Forge-only flags.
2424
2525
The example below assumes you are using the Forge CLI, which is solely intended for **application generation**. It does not support running, building, or managing a Grails application.
2626

27-
When you create a new project with the link:../ref/Command%20Line/create-app.html[create-app] command using Grails 7 and the Forge CLI (`grails -t forge create-app`), a default `build.gradle` is generated for you.
27+
When you create a new project with the link:../ref/Command%20Line/create-app.html[create-app] command in the Forge CLI (`grails -t forge create-app`), a default `build.gradle` is generated for you.
2828

2929
[source,groovy]
3030
----
3131
plugins {
3232
id "groovy"
33-
id "org.apache.grails.gradle.grails-web"
34-
id "org.apache.grails.gradle.grails-gsp"
35-
id "com.github.erdi.webdriver-binaries"
3633
id "war"
3734
id "idea"
38-
id "com.bertramlabs.asset-pipeline"
39-
id "application"
4035
id "eclipse"
4136
}
37+
38+
apply plugin: "asset-pipeline"
39+
apply plugin: "org.apache.grails.gradle.grails-web"
40+
apply plugin: "org.apache.grails.gradle.grails-gsp"
4241
----
4342

4443
The default plugins are as follows:
4544

4645
* `groovy` - The Groovy plugin adds support for Groovy projects. It can handle Groovy code mixed with Java. Read More: https://docs.gradle.org/{gradleVersion}/userguide/groovy_plugin.html[The Groovy Plugin]
47-
* `com.github.erdi.webdriver-binaries` - A plugin that downloads and caches WebDriver binaries specific to the OS the build runs on. Read More: https://github.com/erdi/webdriver-binaries-gradle-plugin/blob/master/README.md[GitHub README]
4846
* `war` - The https://docs.gradle.org/{gradleVersion}/userguide/war_plugin.html[WAR plugin] changes the packaging so that Gradle creates a WAR file. You can comment out this plugin to build a runnable JAR file for standalone deployment.
4947
* `idea` - The IDEA plugin generates files used by http://www.jetbrains.com/idea/[IntelliJ IDEA], allowing the project to be opened from IDEA. Read More: https://docs.gradle.org/{gradleVersion}/userguide/idea_plugin.html[The IDEA Plugin]
50-
* `application` - The Application plugin facilitates creating an executable JVM application. Read More: https://docs.gradle.org/{gradleVersion}/userguide/application_plugin.html[The Application Plugin]
5148
* `eclipse` - The Eclipse plugins generate files for the http://eclipse.org/[Eclipse IDE], enabling project import (File - Import... - Existing Projects into Workspace). Read More: https://docs.gradle.org/{gradleVersion}/userguide/eclipse_plugin.html[The Eclipse Plugin]
5249
* `asset-pipeline` - The https://github.com/wondrify/asset-pipeline[Asset Pipeline] plugin enables compilation of static assets (JavaScript, CSS, etc.)
5350

grails-doc/src/en/guide/commandLine/interactiveMode.adoc

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,10 @@ Note that with ! (bang) commands, you get file path auto completion - ideal for
4040
To exit interactive mode enter the `exit` command. Note that if the Grails application has been run with `run-app` normally it will terminate when the interactive mode console exits because the JVM will be terminated. An exception to this would be if the application were running in forked mode which means the application is running in a different JVM. In that case the application will be left running after the interactive mode console terminates. If you want to exit interactive mode and stop an application that is running in forked mode, use the `quit` command. The `quit` command will stop the running application and then close interactive mode.
4141

4242

43-
With Grails Forge, when you execute the `grails` command without any arguments, the Grails Command Line Interface (CLI) enters interactive mode. In this mode, it functions like a shell, allowing you to run multiple CLI commands without the need to re-initialize the CLI runtime. This mode is particularly useful when working with code-generation commands (such as `create-controller`), creating multiple projects, or exploring various CLI features.
43+
With Grails Forge, when you execute the `grails -t forge` command, the Grails Command Line Interface (CLI) enters interactive mode. In this mode, it functions like a shell, allowing you to run multiple CLI commands without the need to re-initialize the CLI runtime. This mode is particularly useful when working with code-generation commands (such as `create-controller`), creating multiple projects, or exploring various CLI features.
4444

4545
One of the advantages of interactive mode is the availability of tab-completion. You can simply press the TAB key to view possible options for a given command or flag. Here's an example of the available options in interactive mode:
4646

47-
[NOTE]
48-
====
49-
The `create-app` command is available in both the Grails Shell CLI and the Forge CLI.
50-
51-
- To run it using the traditional shell (Grails Shell CLI), simply use: `grails create-app myapp`
52-
- To access Forge-specific options such as `--java-version` and `--list-features`, use: `grails -t forge create-app myapp`
53-
====
54-
5547
The Grails Shell CLI (`grails`) supports interactive tab-completion and most developer commands. However, advanced configuration flags are only available via the Forge CLI (`grails -t forge`).
5648
Here's an example of the available options in interactive mode:
5749

@@ -68,7 +60,7 @@ You can access general usage information for Grails commands using the help flag
6860

6961
[source,shell]
7062
----
71-
grails create-app -h
63+
grails> create-app -h
7264
Usage: grails create-app [-hivVx] [--list-features] [-g=GORM Implementation] [--jdk=<javaVersion>]
7365
[-s=Servlet Implementation] [-t=TEST] [-f=FEATURE[,FEATURE...]]... [NAME]
7466
Creates an application
@@ -100,21 +92,11 @@ Creates an application
10092
-x, --stacktrace Show full stack trace when exceptions occur.
10193
----
10294

103-
[NOTE]
104-
====
105-
To view the full set of Forge-specific options for the `create-app` command, use `grails -t forge create-app -h`.
106-
This will show additional flags not available in the Grails Shell CLI.
107-
[source,shell]
108-
----
109-
grails -t forge create-app -h
110-
----
111-
====
112-
11395
You can also obtain a list of available features by using the --list-features flag with any of the create commands.
11496

11597
[source,shell]
11698
----
117-
grails -t forge create-app --list-features
99+
grails> create-app --list-features
118100
Available Features
119101
(+) denotes the feature is included by default
120102
Name Description

grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Navigate to the directory where you want to create your Grails project:
2626
[source,console]
2727
$ cd your_project_directory
2828

29-
Create a new Grails 7 project with the following command:
29+
Create a new Grails project with the following command:
3030

3131
[source,console]
3232
$ grails -t forge create-app myapp
3333

34-
NOTE: If you're using Grails 6 or earlier, you can omit -t forge, but for Grails 7, -t forge is required to access the new CLI structure.
34+
NOTE: You can omit `-t forge`, to generate the application with Grails Shell CLI and profiles
3535

3636
=== Step 2: Access the Project Directory
3737

@@ -42,10 +42,10 @@ $ cd myapp
4242

4343
=== Step 3: Start Grails Interactive Console
4444

45-
Start the Grails interactive console by running the "grails" command:
45+
Start the Grails Forge CLI interactive console by running the "grails" command:
4646

4747
[source,console]
48-
$ grails
48+
$ grails -t forge
4949

5050
=== Step 4: Create a Controller
5151

grails-doc/src/en/guide/gettingStarted/creatingAnApplication.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ $ grails <<command name>>
2424

2525
Run link:../ref/Command%20Line/create-app.html[create-app] to create an application:
2626

27+
NOTE: The `create-app` command is supported by both the Grails Shell CLI and the Grails Forge CLI.
28+
29+
Grails Shell CLI
2730
[source,console]
2831
$ grails create-app myapp
2932

33+
Grails Forge CLI
3034
[source,console]
3135
$ grails -t forge create-app myapp
3236

33-
NOTE: The `create-app` command is supported by both the Grails Shell CLI and the Forge CLI. Use `grails create-app` by default, as it is the most common and preferred usage. Only use `grails -t forge create-app` when you need Forge-specific options like `--java-version` or `--features`.
34-
3537
This will create a new directory inside the current one that contains the project. Navigate to this directory in your console:
3638

3739
[source,console]

grails-doc/src/en/guide/gettingStarted/creatingArtefacts.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@ Grails provides a set of useful CLI commands for various tasks, including the cr
2121

2222
For instance, to create the foundation of an application, you typically need to generate a domain model using Grails Commands:
2323

24+
The `create-app` and `create-domain-class` commands are supported in both the Grails Shell CLI and the Grails Forge CLI.
25+
26+
27+
Grails Forge CLI
28+
[source,console]
29+
----
30+
$ grails -t forge create-app myapp
31+
$ cd myapp
32+
$ grails -t forge create-domain-class book
33+
----
34+
35+
Grails Shell CLI
2436
[source,console]
2537
----
2638
$ grails create-app myapp
2739
$ cd myapp
2840
$ grails create-domain-class book
2941
----
3042

31-
The `create-app` command is supported in both the Grails Shell CLI and the newer Forge CLI. Use the default `grails create-app` command with the Shell CLI unless you need Forge-specific options like `--java-version`, in which case you should run it with `grails -t forge create-app`.
32-
3343
Executing these commands will result in the creation of a domain class located at `grails-app/domain/myapp/Book.groovy`, as shown in the following code:
3444

3545
[source,groovy]

grails-doc/src/en/guide/gettingStarted/downloadingAndInstalling.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Historically, this shell has not had autocompletion.
4141
By default, `./grails` uses `grails-shell-cli` for backwards compatibility.
4242
To use `grails-forge-cli`, pass the `-t` or `--type` argument:
4343
[source,console]
44-
$ ./grails -t forge create-app myapp
44+
$ ./grails -t forge
4545

4646

4747
=== Install with SDKMAN
@@ -57,7 +57,7 @@ You can also specify a version
5757
$ sdk install grails {version}
5858

5959
You can find more information about SDKMAN usage on the https://sdkman.io/usage[SDKMAN Docs].
60-
After installing, all three CLI commands`grails`, `grails-shell-cli`, and `grails-forge-cli`—should be available.
60+
After installing, all three CLI commands: `grails`, `grails-shell-cli`, and `grails-forge-cli` will be available.
6161

6262
=== Manual installation
6363

grails-doc/src/en/guide/gettingStarted/usingInteractiveMode.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Since 3.0, Grails has an interactive mode which makes command execution faster s
2323

2424
image::interactive-output.png[]
2525

26-
NOTE: As of **Grails 7**, both the Grails Shell CLI and the Forge CLI are available. Interactive mode is part of the Grails Shell CLI and is accessed by typing `grails` without additional arguments. Only use the `-t forge` flag when you need Forge-specific commands, such as `--java-version`.
26+
NOTE: As of **Grails 7**, both the Grails Shell CLI and the Forge CLI are available. Interactive mode is part of the Grails Shell CLI and is accessed by typing `grails` without additional arguments. Grails Forge CLI is accessed as `grails -t forge`.
2727

2828
For more information on the capabilities of interactive mode refer to the section on link:commandLine.html#interactiveMode[Interactive Mode] in the user guide.
2929

grails-doc/src/en/guide/plugins/creatingAndInstallingPlugins.adoc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,34 @@ under the License.
2020

2121
==== Creating Plugins
2222

23-
// Not updated for Grails 7
2423
Creating a Grails plugin is a simple matter of running the command:
2524

25+
Grails Shell CLI
2626
[source,groovy]
2727
----
2828
grails create-plugin <<PLUGIN NAME>>
2929
----
3030

31-
This will create a web-plugin project for the name you specify. For example running `grails create-plugin example` would create a new web-plugin project called `example`.
31+
Grails Forge CLI
32+
[source,groovy]
33+
----
34+
grails -t forge create-plugin <<PLUGIN NAME>>
35+
----
3236

33-
In Grails 3.0 you should consider whether the plugin you create requires a web environment or whether the plugin can be used with other profiles. If your plugin does not require a web environment then use the "plugin" profile instead of the default "web-plugin" profile:
37+
This will create a plugin project for the name you specify. For example running `grails create-plugin example` would create a new plugin project called `example`.
38+
39+
You should consider whether the plugin you create requires a web environment or whether the plugin can be used with other profiles. If your plugin requires a web environment then use the "web-plugin" profile instead of the default "plugin" profile:
3440

41+
Grails Shell CLI
3542
[source,groovy]
3643
----
37-
grails create-plugin <<PLUGIN NAME>> --profile=plugin
44+
grails create-web-plugin <<PLUGIN NAME>>
45+
----
46+
47+
Grails Forge CLI
48+
[source,groovy]
49+
----
50+
grails -t forge create-web-plugin <<PLUGIN NAME>>
3851
----
3952

4053
Make sure the plugin name does not contain more than one capital letter in a row, or it won't work. Camel case is fine, though.

0 commit comments

Comments
 (0)