Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README with MacOS instructions and transform info #42

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).