Skip to content

Commit

Permalink
update README with MacOS instructions and transform info (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
eemcmullan authored Aug 30, 2023
1 parent 4af9a63 commit 27e7b72
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
Kantra is an experimental CLI that unifies analysis and transformation capabilities of Konveyor.

## Installation
### Linux

Easiest way to install Kantra is to get it via the container image. To download latest container image, run:

```sh
podman pull quay.io/konveyor/kantra:latest && podman run --name kantra-download quay.io/konveyor/kantra:latest 1> /dev/null 2> /dev/null && podman cp kantra-download:/usr/local/bin/kantra . && podman rm kantra-download
```

### MacOS

```sh
podman pull quay.io/konveyor/kantra:latest && podman run --name kantra-download quay.io/konveyor/kantra:latest 1> /dev/null 2> /dev/null && podman cp kantra-download:/usr/local/bin/darwin-kantra kantra && podman rm kantra-download
```

This will copy the binary into your current working directory. To make it available system-wide, run:

```sh
Expand Down Expand Up @@ -87,14 +94,79 @@ Global Flags:

Transform has two subcommands - `openrewrite` and `rules`.

```sh
Transform application source code or windup XML rules

Usage:
kantra transform [flags]
kantra transform [command]

Available Commands:
openrewrite Transform application source code using OpenRewrite recipes
rules Convert XML rules to YAML

Flags:
-h, --help help for transform

Global Flags:
--log-level int log level (default 5)

Use "kantra transform [command] --help" for more information about a command.
```

#### OpenRewrite

`openrewrite` subcommand allows running OpenRewrite recipes on source code.


```sh
Transform application source code using OpenRewrite recipes

Usage:
kantra transform openrewrite [flags]

Flags:
-g, --goal string target goal (default "dryRun")
-h, --help help for openrewrite
-i, --input string path to application source code directory
-l, --list-targets list all available OpenRewrite recipes
-t, --target string target openrewrite recipe to use. Run --list-targets to get a list of packaged recipes.

Global Flags:
--log-level int log level (default 5)
```

To run `transform openrewrite` on application source code, run:

```sh
kantra transform openrewrite --input=<path/to/source/code> --target=<exactly_one_target_from_the_list>
```

#### Rules

`rules` subcommand allows converting Windup XML rules to analyzer-lsp YAML rules.

```sh
Convert XML rules to YAML

Usage:
kantra transform rules [flags]

Flags:
-h, --help help for rules
-i, --input stringArray path to XML rule file(s) or directory
-o, --output string path to output directory

Global Flags:
--log-level int log level (default 5)
```

To run `transform rules` on application source code, run:

```sh
kantra transform rules --input=<path/to/xmlrules> --output=<path/to/output/dir>
```


## Code of Conduct
Refer to Konveyor's Code of Conduct [here](https://github.com/konveyor/community/blob/main/CODE_OF_CONDUCT.md).

0 comments on commit 27e7b72

Please sign in to comment.