{"id":15390190,"url":"https://github.com/gajus/roarr-cli","last_synced_at":"2025-04-15T21:27:14.067Z","repository":{"id":57145985,"uuid":"144564114","full_name":"gajus/roarr-cli","owner":"gajus","description":"A CLI program for processing Roarr logs.","archived":false,"fork":false,"pushed_at":"2023-11-15T01:44:44.000Z","size":881,"stargazers_count":28,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T01:34:23.610Z","etag":null,"topics":["cli","logger","roarr"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.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},"funding":{"github":"gajus","patreon":"gajus"}},"created_at":"2018-08-13T10:24:34.000Z","updated_at":"2024-07-08T21:51:09.000Z","dependencies_parsed_at":"2023-11-15T02:59:41.491Z","dependency_job_id":null,"html_url":"https://github.com/gajus/roarr-cli","commit_stats":{"total_commits":148,"total_committers":1,"mean_commits":148.0,"dds":0.0,"last_synced_commit":"b3d73680fe2ce2fc4f313f6337a30db041fd550b"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Froarr-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/roarr-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248930812,"owners_count":21185088,"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":["cli","logger","roarr"],"created_at":"2024-10-01T15:04:49.044Z","updated_at":"2025-04-15T21:27:14.047Z","avatar_url":"https://github.com/gajus.png","language":"TypeScript","funding_links":["https://github.com/sponsors/gajus","https://patreon.com/gajus"],"categories":[],"sub_categories":[],"readme":"# Roarr\n\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social\u0026label=Follow)](https://twitter.com/kuizinas)\n\nA CLI program for processing [Roarr](https://github.com/gajus/roarr) logs.\n\n* [Usage](#usage)\n  * [Filtering logs](#filtering-logs)\n  * [Formatting logs](#formatting-logs)\n* [`.roarr.js`](#roarr-configuration-file)\n\n## Usage\n\nInstall `@roarr/cli` and inspect all available options using `roarr --help`.\n\n### Filtering logs\n\nUse `--filter` option to filter Roarr messages, e.g.\n\n```bash\n$ echo '\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":20},\"message\":\"a\",\"sequence\":0,\"time\":1533310067405,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":30},\"message\":\"b\",\"sequence\":1,\"time\":1533310067438,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":40},\"message\":\"c\",\"sequence\":2,\"time\":1533310067439,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":10},\"message\":\"d\",\"sequence\":3,\"time\":1533310067445,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":30},\"message\":\"e\",\"sequence\":4,\"time\":1533310067459,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":40},\"message\":\"f\",\"sequence\":5,\"time\":1533310067473,\"version\":\"2.0.0\"}\n' | roarr --filter 'context.logLevel:\u003e20'\n[15:27:47.438]       info  @bar %foo #baz: b\n[15:27:47.439]   1ms warn  @bar %foo #baz: c\n[15:27:47.459]  20ms info  @bar %foo #baz: e\n[15:27:47.473]  14ms warn  @bar %foo #baz: f\n```\n\nRefer to [`Liqe`](https://github.com/gajus/liqe) documentation for query syntax.\n\n### Formatting logs\n\nUse `--format-output pretty` option (default) to pretty-print logs.\n\nTo format the logs, pipe the program output to `roarr` program, e.g.\n\n```bash\n$ ROARR_LOG=true node index.js | roarr pretty-print\n```\n\nProvided that the `index.js` program produced an output such as:\n\n```json\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":20},\"message\":\"a\",\"sequence\":0,\"time\":1533310067405,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":30},\"message\":\"b\",\"sequence\":1,\"time\":1533310067438,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":40},\"message\":\"c\",\"sequence\":2,\"time\":1533310067439,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":10},\"message\":\"d\",\"sequence\":3,\"time\":1533310067445,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":30},\"message\":\"e\",\"sequence\":4,\"time\":1533310067459,\"version\":\"2.0.0\"}\n{\"context\":{\"program\":\"foo\",\"package\":\"bar\",\"namespace\":\"baz\",\"logLevel\":40},\"message\":\"f\",\"sequence\":5,\"time\":1533310067473,\"version\":\"2.0.0\"}\n```\n\n`roarr` CLI program will format the output to look like this:\n\n```yaml\n[15:27:47.405]       debug @bar %foo #baz: a\n[15:27:47.438]  33ms info  @bar %foo #baz: b\n[15:27:47.439]   1ms warn  @bar %foo #baz: c\n[15:27:47.445]   6ms trace @bar %foo #baz: d\n[15:27:47.459]  14ms info  @bar %foo #baz: e\n[15:27:47.473]  14ms warn  @bar %foo #baz: f\n```\n\nThe \"pretty\" format relies on logs using the context property names suggested in the [conventions](#conventions):\n\n* `@` prefixed value denotes the name of the `package`.\n* `%` prefixed value denotes the name of the `program`.\n* `#` prefixed value denotes the `namespace`.\n\n## Roarr configuration file\n\nRoarr will traverse upwards the current working directory searching for `.roarr.js`.\n\n`.roarr.js` is a JavaScript file that exports an object that defines properties used to configure Roarr, e.g.\n\n```js\n/** @type {import(\"@roarr/cli\").RoarrConfiguration} */\nmodule.exports = {\n  /**\n   * Receives Roarr message object and determines if to keep the log.\n   */\n  filter: (message) =\u003e {\n    return message.context \u0026\u0026 message.context.logLevel \u003e 20;\n  },\n  /**\n   * List of properties (identified using dot notation) to exclude from the log message. \n   */\n  omit: ['context.namespace']\n};\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Froarr-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Froarr-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Froarr-cli/lists"}