Skip to content

Commit

Permalink
Update 04-deriving-cli.md (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
yisraelU authored Aug 24, 2022
1 parent 95833db commit c9839db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/docs/src/03-protocols/04-deriving-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Deriving CLIs
---

- The Smithy4s Decline module provides the capability to derive a [Decline](https://ben.kirw.in/decline/) Cli for your service.
- The cli generated will be in the form of a [CommandIOApp](https://ben.kirw.in/decline/effect.html)
- Let's revisit our HelloWorld smithy definition from the [Quickstart](../01-overview/02-quickstart.md)

```kotlin
Expand Down Expand Up @@ -51,6 +52,7 @@ object HelloWorldServiceInstance{
}
```
- Now Using the ```decline``` module from Smithy4s we can wrap the service instance in an instance of a `Smithy4sCli`.
- The `Smithy4sCli` allows the customization of the Opts and stdin/stdout/stderr handling
- There is a convenient class ```Smithy4sSimpleStandaloneCli``` that you can extend and simply pass in the service wrapped in an Opts
- ``` object Hello extends standalone.Smithy4sSimpleStandaloneCli(Opts(HelloWorldServiceInstance.simple)) ```
- ```Hello``` is now a runnable `CommandIOApp` and will provide the following interface
Expand Down

0 comments on commit c9839db

Please sign in to comment.