{"id":23630826,"url":"https://github.com/ioncakephper/grunt-generate-cli-markdown","last_synced_at":"2026-02-07T09:31:03.129Z","repository":{"id":269168459,"uuid":"906620369","full_name":"ioncakephper/grunt-generate-cli-markdown","owner":"ioncakephper","description":"Generate Markdown documentation for your CLI tools effortlessly. This Grunt plugin automates the creation of beautiful, informative READMEs based on your CLI's functionality, making documentation a breeze.","archived":false,"fork":false,"pushed_at":"2024-12-24T09:54:16.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T01:59:51.946Z","etag":null,"topics":["automate","automation","cli","command-line","documentation","generator","grunt","grunt-plugin","markdown","readme"],"latest_commit_sha":null,"homepage":"","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/ioncakephper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2024-12-21T12:19:49.000Z","updated_at":"2024-12-24T09:54:20.000Z","dependencies_parsed_at":"2024-12-21T13:31:19.543Z","dependency_job_id":"1f64597f-efb0-4a7b-a9a0-501ef7051ef2","html_url":"https://github.com/ioncakephper/grunt-generate-cli-markdown","commit_stats":null,"previous_names":["ioncakephper/grunt-generate-cli-markdown"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ioncakephper/grunt-generate-cli-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fgrunt-generate-cli-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fgrunt-generate-cli-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fgrunt-generate-cli-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fgrunt-generate-cli-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioncakephper","download_url":"https://codeload.github.com/ioncakephper/grunt-generate-cli-markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioncakephper%2Fgrunt-generate-cli-markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29191386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["automate","automation","cli","command-line","documentation","generator","grunt","grunt-plugin","markdown","readme"],"created_at":"2024-12-28T02:47:06.143Z","updated_at":"2026-02-07T09:31:03.107Z","avatar_url":"https://github.com/ioncakephper.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\n \u003cimg width=200px height=200px src=\"https://i.imgur.com/6wj0hh6.jpg\" alt=\"Project logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003egrunt-generate-cli-markdown\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\n[![GitHub Issues](https://img.shields.io/github/issues/ioncakephper/grunt-generate-cli-markdown.svg)](https://github.com/ioncakephper/grunt-generate-cli-markdown/issues)\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/ioncakephper/grunt-generate-cli-markdown.svg)](https://github.com/ioncakephper/grunt-generate-cli-markdown/pulls)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n[![Node.js CI](https://github.com/ioncakephper/grunt-generate-cli-markdown/actions/workflows/node.js.yml/badge.svg)](https://github.com/ioncakephper/grunt-generate-cli-markdown/actions/workflows/node.js.yml)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e Generates Markdown documentation for a CLI.  This Grunt plugin helps automate the creation of markdown documentation based on how your CLI tool.\n    \u003cbr\u003e\n\u003c/p\u003e\n\n## 📝 Table of Contents \u003c!-- omit in toc --\u003e\n\n- [🏁 Getting Started](#-getting-started)\n- [🎈 Usage](#-usage)\n- [:gear: Options](#gear-options)\n- [:exclamation: Example](#exclamation-example)\n- [Commands](#commands)\n  - [`check|c` command](#checkc-command)\n  - [`build|b` command](#buildb-command)\n  - [`help` command](#help-command)\n- [⛏️ Built Using](#️-built-using)\n- [🤝 Contributing](#-contributing)\n- [💖 Show your support](#-show-your-support)\n- [✍️ Authors](#️-authors)\n- [📝 License](#-license)\n\n## 🏁 Getting Started\n\nThis plugin requires Grunt `^1.6.1`\n\n1. **Install the plugin:**\n\n```bash\nnpm install grunt-generate-cli-markdown --save-dev\n```\n\n2. **Load the plugin:** Add this line to your Gruntfile.js file:\n\n```js\ngrunt.loadNpmTasks('grunt-generate-cli-markdown');\n```\n\n3. **Configure the plugin:** Add the following configuration to your Gruntfile.js file:\n\n```js\n  generate-cli-markdown: {\n    your_target: { // Arbitrary target name\n      options: {\n        // Add plugin-specific options here. Examples:\n        cliPath: 'path/to/your/cli', // Path to your CLI executable\n        // other options as needed.\n      },\n      files: {\n        'DESTINATION_README.md': 'SOURCE.md'  // Specify source and destination files\n      }\n    },\n  },\n```\n\n## 🎈 Usage\n\n```js\ngenerate-cli-markdown: {\n  myTarget: { \n   options: {\n     cliPath: './bin/mycli',\n       // ... other options\n   },\n   files: {\n     'docs/README.md': 'templates/README.md'\n   }\n }\n}\n```\n\n## :gear: Options\n\n- `cliPath` **(required)**: The path to the executable file of your CLI tool. (Type: String)\n\n## :exclamation: Example\n\nThis example demonstrates how to use `grunt-generate-cli-markdown` with a simple CLI that has two commands (`check` and `build`) and a global verbose option.  It also showcases the use of command aliases and customizing the help output.\n\n**1. Create the CLI:**\n\nCreate a file named `src/index.js` (or any name you like, making sure to update the paths in the configuration accordingly) with the following content:\n\n```javascript\n#!/usr/bin/env node\n\n\"use strict\";\nconst { program } = require('commander');\n\nprogram\n    .version('1.0.0')\n    .option('-v, --verbose', 'Enable verbose output')\n    .configureHelp({\n        sortCommands: true,\n        sortOptions: true,\n        showGlobalOptions: true\n    });\n\n\nprogram\n    .command('check')\n    .alias('c')\n    .description('Check the project')\n    .action(() =\u003e {\n        console.log('Checking the project...');\n    });\n\nprogram\n    .command('build')\n    .alias('b')\n    .description('Build the project')\n    .option('-p, --production', 'Build for production')\n    .option('-s, --sidebarsFilename \u003cfilename\u003e', 'Specify the sidebars filename', 'sidebars.js')\n    .option('-d, docs \u003cdocs\u003e', 'Specify the docs directory', 'docs')\n    .option('--config \u003cfilename\u003e', 'Specify the config file', 'app.config.js')\n    .argument('\u003csource\u003e', 'Source directory')\n    .argument('[destination]', 'Destination directory', 'dist')\n    .action((source, destination, options) =\u003e {\n        console.log('Building the project...');\n        console.log('Source:', source);\n        console.log('Destination:', destination);\n        console.log('Options:', options);\n    });\n\nprogram.parse();\n```\n\n**2. Create a Gruntfile.js:**\n\nCreate a file named `Gruntfile.js` with the following content:\n\n  ```javascript\n  module.exports = function(grunt) {\n    grunt.loadNpmTasks('grunt-generate-cli-markdown');\n  \n  };\n```\n\n**3. Install dependencies:**\n\n- Install the `commander` package:\n\n```bash shell\nnpm install commander\n```\n\n- Install the `grunt-generate-cli-markdown` and `grunt` packages:\n\n```bash shell\nnpm install grunt-generate-cli-markdown --save-dev\n```\n\n**4. Install the Grunt-CLI package:**\n\n```bash shell\nnpm install -g grunt-cli\n```\n\n**5. Run the Grunt task:** \n\n```bash shell\ngrunt generate-cli-markdown\n```\n\n```bash shell\nRunning \"generate-cli-markdown\" task\n\u003e\u003e Markdown documentation generated: ./src/index.js.md\n\nDone.\n```\n\nThis will generate a markdown file (`src/index.js.md` in this example) containing the documentation for your CLI, including the commands, their descriptions, aliases, and the global verbose option. The generated markdown will also reflect the custom help configuration using `sortCommands`, `sortOptions`, and `showGlobalOptions`.\n\nBy modifying the `src/index.js` file (adding, removing, or changing commands, options, descriptions, etc.), and re-running the grunt `generate-cli-markdown` task, the generated markdown documentation will automatically update to reflect the changes in your CLI's source code. For instance, adding a new command with its description and options in `src/index.js` will result in this new command's documentation appearing in the generated markdown after running the Grunt task.\n\n**6. Examine the generated markdown:**\n\n```markdown\n\u003c!-- ::insert file=\"src/index.js.md\" --\u003e\n\u003c!-- Inserted on: 2024-12-24T09:46:39.041Z --\u003e\nOptions:\n\n**Example Usage:**\n\n```bash\nnode ./src/index.js [command] [options]\n```\n\n**Version:**\n\n```bash\nnode ./src/index.js -V # or --version\n```\n\n```txt\n1.0.0\n```\n\n**Help:**\n\n```bash\nnode ./src/index.js -h # or --help\n```\n\n```txt\nUsage: index [options] [command]\n\nOptions:\n  -h, --help                                display help for command\n  -v, --verbose                             Enable verbose output\n  -V, --version                             output the version number\n\nCommands:\n  check|c                                   Check the project\n  build|b [options] \u003csource\u003e [destination]  Build the project\n  help [command]                            display help for command\n\n```\n\n**Options:**\n\n| Option | Description |\n|---|---|\n| `-h, --help`  | display help for command |\n| `-v, --verbose`  | Enable verbose output |\n| `-V, --version`  | output the version number |\n\n## Commands\n\n- [`check|c` command](#check|c-command)\n- [`build|b` command](#build|b-command)\n- [`help` command](#help-command)\n\n### `check|c` command\n\nCheck the project\n\n**Example Usage:**\n\n```bash\nnode ./src/index.js check [options]\n```\n\n**Version:**\n\n```bash\nnode ./src/index.js check -V # or --version\n```\n\n```txt\n1.0.0\n```\n\n**Help:**\n\n```bash\nnode ./src/index.js check -h # or --help\n```\n\n```txt\nUsage: index check|c [options]\n\nCheck the project\n\nOptions:\n  -h, --help     display help for command\n\nGlobal Options:\n  -v, --verbose  Enable verbose output\n  -V, --version  output the version number\n\n```\n\n**Options:**\n\n| Option | Description |\n|---|---|\n| `-h, --help`  | display help for command |\n\n### `build|b` command\n\nBuild the project\n\n**Example Usage:**\n\n```bash\nnode ./src/index.js build [arguments] [options]\n```\n\n**Version:**\n\n```bash\nnode ./src/index.js build -V # or --version\n```\n\n```txt\n1.0.0\n```\n\n**Help:**\n\n```bash\nnode ./src/index.js build -h # or --help\n```\n\n```txt\nUsage: index build|b [options] \u003csource\u003e [destination]\n\nBuild the project\n\nArguments:\n  source                             Source directory\n  destination                        Destination directory (default: \"dist\")\n\nOptions:\n  --config \u003cfilename\u003e                Specify the config file (default:\n                                     \"app.config.js\")\n  -d, docs \u003cdocs\u003e                    Specify the docs directory (default:\n                                     \"docs\")\n  -h, --help                         display help for command\n  -p, --production                   Build for production\n  -s, --sidebarsFilename \u003cfilename\u003e  Specify the sidebars filename (default:\n                                     \"sidebars.js\")\n\nGlobal Options:\n  -v, --verbose                      Enable verbose output\n  -V, --version                      output the version number\n\n```\n\n**Arguments:**\n\n| Argument | Description | Default |\n|---|---|---|\n| `source` | Source directory |  |\n| `destination` | Destination directory | \"dist\" |\n\n**Options:**\n\n| Option | Description |\n|---|---|\n| `--config`  | Specify the config file (default: |\n| `-h, --help`  | display help for command |\n| `-p, --production`  | Build for production |\n| `-s, --sidebarsFilename`  | Specify the sidebars filename (default: |\n\n### `help` command\n\nOptions:\n\n**Example Usage:**\n\n```bash\nnode ./src/index.js help [command] [options]\n```\n\n**Version:**\n\n```bash\nnode ./src/index.js help -V # or --version\n```\n\n```txt\n1.0.0\n```\n\n**Help:**\n\n```bash\nnode ./src/index.js help -h # or --help\n```\n\n```txt\nUsage: index [options] [command]\n\nOptions:\n  -h, --help                                display help for command\n  -v, --verbose                             Enable verbose output\n  -V, --version                             output the version number\n\nCommands:\n  check|c                                   Check the project\n  build|b [options] \u003csource\u003e [destination]  Build the project\n  help [command]                            display help for command\n\n```\n\n**Options:**\n\n| Option | Description |\n|---|---|\n| `-h, --help`  | display help for command |\n| `-v, --verbose`  | Enable verbose output |\n| `-V, --version`  | output the version number |\n\n\n\u003c!-- :/insert --\u003e\n\n```\n\n**7. Change CLI source file:**\n\nUpdate the CLI source file to include more commands, options, and aliases. Rerun the Grunt task to generate the updated markdown.\n\n```javascript\nprogram\n  .command('check')\n  .alias('c')\n  .description('Check the project')\n  .action(() =\u003e {\n    console.log('Checking the project...');\n  });\n\nprogram\n  .command('build', { hidden: false })\n  .alias('b')\n  .description('Build the project')\n  .action(() =\u003e {\n    console.log('Building the project...');\n  });\n\nprogram\n  .command('deploy', { hidden: false })\n  .alias('d')\n  .description('Deploy the project')\n  .action(() =\u003e {\n    console.log('Deploying the project...');\n  });\n\nprogram.parse();\n```\n\n```bash shell\ngrunt generate-cli-markdown\n```\n\n\n## ⛏️ Built Using\n\n- Node.js\n- Grunt\n\n## 🤝 Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check issues page.\n\n## 💖 Show your support\n\nGive a ⭐️ if this project helped you!\n\n## ✍️ Authors\n\n- [@ioncakephper](https://github.com/ioncakephper) - Idea \u0026 Initial work\n\n## 📝 License\n\nCopyright © 2024 [Ion Gireada](https://github.com/ioncakephper). This project is [MIT licensed](LICENSE).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioncakephper%2Fgrunt-generate-cli-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioncakephper%2Fgrunt-generate-cli-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioncakephper%2Fgrunt-generate-cli-markdown/lists"}