{"id":21466562,"url":"https://github.com/permafrost-dev/node-ray-cli","last_synced_at":"2025-03-17T05:48:02.841Z","repository":{"id":36976872,"uuid":"380293091","full_name":"permafrost-dev/node-ray-cli","owner":"permafrost-dev","description":"Debug your CLI scripts with Ray to fix problems faster","archived":false,"fork":false,"pushed_at":"2024-05-13T04:23:28.000Z","size":160,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T15:32:15.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permafrost-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"permafrost-dev","custom":"https://permafrost.dev/open-source"}},"created_at":"2021-06-25T16:16:00.000Z","updated_at":"2023-02-01T21:18:53.000Z","dependencies_parsed_at":"2023-12-25T05:25:33.504Z","dependency_job_id":"6f50bdc1-7d62-4bd2-900d-432f52c6c6eb","html_url":"https://github.com/permafrost-dev/node-ray-cli","commit_stats":{"total_commits":107,"total_committers":4,"mean_commits":26.75,"dds":"0.33644859813084116","last_synced_commit":"e97a1699b941182b855df730b924ebe3c3569fb3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":"permafrost-dev/typescript-project-skeleton-esbuild-jest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fnode-ray-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fnode-ray-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fnode-ray-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permafrost-dev%2Fnode-ray-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permafrost-dev","download_url":"https://codeload.github.com/permafrost-dev/node-ray-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982136,"owners_count":20378606,"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":[],"created_at":"2024-11-23T08:14:37.194Z","updated_at":"2025-03-17T05:48:02.820Z","avatar_url":"https://github.com/permafrost-dev.png","language":"TypeScript","funding_links":["https://github.com/sponsors/permafrost-dev","https://permafrost.dev/open-source"],"categories":[],"sub_categories":[],"readme":"# node-ray-cli\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://static.permafrost.dev/images/node-ray/node-ray-logo.png\" alt=\"node-ray-cli\" height=\"200\" style=\"block\"\u003e\n    \u003cbr\u003e\n    \u003cspan style=\"font-size:2.7rem;\"\u003eDebug cli scripts with Ray to fix problems faster\u003c/span\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://shields.io/npm/v/node-ray-cli\" alt=\"npm version\"\u003e\n    \u003c!--\u003cimg src=\"https://shields.io/npm/dt/node-ray-cli\" alt=\"npm downloads\"\u003e--\u003e\n    \u003cimg src=\"https://shields.io/github/license/permafrost-dev/node-ray-cli\" alt=\"license\"\u003e \u003cimg src=\"https://github.com/permafrost-dev/vue-ray/workflows/Run%20Tests/badge.svg?branch=main\" alt=\"test status\"\u003e \u003cimg src=\"https://codecov.io/gh/permafrost-dev/node-ray-cli/branch/main/graph/badge.svg?token=Z3KgrLJ6L2\"/\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\nThis npm package provides a `ray` script that lets you control [Spatie's Ray app](https://myray.app) from the command line.  It allows you to easily debug your CLI scripts.\n\n## Installation\n\nInstall the package normally with `npm`:\n\n```bash\nnpm install node-ray-cli\n```\n\n...install it globally to be able to access it from any script/directory:\n\n```bash\nnpm install -g node-ray-cli\n```\n\n...or run it without installing using `npx`:\n\n```bash\nnpx node-ray-cli --help\n```\n\n## Usage\n\n`ray \u003ccommand name\u003e \u003cargs, ...\u003e`\n\nIf no command name is specified, `send` is assumed.\n\n![image](https://user-images.githubusercontent.com/5508707/123550427-64da4300-d73b-11eb-9aa3-589b21d1fa11.png)\n\nWhen calling commands that send modifiable payloads, the payload uuid is sent to stdout **if** the `--show-uuid` option flag is provided.  For example, you may modify the color of a payload after it has been sent by using the `color` command:\n\n```bash\nray 'hello world' --show-uuid # writes \"ae625128-ed3a-2b92-1a3f-2e0ebf7a2ad1\" to stdout\nray color ae625128-ed3a-2b92-1a3f-2e0ebf7a2ad1 green\n```\n\n...or remove the payload from Ray entirely:\n```bash\nray 'hello world' --show-uuid # writes \"ae625128-ed3a-2b92-1a3f-2e0ebf7a2ad1\" to stdout\nray remove ae625128-ed3a-2b92-1a3f-2e0ebf7a2ad1\n```\n\nSome other usage examples: \n\n```bash\nray 'hello world' --blue\nray pause\nray html '\u003cem\u003ehello world\u003c/em\u003e'\nray file message.txt\n```\n\n## Disabling node-ray-cli\n\nThe `ray` command can be disabled by setting the `NODE_RAY_DISABLED` environment variable to `\"1\"`:\n\n```bash\nexport NODE_RAY_DISABLED=\"1\"\n```\n\n## Available option flags\n\nThere are several option flags that can be used with any command:\n\n| Flag | Description |\n| --- | --- |\n| `--hide` | Display the payload as collapsed by default |\n| `--if=value` | Don't send the payload if `value` is `\"false\"`, `0`, or `\"no\"` |\n| `--large` | Display large text |\n| `--show-uuid` | Write the payload uuid to stdout |\n| `--small` | Display small text |\n| `--blue` | Display the payload as blue  |\n| `--gray` | Display the payload as gray  |\n| `--green` | Display the payload as green  |\n| `--orange` | Display the payload as orange  |\n| `--purple` | Display the payload as purple  |\n| `--red` | Display the payload as red  |\n\n## Command reference\n\n| Command | Description |\n| --- | --- |\n| `clear` | Clear the current screen |\n| `clear-all` | Clear the current and all previous screens |\n| `color \u003cuuid\u003e \u003ccolor\u003e` | Change the color of a payload that has already been sent |\n| `confetti` | Display confetti in Ray! |\n| `file \u003cfilename\u003e` | Show the contents of `filename` |\n| `hide-app` | Hide the Ray app |\n| `html \u003ccontent\u003e` | Display rendered html |\n| `image \u003clocation\u003e` | Display an image from a URL or file |\n| `json \u003ccontent\u003e` | Display formatted JSON |\n| `notify \u003cmessage\u003e` | Display a desktop notification |\n| `pause` | Pause code execution |\n| `remove \u003cuuid\u003e` | Remove a payload |\n| `send \u003cpayload\u003e` | Send a payload to Ray |\n| `show-app` | Show the Ray app |\n| `size \u003cuuid\u003e \u003csize\u003e` | Change the text size of a payload that has already been sent _(sizes are 'large' or 'small')_ |\n| `text \u003cdata\u003e` | Display a text string with whitespace preserved |\n| `xml \u003cdata\u003e` | Display formatted XML |\n\n## Example Bash Script\n\n```bash\n#!/bin/bash\n\nRAYUUID=$(ray \"arg count: $#\" --show-uuid)\nray color $RAYUUID blue\n\nif [ $# -eq 0 ]; then\n    echo \"no filename provided\"\n    exit 1\nfi\n\nFILENAME=\"$1\"\n\nray \"$FILENAME\"\nray file \"$FILENAME\" --purple --small --hide\nray show-app\n\nif [ ! -e \"$FILENAME\" ]; then\n    ray send \"file missing: $FILENAME\" --red\n    exit 1\nfi\n\nray pause\n\ncat \"$FILENAME\" | wc -l\n```\n\n## Development Setup\n\n```bash\nnpm install\nnpm run build:dev\nnode dist/index.js --help\n```\n\n## Testing\n\n`node-ray-cli` uses Jest for unit tests.  To run the test suite:\n\n`npm run test`\n\n---\n\nCode Coverage\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/permafrost-dev/node-ray-cli/branch/main/graphs/commits.svg\" height=\"100\" alt=\"codecov commits graph\" /\u003e\n    \u003cbr\u003e\n    \u003cimg src=\"https://codecov.io/gh/permafrost-dev/node-ray-cli/branch/main/graph/sunburst.svg\" height=\"200\" alt=\"codecov sunburst graph\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Patrick Organ](https://github.com/patinthehat)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Fnode-ray-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermafrost-dev%2Fnode-ray-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermafrost-dev%2Fnode-ray-cli/lists"}