{"id":13790100,"url":"https://github.com/lucagrulla/cw","last_synced_at":"2025-05-16T15:08:25.863Z","repository":{"id":37406206,"uuid":"83245086","full_name":"lucagrulla/cw","owner":"lucagrulla","description":"The best way to tail AWS CloudWatch Logs from your terminal","archived":false,"fork":false,"pushed_at":"2024-05-24T17:12:42.000Z","size":20643,"stargazers_count":799,"open_issues_count":22,"forks_count":59,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T14:16:02.392Z","etag":null,"topics":["aws","aws-cloudwatch","bash","cli","devops","golang","linux","log-streams","logs","macos","tail","terminal","windows","zsh"],"latest_commit_sha":null,"homepage":"https://www.lucagrulla.com/cw","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucagrulla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"lucagrulla"}},"created_at":"2017-02-26T22:24:02.000Z","updated_at":"2025-03-19T22:26:47.000Z","dependencies_parsed_at":"2024-10-24T02:11:28.807Z","dependency_job_id":"b18f9456-918c-4a12-aa92-be40f5e4e8c7","html_url":"https://github.com/lucagrulla/cw","commit_stats":{"total_commits":349,"total_committers":22,"mean_commits":"15.863636363636363","dds":0.3438395415472779,"last_synced_commit":"f18e5d9b6a6f4537530a835b35a3044adbdc6f82"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucagrulla%2Fcw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucagrulla%2Fcw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucagrulla%2Fcw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucagrulla%2Fcw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucagrulla","download_url":"https://codeload.github.com/lucagrulla/cw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cloudwatch","bash","cli","devops","golang","linux","log-streams","logs","macos","tail","terminal","windows","zsh"],"created_at":"2024-08-03T22:00:36.969Z","updated_at":"2025-05-16T15:08:23.269Z","avatar_url":"https://github.com/lucagrulla.png","language":"Go","funding_links":["https://github.com/sponsors/lucagrulla"],"categories":["Go","Tools"],"sub_categories":["CLI"],"readme":"# cw\n\n[![Release](https://img.shields.io/github/release/lucagrulla/cw.svg?style=flat-square)](https://github.com/lucagrulla/cw/releases/latest)\n[![Software License](https://img.shields.io/badge/license-apache2-brightgreen.svg?style=flat-square)](LICENSE.md)\n![Github All Releases](https://img.shields.io/github/downloads/lucagrulla/cw/total.svg)\n![CircleCI branch](https://img.shields.io/circleci/project/github/lucagrulla/cw/master.svg?label=CircleCI)\n\n![cw - the best way to tail AWS CloudWatch Logs](https://github.com/lucagrulla/cw/raw/master/images/cw-logo1280x640.png)\n\nThe **best** way to tail AWS CloudWatch Logs from your terminal.\n\nAuthor - [Luca Grulla](https://www.lucagrulla.com) - [https://www.lucagrulla.com](https://www.lucagrulla.com)\n\n\n* [Features](##features)\n* [Installation](#installation)\n* [Commands and options](#commands-and-options)\n* [Examples](#examples)\n* [AWS credentials and configuration](#AWS-credentials-and-configuration)\n* [Miscellaneous](#miscellaneous)\n* [Release notes](https://github.com/lucagrulla/cw/wiki/Release-notes)\n\n## Features\n\n-   **No external dependencies**\n    -   cw is a native executable targeting your OS. No pip, npm, rubygems.\n-   **Fast**.\n    -   cw is written in golang and compiled against your architecture.\n-   **Flexible date and time parser**.\n    -   Work with either `Local` timezone or `UTC` (default).\n    -   Flexible parsing.\n        -   Human friendly formats, i.e. `2d1h20m` to indicate 2 days, 1 hour and 20 minutes ago.\n        -   a specific hour, i.e. `13:10` to indicate 13:10 of today.\n        -   a full timestamp `2018-10-20T8:53`.\n-   **Multi log groups tailing**\n    -   tail multiple log groups in parallel: `cw tail my-auth-service my-web`.\n-   Powerful built-in **grep** (`--grep`) and **grepv** (`--grepv`).\n-   [JMESPath](https://jmespath.org/) support for JSON queries (matching the [AWS CLI `--query`](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html#cli-usage-filter-client-side) flag)\n-   **Pipe operator** supported\n    -   `echo my-group | cw tail` and `cat groups.txt | cw tail`.\n-   **Redirection operator \u003e\u003e** supported\n    -   `cw tail -f my-stream \u003e\u003e myfile.txt`.\n-   Coloured output\n    -   `--no-color` flag to disable if needed.\n-   Flexible credentials control.\n    -   By default the **AWS .aws/credentials and .aws/profile** files are used. Overrides can be achieved with the `--profile` and `--region` flags.\n\n## Installation\n\n### Mac OSX\n\n#### using [Homebrew](https://brew.sh)\n\n```bash\nbrew tap lucagrulla/tap\nbrew install cw\n```\n\n### Linux\n\n#### using [Linuxbrew](https://linuxbrew.sh/brew/)\n\n```bash\nbrew tap lucagrulla/tap\nbrew install cw\n```\n\n#### .deb/.rpm\n\nDownload the `.deb` or `.rpm` from the [releases page](https://github.com/lucagrulla/cw/releases/latest) and install with `dpkg -i` and `rpm -i` respectively.\n\n#### using [Snapcraft.io](https://snapcraft.io)\n\n_Note_: If you upgrade to 3.3.0 please note the new alias command. This is required to comply with snapcraft new release rules.\n\n```bash\nsnap install cw-sh\nsudo snap connect cw-sh:dot-aws-config-credentials\nsudo snap alias cw-sh.cw cw\n```\n\n`cw` runs with strict confinement; the `dot-aws-config-credentials` interface connection is required to have access to `.aws/config` and `.aws/credentials` files\n\n[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/cw-sh)\n\n### On Windows\n\n#### using [Scoop.sh](https://scoop.sh/)\n\n```bash\nscoop bucket add cw https://github.com/lucagrulla/cw-scoop-bucket.git\nscoop install cw\n```\n\n### Go tools\n\n```bash\ngo get github.com/lucagrulla/cw\n```\n\n## Commands and options\n\n### Global flags\n\n-   `--profile=profile-name` Override the AWS profile used for connection.\n-   `--region=aws-region` Override the target AWS region.\n-   `--no-color` Disable coloured output.\n-   `--endpoint` The target AWS endpoint url. By default cw will use the default aws endpoints.\n-   `--no-version-check` Ignore checks if a newer version of the module is available.\n\n### Commands\n\n-   `cw ls` list all the log groups/log streams within a group\n\n    ```console\n    Usage: cw ls \u003ccommand\u003e\n\n    show an entity\n\n    Flags:\n      -h, --help               Show context-sensitive help.\n          --endpoint=URL       The target AWS endpoint url. By default cw will use the default aws endpoints. NOTE: v4.0.0\n                              dropped the flag short version.\n          --profile=PROFILE    The target AWS profile. By default cw will use the default profile defined in the\n                              .aws/credentials file. NOTE: v4.0.0 dropped the flag short version.\n          --region=REGION      The target AWS region. By default cw will use the default region defined in the\n                              .aws/credentials file. NOTE: v4.0.0 dropped the flag short version.\n          --no-color           Disable coloured output.NOTE: v4.0.0 dropped the flag short version.\n          --version            Print version information and quit\n          --no-version-check   Ignore checks if a newer version of the module is available.\n\n    Commands:\n      ls groups\n        Show all groups.\n\n      ls streams \u003cgroup\u003e\n        Show all streams in a given log group.\n\n    cw: error: expected one of \"groups\",  \"streams\"\n    ```\n\n-   `cw tail` tail a given log group/log stream\n\n    ```console\n    Usage: cw tail \u003cgroupName[:logStreamPrefix]\u003e ...\n\n    Tail log groups/streams.\n\n    Arguments:\n      \u003cgroupName[:logStreamPrefix]\u003e ...    The log group and stream name, with group:prefix syntax. Stream name can be just the prefix. If no stream name is specified all stream names in the given\n                                          group will be tailed. Multiple group/stream tuple can be passed. e.g. cw tail group1:prefix1 group2:prefix2 group3:prefix3.\n\n    Flags:\n      -h, --help                           Show context-sensitive help.\n          --endpoint=URL                   The target AWS endpoint url. By default cw will use the default aws endpoints. NOTE: v4.0.0 dropped the flag short version.\n          --profile=PROFILE                The target AWS profile. By default cw will use the default profile defined in the .aws/credentials file. NOTE: v4.0.0 dropped the flag short version.\n          --region=REGION                  The target AWS region. By default cw will use the default region defined in the .aws/credentials file. NOTE: v4.0.0 dropped the flag short version.\n          --no-color                       Disable coloured output.NOTE: v4.0.0 dropped the flag short version.\n          --version                        Print version information and quit\n          --no-version-check               Ignore checks if a newer version of the module is available.\n\n      -f, --follow                         Don't stop when the end of streams is reached, but rather wait for additional data to be appended.\n      -t, --timestamp                      Print the event timestamp.\n      -i, --event-id                       Print the event Id.\n      -s, --stream-name                    Print the log stream name this event belongs to.\n      -n, --group-name                     Print the log group name this event belongs to.\n      -r, --retry                          Keep trying to open a log group/log stream if it is inaccessible.\n      -b, --start=\"2021-04-11T08:21:52\"    The UTC start time. Passed as either date/time or human-friendly format. The human-friendly format accepts the number of days, hours and minutes prior to\n                                          the present. Denote days with 'd', hours with 'h' and minutes with 'm' i.e. 80m, 4h30m, 2d4h. If just time is used (format: hh[:mm]) it is expanded to\n                                          today at the given time. Full available date/time format: 2017-02-27[T09[:00[:00]].\n      -e, --end=STRING                     The UTC end time. Passed as either date/time or human-friendly format. The human-friendly format accepts the number of days, hours and minutes prior to the\n                                          present. Denote days with 'd', hours with 'h' and minutes with 'm' i.e. 80m, 4h30m, 2d4h. If just time is used (format: hh[:mm]) it is expanded to today at\n                                          the given time. Full available date/time format: 2017-02-27[T09[:00[:00]].\n      -l, --local                          Treat date and time in Local timezone.\n      -g, --grep=STRING                    Pattern to filter logs by. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for syntax.\n      -v, --grepv=STRING                   Equivalent of grep --invert-match. Invert match pattern to filter logs by.\n      -q, --query=STRING                   Equivalent of the --query flag in AWS CLI. Takes a JMESPath expression to filter JSON logs by. If the query fails (e.g. the log message was not JSON) then the original line is returned.\n    ```\n\n## Examples\n\n-   list of the available log groups\n    -   `cw ls groups`\n-   list of the log streams in a given log group\n    -   `cw ls streams my-log-group`\n-   tail and follow given log groups/streams\n\n    -   `cw tail -f my-log-group`\n    -   `cw tail -f my-log-group:my-log-stream-prefix`\n    -   `cw tail -f my-log-group:my-log-stream-prefix my-log-group2`\n    -   `cw tail -f my-log-group:my-log-stream-prefix -b2017-01-01T08:10:10 -e2017-01-01T08:05:00`\n    -   `cw tail -f my-log-group:my-log-stream-prefix -b7d` to start from 7 days ago.\n    -   `cw tail -f my-log-group:my-log-stream-prefix -b3h` to start from 3 hours ago.\n    -   `cw tail -f my-log-group:my-log-stream-prefix -b100m` to start from 100 minutes ago.\n    -   `cw tail -f my-log-group:my-log-stream-prefix -b2h30m` to start from 2 hours and 30 minutes ago.\n    -   `cw tail -f my-log-group -b9:00 -e9:01`\n\n-   query JSON logs using [JMESPath](https://jmespath.org/) syntax\n    -   `cw tail -f my-log-group --query \"machines[?state=='running'].name\"`\n\n## Time and Dates\n\nTime and dates are treated as UTC by default.\nUse the `--local` flag if you prefer to use Local zone.\n\n## AWS credentials and configuration\n\n`cw` uses the default credentials profile (stored in ./aws/credentials) for authentication and shared config (.aws/config) for identifying the target AWS region. Both profile and region are overridable via the `profile` and `region` global flags.\n\n### AWS SSO\n\nAWS SSO is supported if you:\n\n* use a CLI profile (either `default` or an alternate named profile) that includes the various SSO properties\n  * `sso_start_url`, `sso_account_id`, `sso_role_name`, etc\n* have a valid, active SSO session\n  * via `aws sso login`\n\nIf you get an error message that includes `...failed to sign request: failed to retrieve credentials: the SSO session has expired or is invalid...` then you should renew your SSO session via `aws sso login` (and specify the named profile, if appropriate).\n\n## Miscellaneous\n\n### Use `cw` behind a proxy\n\nPlease use `HTTP_PROXY` environment variable as required by AWS cli:\n\u003chttps://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html\u003e\n\n## Breaking changes notes\n\nRead [here](https://github.com/lucagrulla/cw/wiki/Breaking-changes-notes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucagrulla%2Fcw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucagrulla%2Fcw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucagrulla%2Fcw/lists"}