{"id":15690246,"url":"https://github.com/jonschlinkert/compgen","last_synced_at":"2025-05-07T23:33:41.210Z","repository":{"id":57204632,"uuid":"129882574","full_name":"jonschlinkert/compgen","owner":"jonschlinkert","description":"Node.js API for the bash(1) 'compgen' built-in, which lists all available bash commands, aliases, keywords, functions...","archived":false,"fork":false,"pushed_at":"2018-04-17T19:06:14.000Z","size":9,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T15:12:49.872Z","etag":null,"topics":["bash","commands","compgen"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-17T09:47:18.000Z","updated_at":"2022-07-27T07:09:23.000Z","dependencies_parsed_at":"2022-09-18T01:00:53.626Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/compgen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fcompgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fcompgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fcompgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fcompgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/compgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973501,"owners_count":21834103,"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":["bash","commands","compgen"],"created_at":"2024-10-03T18:08:24.342Z","updated_at":"2025-05-07T23:33:41.162Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compgen [![NPM version](https://img.shields.io/npm/v/compgen.svg?style=flat)](https://www.npmjs.com/package/compgen) [![NPM monthly downloads](https://img.shields.io/npm/dm/compgen.svg?style=flat)](https://npmjs.org/package/compgen) [![NPM total downloads](https://img.shields.io/npm/dt/compgen.svg?style=flat)](https://npmjs.org/package/compgen)\n\n\u003e Node.js API for the bash(1) 'compgen' built-in, which lists all available bash commands, aliases, keywords, functions...\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save compgen\n```\n\n## Usage\n\nAdd `compgen` to your node.js application with the following line of JavaScript:\n\n```js\nconst compgen = require('compgen');\n\ncompgen()\n  .then(res =\u003e {\n    console.log(res);\n    // ...\n    // giffiltr\n    // gifinto\n    // share\n    // gem\n    // git-receive-pack\n    // gitk\n    // git-upload-archive\n    // git-credential-osxkeychain\n    // git-cvsserver\n    // git-shell\n    // git-upload-pack\n    // git\n    // ... 1539 more items\n  });\n```\n\n## Examples\n\n### async usage\n\nThe following examples assume your code is inside an `async` function.\n\n```js\nconsole.log(await compgen(flags[, options]));\n\n// if no arguments are given, the `-abck` flags are used\nconsole.log(await compgen());\n\n// with flags\nconsole.log(await compgen('-ac'));\nconsole.log(await compgen('-abc'));\nconsole.log(await compgen('-abck'));\n\n// with flags and options\nconsole.log(await compgen('-ac', { stdio: 'inherit' }));\nconsole.log(await compgen('-abc', { stdio: 'inherit' }));\nconsole.log(await compgen('-abck', { stdio: 'inherit' }));\n```\n\nSee more [available flags](#flags).\n\n### sync usage\n\n```js\nconsole.log(compgen.sync(flags[, options]));\n\n// if no arguments are given, the `-abck` flags are used\nconsole.log(compgen.sync());\n\n// with flags\nconsole.log(compgen.sync('-ac'));\nconsole.log(compgen.sync('-abc'));\nconsole.log(compgen.sync('-abck'));\n\n// with flags and options\nconsole.log(compgen.sync('-ac', { stdio: 'inherit' }));\nconsole.log(compgen.sync('-abc', { stdio: 'inherit' }));\nconsole.log(compgen.sync('-abck', { stdio: 'inherit' }));\n```\n\nSee more [available flags](#flags).\n\n## Flags\n\nSupports all of the bash(1) built-in `compgen` flags, including the following:\n\n```sh\n-a # lists all the aliases you can run\n-b # lists all of the shell built-in comands you can run\n-c # lists all the commands you can run\n-A function # lists all the functions you can run\n-A function -abc # lists all the above in one go\n-ac | grep search_string # filter by the given search string \n-d # lists all directories\n-e # lists all exported shell variables\n-f # lists all files and functions\n-g # lists all groups\n-j # lists all jobs\n-k # lists all of the shell reserved words/keywords you can run\n-s # lists all services\n-u # lists all userAlias names\n-v # lists all shell variables\n```\n\nCheck the [man page](https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html) for more information.\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 17, 2018._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fcompgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fcompgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fcompgen/lists"}