Skip to content

Commit 0938f80

Browse files
timothyspargclaude
andcommitted
Document the CLI
Adds CLI usage documentation to the README covering installation via SDKMAN, the apply and check commands, and available options. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cfedd1e commit 0938f80

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.adoc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,53 @@ springJavaFormat {
211211

212212

213213

214+
=== CLI
215+
The CLI provides formatting and checking support without requiring Maven or Gradle integration.
216+
217+
WARNING: The CLI is experimental and not yet considered a stable interface.
218+
219+
==== Download
220+
Native binaries for Linux, Windows, and macOS are published as assets on the corresponding https://github.com/spring-io/spring-javaformat/releases[GitHub release].
221+
222+
==== Usage
223+
[source,shell]
224+
----
225+
spring-javaformat --help
226+
----
227+
228+
The CLI provides the following commands:
229+
230+
* `apply` formats Java source files in place
231+
* `validate` checks formatting without modifying files
232+
* `check` runs Spring style checks
233+
234+
==== Examples
235+
Format sources in the current project:
236+
237+
[source,shell]
238+
----
239+
spring-javaformat apply .
240+
----
241+
242+
Validate formatting:
243+
244+
[source,shell]
245+
----
246+
spring-javaformat validate .
247+
----
248+
249+
Run style checks:
250+
251+
[source,shell]
252+
----
253+
spring-javaformat check .
254+
----
255+
256+
==== Configuration
257+
The `apply` and `validate` commands honor `.springjavaformatconfig`.
258+
259+
260+
214261
=== Java 8 Support
215262
By default, the formatter requires Java 17.
216263
If you are working on an older project, you can use a variation of the formatter based off Eclipse 2021-03 (the latest Eclipse JDT version built with Java 8).

0 commit comments

Comments
 (0)