{"id":17951008,"url":"https://github.com/tommy-mitchell/bin-path-cli","last_synced_at":"2026-04-08T18:31:31.148Z","repository":{"id":144959903,"uuid":"616761002","full_name":"tommy-mitchell/bin-path-cli","owner":"tommy-mitchell","description":"Execute the current package's binary.","archived":false,"fork":false,"pushed_at":"2023-09-01T19:58:54.000Z","size":163,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T01:43:01.947Z","etag":null,"topics":["bin","binary","cli-app","command-line-tool","executable","node-js","npm-package","package","package-json","shell","terminal","testing","unit-testing"],"latest_commit_sha":null,"homepage":"https://npm.im/bin-path-cli","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/tommy-mitchell.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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}},"created_at":"2023-03-21T02:49:42.000Z","updated_at":"2023-08-31T00:06:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe987d1a-38a9-469f-ab94-8b35084f20f8","html_url":"https://github.com/tommy-mitchell/bin-path-cli","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tommy-mitchell/bin-path-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-mitchell%2Fbin-path-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-mitchell%2Fbin-path-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-mitchell%2Fbin-path-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-mitchell%2Fbin-path-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommy-mitchell","download_url":"https://codeload.github.com/tommy-mitchell/bin-path-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-mitchell%2Fbin-path-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31568586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bin","binary","cli-app","command-line-tool","executable","node-js","npm-package","package","package-json","shell","terminal","testing","unit-testing"],"created_at":"2024-10-29T09:42:10.413Z","updated_at":"2026-04-08T18:31:31.121Z","avatar_url":"https://github.com/tommy-mitchell.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bin-path-cli\n\nExecute the current package's binary.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/demo.gif\"\u003e\u003c/p\u003e\n\nLike using `npm link`, but doesn't add your binary to the global path.\n\n*Demo with [`listr-cli`](https://github.com/tommy-mitchell/listr-cli).*\n\n## Install\n\n```sh\nnpm install --global bin-path-cli\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eOther Package Managers\u003c/summary\u003e\n\n```sh\nyarn global add bin-path-cli\n```\n\u003c/details\u003e\n\n## Usage\n\n```sh\nnpx bin-path [source-map] [binary-name] [arguments or flags…]\n```\n\n### Curent Working Directory\n\nInside of a directory with a `package.json` that specifies a binary either via `bin` or `directories.bin`, run via:\n\n```sh\nnpx bin-path\n```\n\nIf no binary is found, the `bin-path` command fails.\n\n### Arguments\n\nFlags and arguments are passed as-is to your binary:\n\n```sh\n$ npx bin-path --some-flag arg1 arg2\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\n```js\n// cli.js\n#!/usr/bin/env node\nimport process from \"node:process\";\n\nconst args = process.argv.slice(2);\nconsole.log(`Arguments: [${args.join(\", \")}]`);\n```\n\n```sh\n$ npx bin-path arg1 arg2\n#=\u003e \"Arguments: [arg1, arg2]\"\n```\n\u003c/details\u003e\n\n### Named binaries\n\nIf you have multiple exported binaries, they can be accessed by name if passed as the first argument to `bin-path`:\n\n```sh\n$ npx bin-path binary-name\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\n```jsonc\n// package.json\n\"bin\": {\n\t\"foo\": \"./foo.js\",\n\t\"bar\": \"./bar.js\"\n}\n```\n\n```sh\n# `foo` binary\n$ npx bin-path foo --foo-flag\n\n# `bar` binary\n$ npx bin-path bar --bar-flag\n```\n\u003c/details\u003e\n\nOmitting a name searches for a binary with the same name as the project (i.e. `name` in `package.json`). This is the \"default\" binary.\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\n```jsonc\n// package.json\n\"name\": \"foo\",\n\"bin\": {\n\t\"foo\": \"./foo.js\",\n\t\"bar\": \"./bar.js\"\n}\n```\n\n```sh\n# `foo` binary\n$ npx bin-path --foo-flag\n```\n\u003c/details\u003e\n\n### Source Mapping\n\nIf you're writing your binary in a language that compiles to JavaScript (e.g. TypeScript) and would like to test your source binary, you can map the built file to the source file by using the following format as the first argument to `bin-path`:\n\n```sh\n$ npx bin-path dist.js:::src.ts\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\n```\n\\__ dist/\n    \\__ cli.js\n\\__ src/\n    \\__ cli.ts\n\\__ package.json\n```\n\n\u003c/details\u003e\n\n#### Aliasing\n\nThe syntax for mapping to a source binary can be verbose. Adding the following as an alias to your `.zshrc` (or equivalent) could help:\n\n```sh\nalias bin-path-map=\"bin-path dist.js:::src.ts\"\n```\n\n\u003e [!NOTE]\n\u003e The feature is under-tested and the syntax is subject to change. If you have any problems or suggestings, please [file an issue](https://github.com/tommy-mitchell/bin-path-cli/issues/new).\n\n## Related\n\n- [get-bin-path](https://github.com/ehmicky/get-bin-path) - Get the current package's binary path.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommy-mitchell%2Fbin-path-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommy-mitchell%2Fbin-path-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommy-mitchell%2Fbin-path-cli/lists"}