<commit_before># cw

[![Release](https://img.shields.io/github/release/lucagrulla/cw.svg?style=flat-square)](https://github.com/lucagrulla/cw/releases/latest)
[![Software License](https://img.shields.io/badge/license-apache2-brightgreen.svg?style=flat-square)](LICENSE.md)
![Github All Releases](https://img.shields.io/github/downloads/lucagrulla/cw/total.svg)
![CircleCI branch](https://img.shields.io/circleci/project/github/lucagrulla/cw/master.svg?label=CircleCI)

The **best** way to tail AWS CloudWatch Logs from your terminal.

Author - [<NAME>](https://www.lucagrulla.com)  - [https://www.lucagrulla.com](https://www.lucagrulla.com)


* [Features](##features)
* [Installation](#installation)
* [Commands and options](#commands-and-options)
* [Examples](#examples)
* [AWS credentials and configuration](#AWS-credentials-and-configuration)
* [Release notes](https://github.com/lucagrulla/cw/wiki/Release-notes)

## Features

* **No external dependencies** (no pip, npm, rubygems) and easy installation.
  * cw is a native executable targeting your OS.
* **Fast**. cw is written in golang and compiled against your architecture.
* **Flexible date and time parser**.
  * You can work with either `Local` timezone or `UTC` (default).
  * Flexible parsing.
    * Human friendly formats, i.e. `2d1h20m` to indicate 2 days, 1 hour and 20 minutes ago.
    * a specific hour, i.e. `13:10` to indicate 13:10 of today.
    * a full timestamp `2018-10-20T8:53`.
* **multi log groups tailing** tail multiple log groups  in parallel: `cw tail tail my-auth-service my-web`.
* Powerful built-in **grep** (`--grep`) and **grepv** (`--grepv`).
* **Pipe operator** supported:  `echo my-group | cw tail` and `cat groups.txt | cw tail`. 
* **Redirection operator** supported: `cw tail -f my-stream >> myfile.txt`.
* Coloured output (`--no-color` flag to disable if needed).
* Flexibile credentials control.
  * By default it uses the **AWS .aws/credentials and .aws/profile** files. Overrides can be done with the  `--profile` and `--region` flags.

## Installation

### Mac OSX

#### using [Homebrew](https://brew.sh)

```bash
brew tap lucagrulla/tap
brew install cw
```

### Linux

#### using [Linuxbrew](https://linuxbrew.sh/brew/)

```bash
brew tap lucagrulla/tap
brew install cw
```

#### .deb/.rpm

Download the ```.deb``` or ```.rpm``` from the releases page and install with dpkg -i and rpm -i respectively.

### using [Snapcraft.io](https://snapcraft.io)

```bash
snap install cw-sh
sudo snap alias cw-sh cw
```

 `cw` snap can't currently access the `.aws/` files. 
 Please use `AWS_CONFIG_FILE` and `AWS_SHARED_CREDENTIALS_FILE` env variables to specify the location.
<!-- `cw` runs with strict confinement; the `personal-files` interface connection is required to have acces to `.aws/config` and `.aws/credentials` files -->

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/cw-sh)

### On Windows using [Scoop.sh](https://scoop.sh/)

```bash
scoop bucket add cw https://github.com/lucagrulla/cw-scoop-bucket.git
scoop install cw
```

### Using Go tools

```bash
go get github.com/lucagrulla/cw
```

## Commands and options<commit_msg>Improved Linux installation documentation<commit_after># cw

[![Release](https://img.shields.io/github/release/lucagrulla/cw.svg?style=flat-square)](https://github.com/lucagrulla/cw/releases/latest)
[![Software License](https://img.shields.io/badge/license-apache2-brightgreen.svg?style=flat-square)](LICENSE.md)
![Github All Releases](https://img.shields.io/github/downloads/lucagrulla/cw/total.svg)
![CircleCI branch](https://img.shields.io/circleci/project/github/lucagrulla/cw/master.svg?label=CircleCI)

The **best** way to tail AWS CloudWatch Logs from your terminal.

Author - [<NAME>](https://www.lucagrulla.com)  - [https://www.lucagrulla.com](https://www.lucagrulla.com)


* [Features](##features)
* [Installation](#installation)
* [Commands and options](#commands-and-options)
* [Examples](#examples)
* [AWS credentials and configuration](#AWS-credentials-and-configuration)
* [Release notes](https://github.com/lucagrulla/cw/wiki/Release-notes)

## Features

* **No external dependencies** (no pip, npm, rubygems) and easy installation.
  * cw is a native executable targeting your OS.
* **Fast**. cw is written in golang and compiled against your architecture.
* **Flexible date and time parser**.
  * You can work with either `Local` timezone or `UTC` (default).
  * Flexible parsing.
    * Human friendly formats, i.e. `2d1h20m` to indicate 2 days, 1 hour and 20 minutes ago.
    * a specific hour, i.e. `13:10` to indicate 13:10 of today.
    * a full timestamp `2018-10-20T8:53`.
* **multi log groups tailing** tail multiple log groups  in parallel: `cw tail tail my-auth-service my-web`.
* Powerful built-in **grep** (`--grep`) and **grepv** (`--grepv`).
* **Pipe operator** supported:  `echo my-group | cw tail` and `cat groups.txt | cw tail`. 
* **Redirection operator** supported: `cw tail -f my-stream >> myfile.txt`.
* Coloured output (`--no-color` flag to disable if needed).
* Flexibile credentials control.
  * By default it uses the **AWS .aws/credentials and .aws/profile** files. Overrides can be done with the  `--profile` and `--region` flags.

## Installation

### Mac OSX

#### using [Homebrew](https://brew.sh)

```bash
brew tap lucagrulla/tap
brew install cw
```

### Linux

#### using [Linuxbrew](https://linuxbrew.sh/brew/)

```bash
brew tap lucagrulla/tap
brew install cw
```

#### .deb/.rpm

Download the ```.deb``` or ```.rpm``` from the releases page and install with dpkg -i and rpm -i respectively.

#### using [Snapcraft.io](https://snapcraft.io)

```bash
snap install cw-sh
sudo snap alias cw-sh cw
```

 `cw` snap can't currently access the `.aws/` files. 
 Please use `AWS_CONFIG_FILE` and `AWS_SHARED_CREDENTIALS_FILE` env variables to specify the location.
<!-- `cw` runs with strict confinement; the `personal-files` interface connection is required to have acces to `.aws/config` and `.aws/credentials` files -->

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/cw-sh)

### On Windows

#### using [Scoop.sh](https://scoop.sh/)

```bash
scoop bucket add cw https://github.com/lucagrulla/cw-scoop-bucket.git
scoop install cw
```

### Go tools

```bash
go get github.com/lucagrulla/cw
```

## Commands and options
{'fraction_non_alphanumeric': 0.16358552120553052, 'fraction_numerical': 0.008699704831443219, 'mean_word_length': 4.3874476987447695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 32, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '276971', 'n_tokens_mistral': 2320, 'n_tokens_neox': 2150, 'n_words': 609}