{"id":13452552,"url":"https://github.com/infinitered/gluegun","last_synced_at":"2025-05-14T22:03:27.750Z","repository":{"id":37359443,"uuid":"75027176","full_name":"infinitered/gluegun","owner":"infinitered","description":"A delightful toolkit for building TypeScript-powered command-line apps.","archived":false,"fork":false,"pushed_at":"2025-01-30T20:12:32.000Z","size":3645,"stargazers_count":3005,"open_issues_count":56,"forks_count":148,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-05-05T17:20:21.735Z","etag":null,"topics":["cli","javascript","nodejs","toolkit"],"latest_commit_sha":null,"homepage":"","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/infinitered.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"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,"zenodo":null}},"created_at":"2016-11-29T00:37:41.000Z","updated_at":"2025-04-30T22:12:51.000Z","dependencies_parsed_at":"2024-01-07T00:07:18.832Z","dependency_job_id":"a0bf5dc2-a071-4767-97f0-02430109b9f8","html_url":"https://github.com/infinitered/gluegun","commit_stats":{"total_commits":907,"total_committers":75,"mean_commits":"12.093333333333334","dds":0.6979051819184123,"last_synced_commit":"9332f599353785b20b64b322c59bb9e36137b497"},"previous_names":[],"tags_count":108,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fgluegun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fgluegun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fgluegun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fgluegun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinitered","download_url":"https://codeload.github.com/infinitered/gluegun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252840514,"owners_count":21812322,"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","javascript","nodejs","toolkit"],"created_at":"2024-07-31T07:01:27.344Z","updated_at":"2025-05-07T08:24:44.915Z","avatar_url":"https://github.com/infinitered.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)","Packages","cli","Creating CLI apps"],"sub_categories":["Useful awesome list for Go cli","Server-rendered React"],"readme":"[![npm module](https://badge.fury.io/js/gluegun.svg)](https://www.npmjs.org/package/gluegun)\n[![CircleCI](https://circleci.com/gh/infinitered/gluegun.svg?style=svg)](https://circleci.com/gh/infinitered/gluegun)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n# Gluegun\n\n![gluegun](https://user-images.githubusercontent.com/1479215/50237287-5a23e380-0371-11e9-89ea-85b41cd25217.jpg)\n\nGluegun is a delightful toolkit for building Node-based command-line interfaces (CLIs) in TypeScript or modern JavaScript, with support for:\n\n🌯 _parameters_ - command-line arguments and options\u003cbr /\u003e\n🎛 _template_ - generating files from templates\u003cbr /\u003e\n🗄 _patching_ - manipulating file contents\u003cbr /\u003e\n💾 _filesystem_ - moving files and directories around\u003cbr /\u003e\n⚒ _system_ - executing other command-line scripts\u003cbr /\u003e\n🎅 _http_ - interacting with API servers\u003cbr /\u003e\n🛎 _prompt_ - auto-complete prompts\u003cbr /\u003e\n💃 _print_ - printing pretty colors and tables\u003cbr /\u003e\n👩‍✈️ _semver_ - working with semantic versioning\u003cbr /\u003e\n🎻 _strings_ - manipulating strings \u0026 template data\u003cbr /\u003e\n📦 _packageManager_ - installing NPM packages with Yarn or NPM\u003cbr /\u003e\n\nIn addition, `gluegun` supports expanding your CLI's ecosystem with a robust set of easy-to-write plugins and extensions.\n\n# Notice\n\nGluegun is at a stable point and we aren't planning on building new features for it, although the community continues to send in PRs and we release them if they are performance, stability, types, or other similar enhancements. Read the [Community Supported](#Community-Supported) section to learn more.\n\n# Why use Gluegun?\n\nIntroductory YouTube video by our CTO, Jamon Holmgren: [https://www.youtube.com/watch?v=_KEqXfLOSQY](https://www.youtube.com/watch?v=_KEqXfLOSQY)\n\nYou might want to use Gluegun if:\n\n- You need to build a CLI app\n- You want to have powerful tools at your fingertips\n- And you don't want to give up flexibility at the same time\n\nIf so ... welcome!\n\n# Quick Start\n\nJust run the `gluegun` CLI like this:\n\n```\n# spin up your new CLI\nnpx gluegun new movies\n\n# choose TypeScript or Modern JavaScript\n# now jump into the source\ncd movies\n\n# and link your new executable\nyarn link\n\n# and run it!\nmovies help\n```\n\nYou should see your new CLI help. Open the folder in your favorite editor and start building your CLI!\n\n# Code\n\nLet's start with what a `gluegun` CLI looks like.\n\n```js\n// in movie/src/cli.[js|ts]...\n\n// ready\nconst { build } = require('gluegun')\n\n// aim\nconst movieCLI = build('movie')\n  .src(`${__dirname}/src`)\n  .plugins('node_modules', { matching: 'movie-*' })\n  .help()\n  .version()\n  .defaultCommand()\n  .create()\n\n// fire!\nmovieCLI.run()\n```\n\n**Commands**\n\nCommands are simple objects that provide a name, optional aliases, and a function to run.\n\n```js\n// in movie/src/commands/foo.js\nmodule.exports = {\n  name: 'foo',\n  alias: 'f',\n  run: async function (toolbox) {\n    // gluegun provides all these features and more!\n    const { system, print, filesystem, strings } = toolbox\n\n    // ...and be the CLI you wish to see in the world\n    const awesome = strings.trim(await system.run('whoami'))\n    const moreAwesome = strings.kebabCase(`${awesome} and a keyboard`)\n    const contents = `🚨 Warning! ${moreAwesome} coming thru! 🚨`\n    const home = process.env['HOME']\n    filesystem.write(`${home}/realtalk.json`, { contents })\n\n    print.info(`${print.checkmark} Citius`)\n    print.warning(`${print.checkmark} Altius`)\n    print.success(`${print.checkmark} Fortius`)\n  },\n}\n```\n\nSee the [toolbox api docs](./docs/toolbox-api.md) for more details on what you can do.\n\nSee the [runtime docs](./docs/runtime.md) for more details on building your own CLI and join us in the #gluegun channel of the Infinite Red Community Slack ([community.infinite.red](http://community.infinite.red)) to get friendly help!\n\n# Who Is Using This?\n\n- [Ignite CLI](https://github.com/infinitered/ignite) - React Native CLI and starter kit\n- [Solidarity](https://github.com/infinitered/solidarity) - audits your system dependencies so you can develop in peace\n- [Sara Vieira's Fiddly](https://github.com/SaraVieira/fiddly) - Create beautiful and simple HTML pages from your Readme.md files - [https://fiddly.netlify.com](https://fiddly.netlify.com)\n- [Graph CLI](https://github.com/graphprotocol/graph-cli) - CLI for building and managing subgraphs that index data from Ethereum and IPFS - [https://thegraph.com/explorer](https://thegraph.com/explorer)\n- [Vts](https://github.com/snowfrogdev/Vts) - Vanilla TypeScript library starter CLI tool\n\n*Additionally, the first versions of the [AWS Amplify CLI](https://github.com/aws-amplify/amplify-cli) (a CLI toolchain for simplifying serverless web and mobile development) used Gluegun. They've since integrated Gluegun's functionality into their CLI in a bespoke way, but you can still see Gluegun patterns in their CLI.*\n\n# What's under the hood?\n\nWe've assembled an _all-star cast_ of libraries to help you build your CLI.\n\n⭐️ [ejs](https://github.com/mde/ejs) for templating\u003cbr /\u003e\n⭐️ [semver](https://github.com/npm/node-semver) for version investigations\u003cbr /\u003e\n⭐️ [fs-jetpack](https://github.com/szwacz/fs-jetpack) for the filesystem\u003cbr /\u003e\n⭐️ [yargs-parser](https://github.com/yargs/yargs-parser), [enquirer](https://github.com/enquirer/enquirer), [colors](https://github.com/Marak/colors.js), [ora](https://github.com/sindresorhus/ora) and [cli-table3](https://github.com/cli-table/cli-table3) for the command line\u003cbr /\u003e\n⭐️ [axios](https://github.com/mzabriskie/axios) \u0026 [apisauce](https://github.com/infinitered/apisauce) for web \u0026 apis\u003cbr /\u003e\n⭐️ [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for flexible configuration \u003c/br\u003e\n⭐️ [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) for running sub-commands\u003c/br\u003e\n⭐️ [execa](https://github.com/sindresorhus/execa) for running more sub-commands\u003c/br\u003e\n⭐️ [node-which](https://github.com/npm/node-which) for finding executables\u003c/br\u003e\n⭐️ [pluralize](https://github.com/blakeembrey/pluralize) for manipulating strings\u003c/br\u003e\n\n[Node.js 12.0+](https://nodejs.org) is required.\n\n## Community CLIs and Plugins\n\nHere are a few community CLIs based on Gluegun plus some plugins you can use. Is yours missing? Send a PR to add it!\n\n- [Gluegun-Menu](https://github.com/lenneTech/gluegun-menu) - A command menu for Gluegun-based CLIs\n- [Gluegun CLI-Starter](https://github.com/lenneTech/cli-starter) - A CLI Starter for your next Gluegun CLI project\n\n# Community Supported\n\nWhile Gluegun is no longer actively developed by [Infinite Red](https://infinite.red), it has built a community that cares deeply about it. Infinite Red won't be building new features ourselves for Gluegun, but we encourage the community to continue to send high quality pull requests. We will try to review and merge them in a timely manner.\n\nIf you're looking for alternatives, here's a list:\n\n* [Rust CLI](https://rust-cli.github.io/book/index.html) -- Rust is a rapidly growing community and hot language, and has the benefit of speed and not needing to rely on a local Node engine.\n* [oclif](https://oclif.io/) - oclif is used by some large CLIs and is very actively maintained\n* [commander](https://github.com/tj/commander.js/) and [yeoman](https://yeoman.io/) - commander and yeoman have been around a long time and have very large communities. Keep in mind that we built Gluegun to avoid Commander and Yeoman, so YMMV\n* [vorpal](https://vorpal.js.org/) - unfortunately looks like it isn't actively maintained\n* [just make your own](https://www.twilio.com/blog/how-to-build-a-cli-with-node-js) - you don't need a framework to make a Node CLI. Check out this article from Twilio\n\nAnd of course, check out your favorite [React Native Consultants, Infinite Red](https://infinite.red/react-native-consultants)!.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitered%2Fgluegun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitered%2Fgluegun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitered%2Fgluegun/lists"}