Skip to content

Commit

Permalink
Merge pull request #219 from disneystreaming/dfrancoeur/docs
Browse files Browse the repository at this point in the history
Improve CLI docs
  • Loading branch information
Baccata authored May 19, 2022
2 parents eb0ef42 + bf89778 commit aca5285
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ lazy val docs =
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.jvmPlatform(List(Scala213))
.dependsOn(
`codegen-cli`,
http4s,
`http4s-swagger`,
`aws-http4s` % "compile -> compile,test"
Expand Down
34 changes: 30 additions & 4 deletions modules/docs/src/01-overview/04-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,42 @@ Beside the provided sbt plugin, smithy4s can be used as a CLI. It allows generat

We recommend using [coursier](https://get-coursier.io/docs/cli-launch) to install/run it.

#### Installation
### Installation

```bash
cs install --channel https://disneystreaming.github.io/coursier.json smithy4s
```

#### Usage
### Usage

```bash 
bash> smithy4s generate ./foo.smithy ./bar.smithy
```scala mdoc:invisible
import com.monovore.decline._
import smithy4s.codegen.cli._
```

The CLI comes with a number of options to customize output directories, skip openapi generation (or scala generation), provide a filter of allowed namespaces, etc. Use the `--help` command to get an exhaustive listing.

```scala mdoc:passthrough
println("```bash")
println("bash> smithy4s --help")
println(Main.commands.showHelp)
println("```")
```

#### Codegen

```scala mdoc:passthrough
println("```bash")
println("bash> smithy4s generate --help")
println(Help.fromCommand(CodegenCommand.command))
println("```")
```

#### Dump model

```scala mdoc:passthrough
println("```bash")
println("bash> smithy4s dump-model --help")
println(Help.fromCommand(DumpModelCommand.command))
println("```")
```

0 comments on commit aca5285

Please sign in to comment.