{"id":24074625,"url":"https://github.com/desertthunder/cli","last_synced_at":"2026-04-18T12:03:20.683Z","repository":{"id":270014386,"uuid":"909141263","full_name":"desertthunder/cli","owner":"desertthunder","description":"A framework for building command line applications with Deno.","archived":false,"fork":false,"pushed_at":"2024-12-28T13:52:45.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T07:47:49.938Z","etag":null,"topics":["command-line","deno","typescript"],"latest_commit_sha":null,"homepage":"https://jsr.io/@desertthunder/cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/desertthunder.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-12-27T20:53:12.000Z","updated_at":"2024-12-28T13:52:48.000Z","dependencies_parsed_at":"2025-02-26T22:37:18.734Z","dependency_job_id":null,"html_url":"https://github.com/desertthunder/cli","commit_stats":null,"previous_names":["desertthunder/cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/desertthunder/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desertthunder%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desertthunder%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desertthunder%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desertthunder%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/desertthunder","download_url":"https://codeload.github.com/desertthunder/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/desertthunder%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["command-line","deno","typescript"],"created_at":"2025-01-09T18:19:19.224Z","updated_at":"2026-04-18T12:03:20.190Z","avatar_url":"https://github.com/desertthunder.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI\n\nCLI is a small framework for building CLI applications built upon Deno 2's\nnew standard library, [inspired](#inspiration) by similar libraries in the\nGolang ecosystem. When starting new Golang projects, I find myself installing\n`log` and `cli`, or writing a lot of boilerplate for standard library argument\nparsing and logging. Given Deno's similarities to the Golang ecosystem, I thought\nit would be fun to write my first library creating a simple, configurable\ninterface to build your applications.\n\n## Installation\n\nThis package is hosted on the JSR. To install it in your project, run:\n\n```bash\ndeno add jsr:@desertthunder/cli\n```\n\n## Examples\n\n### Creating an Application\n\nThe fastest way to get started is to import the helper functions. These are\nsimple wrappers around the constructor for the Command class. Make note of the\nMetadata type when defining the attributes and interface of your application.\n\n```typescript\nimport { createApplication, createCommand, Flags } from \"jsr:@desertthunder/cli\";\n\n// Define flags for your command (optional)\nconst flags = [\n  new Flag('string', 'name', 'name of something', true),\n  new Flag('string', 'type', 'type of something', true),\n];\n\n// Define an action to call when your command is run.\nfunction exampleAction(args?: Record\u003cstring, any\u003e) {\n  if (!args) {\n    console.log(\"No args passed!\");\n    return;\n  }\n\n  console.log(JSON.stringify(args, null, 2));\n},\n\n// Define metadata for your command\nconst exampleCommand = createCommand(\n  { name: 'command', usage: 'do something' }, action, flags\n)\n\n// Create a root command\nconst root = createApplication(\n  { name: 'application', usage: '' }, [exampleCommand]\n);\n\n// if __name__ == '__main__' ?\nif (import.meta.main) {\n  root.run(Deno.args);\n}\n```\n\n### Logger\n\n```typescript\nfunction example() {\n  const logger = createLogger(\"example-logger\");\n\n  logger.info(\"Example\");\n}\n\nif (import.meta.main) {\n  example();\n}\n```\n\n### Colors\n\n```typescript\nconsole.log(colorizeText(\"This is red text\", TerminalTextColor.RED));\nconsole.log(\n  colorizeText('This is (bright) cyan text', TerminalTextColor.BRIGHT_CYAN),\n);\n\n// See src/libs/logger/colors.ts for the full code block of examples.\n// Run deno run src/libs/logger/colors.ts the see the examples with your\n// terminal emulator's color scheme\n```\n\n![colors in stdout](./assets/colors.png)\n\n## Runtime Compatibility\n\n| Runtime | Version | Works | Notes |\n| ------- | ------- | ----- | ----- |\n| Deno    | 2.1.4   | ✅    |       |\n\n## Inspiration\n\n- Charm's [log](https://github.com/charmbracelet/log) library\n- Urfave's [cli](https://github.com/urfave/cli) V2 \u0026 V3\n\n## License\n\nCopyright 2024 Owais J (mailto:desertthunder.dev@gmail.com). See [`LICENSE`](./LICENSE)\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesertthunder%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesertthunder%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesertthunder%2Fcli/lists"}