<commit_before>= riff CLI tool

We provide a CLI tool written in Go that makes it easy to create and deploy functions.

The CLI is built with https://github.com/spf13/cobra[cobra]

* link:docs/riff.md[Documentation]

== [[CLI]]Install the current riff CLI release

Install the CLI by following the instructions on the https://github.com/projectriff/riff/releases[riff release page].


=== [[cli-config]]riff CLI configuration

The riff CLI can be configured either using environment variables or using a config file. 
The config file to be used can be set using `--config` option and it defaults to `$HOME/.riff.yaml`.

Environment variables are prefixed with `RIFF_` and the variables from the following example are supported:

```
RIFF_USERACCOUNT=myaccount
RIFF_NAMESPACE=test
```

For the config file, you can create a `~/.riff.yaml` file with something like the following content:

```
useraccount: myaccount
namespace: test
```

=== [[cli-completion]]riff CLI bash completion

The riff CLI command supports generating a bash completion file in the same way as the `kubectl` command does.

==== [[cli-completion-macos]]riff CLI bash completion on macOS

If you use https://brew.sh/[Homebrew] on a Mac you can install the completion file using:

```
brew install bash-completion
riff completion bash > $(brew --prefix)/etc/bash_completion.d/riff 
```

==== [[cli-completion-linux]]riff CLI bash completion on Linux

If you use Linux you can installl the completion file using:

```
. <(riff completion bash) 
```

TIP: You can edit your `.bashrc` file to have this automatically loaded on future shell runs.

== Building from source

```
go get -d github.com/projectriff/riff/...
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ build
```

== Add riff binary to PATH
```
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ install
```
NOTE: This installs the CLI in the `bin` subdirectory of the first directory listed in `$GOPATH`.

== Running tests
```
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ test
```<commit_msg>make READMEs consistent<commit_after>= riff CLI tool

We provide a CLI tool written in Go that makes it easy to create and deploy functions.

The CLI is built with https://github.com/spf13/cobra[cobra]

* link:docs/riff.md[Documentation]

== [[CLI]]Install the current riff CLI release

Install the CLI by following the instructions on the https://github.com/projectriff/riff/releases[riff release page].


=== [[cli-config]]riff CLI configuration

The riff CLI can be configured either using environment variables or using a config file. 
The config file to be used can be set using `--config` option and it defaults to `$HOME/.riff.yaml`.

Environment variables are prefixed with `RIFF_` and the variables from the following example are supported:

```
RIFF_USERACCOUNT=myaccount
RIFF_NAMESPACE=test
```

For the config file, you can create a `~/.riff.yaml` file with something like the following content:

```
useraccount: myaccount
namespace: test
```

=== [[cli-completion]]riff CLI bash completion

The riff CLI command supports generating a bash completion file in the same way as the `kubectl` command does.

==== [[cli-completion-macos]]riff CLI bash completion on macOS

If you use https://brew.sh/[Homebrew] on a Mac you can install the completion file using:

```
brew install bash-completion
riff completion bash > $(brew --prefix)/etc/bash_completion.d/riff 
```

==== [[cli-completion-linux]]riff CLI bash completion on Linux

If you use Linux you can installl the completion file using:

```
. <(riff completion bash) 
```

TIP: You can edit your `.bashrc` file to have this automatically loaded on future shell runs.

== Building from source

```
go get -d github.com/projectriff/riff/...
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ build
```

== Add riff binary to PATH
```
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ install
```
NOTE: This installs the CLI in `$GOBIN`, or if that is not set, in the `bin` subdirectory of the directory specified in `$GOPATH`.

== Running tests
```
cd $(go env GOPATH)/src/github.com/projectriff/riff
make -C riff-cli/ test
```
{'fraction_non_alphanumeric': 0.10831950699217824, 'fraction_numerical': 0.0009480919649205973, 'mean_word_length': 4.341772151898734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4783171', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1265, 'n_words': 527}