{"id":42038372,"url":"https://github.com/h3ravel/musket","last_synced_at":"2026-01-26T05:14:13.552Z","repository":{"id":318823961,"uuid":"1076617179","full_name":"h3ravel/musket","owner":"h3ravel","description":"Musket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the H3ravel framework.","archived":false,"fork":false,"pushed_at":"2026-01-15T11:32:26.000Z","size":115,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T16:25:49.373Z","etag":null,"topics":["agnostic","app","artisan","build","cli","command-line","commander","commanderjs","commandline-tool","create","framework","h3ravel","laravel","terminal"],"latest_commit_sha":null,"homepage":"https://h3ravel.toneflix.net/musket/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h3ravel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-15T05:45:08.000Z","updated_at":"2026-01-15T11:32:29.000Z","dependencies_parsed_at":"2025-10-16T12:08:52.634Z","dependency_job_id":"b31fd428-15b3-4e25-ad5a-4f3d201ef406","html_url":"https://github.com/h3ravel/musket","commit_stats":null,"previous_names":["h3ravel/musket"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/h3ravel/musket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3ravel%2Fmusket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3ravel%2Fmusket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3ravel%2Fmusket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3ravel%2Fmusket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h3ravel","download_url":"https://codeload.github.com/h3ravel/musket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3ravel%2Fmusket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28767083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"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":["agnostic","app","artisan","build","cli","command-line","commander","commanderjs","commandline-tool","create","framework","h3ravel","laravel","terminal"],"created_at":"2026-01-26T05:14:11.969Z","updated_at":"2026-01-26T05:14:13.547Z","avatar_url":"https://github.com/h3ravel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://h3ravel.toneflix.net\"  target=\"_blank\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/h3ravel/assets/refs/heads/main/logo-full.svg\" width=\"200\" alt=\"H3ravel Logo\"\u003e\n  \u003c/a\u003e\n  \u003ch1 align=\"center\"\u003e\u003ca href=\"https://h3ravel.toneflix.net/musket\"\u003eMusket CLI\u003c/a\u003e\u003c/h1\u003e\n\n[![Framework][ix]][lx]\n[![Musket Version][i1]][l1]\n[![Downloads][d1]][l1]\n[![Tests][tei]][tel]\n[![License][lini]][linl]\n\n\u003c/div\u003e\n\n# About Musket CLI\n\nMusket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the [H3ravel](https://h3ravel.toneflix.net) framework.\n\n## Installation\n\nTo use **Musket CLI**, you may install it by running:\n\n```sh\n\nnpm install @h3ravel/musket\n# or\npnpm add @h3ravel/musket\n# or\nyarn add @h3ravel/musket\n```\n\n## Quick Setup\n\nThe base requirement fo setting up **Musket CLI** is an application class that it can bind itself to:\n\n```ts\nclass Application {}\n```\n\nOnce bound, **Musket CLI** will bind itself to the application class as `musket` and can be accessed as:\n\n```ts\nconst app = new Application();\n\n// Initialize Musket CLI here\n\nconsole.log(app.musket);\n```\n\n### Initialization\n\nTo initialize **Musket CLI** you can follow the example below:\n\n```ts\nimport { Kernel } from 'h3ravel/musket';\n\nconst app = new Application();\n\nKernel.init(app);\n```\n\nThe `init` method returs and instance of `commanderjs`'s `Command` class allowing to further extend and customize your app if there is a need for that.\n\n### Passing Configuration\n\nMusket allows passing a `config` object that alters it's behavior and provide some level of customizations\n\n```ts\nKernel.init(app, {\n  packages: ['@h3ravel/shared', '@h3ravel/support'],\n  name: 'musket-cli',\n  discoveryPaths: [path.join(process.cwd(), 'tests/Commands/*.ts')],\n});\n```\n\n### Advanced Initialization\n\nIf you need fine grained control with your initialization, `Musket CLI` exposes just the right methods to enable you do just that, when when initializing the CLI in this manner, the `packages` config property is completely ignored, as a work around, chain the `setPackages` method to the Kernel intance to achieve the same results.\n\n```ts\nimport { Kernel } from 'h3ravel/musket';\nimport { TestCommand } from './TestCommand';\n\nconst app = new Application();\n\nconst instance = new Kernel(app)\n  .setCwd(process.cwd())\n  .setConfig({\n    name: 'musket-cli',\n    discoveryPaths: [path.join(process.cwd(), 'tests/Commands/*.ts')],\n  })\n  .setPackages([\n    { name: '@h3ravel/shared', alias: 'Shared PKG' },\n    '@h3ravel/support',\n  ])\n  .registerCommands([TestCommand])\n  .bootstrap();\n\nreturn await instance.run();\n```\n\n## Creating Commands\n\nCommands in Musket extend the base `Command` class and define a **signature** and **handle()** method.\n\nExample:\n\n```ts\nimport { Command } from '@h3ravel/musket';\n\nexport default class GreetCommand extends Command {\n  protected signature = 'greet {name}';\n  protected description = 'Display a personalized greeting.';\n\n  async handle() {\n    const name = this.argument('name');\n\n    this.info(`Hello, ${name}!`);\n  }\n}\n```\n\nIf your project uses discovery paths (via `discoveryPaths`),\nthis command will be automatically registered.\n\nOtherwise, you can manually register it in your application:\n\n```ts\nclass Application {\n  registeredCommands = [GreetCommand];\n}\n\nawait Kernel.init(app);\n\n// OR\n\nawait Kernel.init(app, {\n  baseCommands: [GreetCommand, BuildCommand],\n});\n```\n\n## Running Commands\n\nOnce your CLI is compiled or built, you can run commands via:\n\n```bash\nnode dist/cli.js greet Legacy\n```\n\nOutput:\n\n```\nHello, Legacy!\n```\n\n## Documentation\n\nThe full musket documentation is available [Here](https://h3ravel.toneflix.net/musket)\n\n## Contributing\n\nThank you for considering contributing to the H3ravel framework! The [Contribution Guide](https://h3ravel.toneflix.net/contributing) can be found in the H3ravel documentation and will provide you with all the information you need to get started.\n\n## Code of Conduct\n\nIn order to ensure that the H3ravel community is welcoming to all, please review and abide by the [Code of Conduct](#).\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within H3ravel, please send an e-mail to Legacy via hamzas.legacy@toneflix.ng. All security vulnerabilities will be promptly addressed.\n\n## License\n\nThe H3ravel framework is open-sourced software licensed under the [MIT license](LICENSE).\n\n[ix]: https://img.shields.io/npm/v/%40h3ravel%2Fcore?style=flat-square\u0026label=Framework\u0026color=%230970ce\n[lx]: https://www.npmjs.com/package/@h3ravel/core\n[i1]: https://img.shields.io/npm/v/%40h3ravel%2Fmusket?style=flat-square\u0026label=@h3ravel/musket\u0026color=%230970ce\n[l1]: https://www.npmjs.com/package/@h3ravel/musket\n[d1]: https://img.shields.io/npm/dt/%40h3ravel%2Fmusket?style=flat-square\u0026label=Downloads\u0026link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40h3ravel%2Fmusket\n[linl]: https://github.com/h3ravel/framework/blob/main/LICENSE\n[lini]: https://img.shields.io/github/license/h3ravel/framework\n[tel]: https://github.com/h3ravel/framework/actions/workflows/test.yml\n[tei]: https://github.com/h3ravel/framework/actions/workflows/test.yml/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3ravel%2Fmusket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh3ravel%2Fmusket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3ravel%2Fmusket/lists"}