{"id":46055994,"url":"https://github.com/blakechambers/hort-cli","last_synced_at":"2026-03-01T10:03:17.550Z","repository":{"id":146896312,"uuid":"604922546","full_name":"blakechambers/hort-cli","owner":"blakechambers","description":"a simple cli tool for Deno","archived":false,"fork":false,"pushed_at":"2025-09-19T13:01:16.000Z","size":88,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T15:32:15.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/blakechambers.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-22T04:00:15.000Z","updated_at":"2025-09-19T13:01:19.000Z","dependencies_parsed_at":"2023-12-14T14:27:56.558Z","dependency_job_id":"f8946317-329b-44fc-ab6c-dad5be0563d8","html_url":"https://github.com/blakechambers/hort-cli","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/blakechambers/hort-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakechambers%2Fhort-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakechambers%2Fhort-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakechambers%2Fhort-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakechambers%2Fhort-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blakechambers","download_url":"https://codeload.github.com/blakechambers/hort-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakechambers%2Fhort-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29966684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T09:33:09.965Z","status":"ssl_error","status_checked_at":"2026-03-01T09:25:48.915Z","response_time":124,"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":[],"created_at":"2026-03-01T10:03:15.299Z","updated_at":"2026-03-01T10:03:17.524Z","avatar_url":"https://github.com/blakechambers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hort-cli\n\nA lightweight Deno command-line interface builder for creating custom CLI tools.\n\nhort-cli is a Deno command-line tool interface tool. Similar to\n[thor](http://whatisthor.com), hort's goal is to provide a small wrapper around\nexisting Deno functions – to make them accessible via the command line.\n\n## Table of Contents\n\n- [Introduction](#hort-cli)\n- [Example](#example)\n- [Motivation](#motivation)\n- [Local Testing](#local-testing)\n- [Roadmap](#roadmap)\n  - [0.2.x Work Remaining](#02x-work-remaining)\n  - [Ideas for the Future](#ideas-for-the-future)\n\n## Example\n\n```typescript\nimport { ArgTypes, buildTask, main } from \"../mod.ts\";\n\ninterface HelloOpts {\n  name: string;\n  quiet?: boolean;\n}\n\n// the function we are going to build a cli task for. In general, you would\n// want to put this in a separate file, but this is just an example.  Note:\n// this function uses named parameters which is what hort is built to support.\nfunction helloWorld({ name, quiet }: HelloOpts): void {\n  const punctuation = quiet ? \".\" : \"!!!\";\n\n  console.log(`Hello, ${name}${punctuation}`);\n}\n\n// build the task\nconst task = buildTask(helloWorld, (t) =\u003e {\n  // add the plain text description of what the task does.\n  t.desc = \"A simple hello world task. Nothing fancy here.\";\n\n  // an argument in this case is a required text param passed after the\n  // command.  In this case, the name of the person to greet. Because this\n  // is trying to demonstrate the functionality of the tool, this is\n  // required.  If you wanted to make it optional, you could instead use\n  // addOption.  See the next block for that.\n  t.addArgument(\"name\", ArgTypes.String, (a) =\u003e {\n    a.desc = \"Who should we say hello to?\";\n    a.required = true;\n  });\n\n  // adds an option.  this value would be specified as --quiet, --quiet=true,\n  // --quiet=1, etc. Since this is `required=false`, it is optional. If you\n  // wanted to make it required, you could set `required=true`.\n  t.addOption(\"quiet\", ArgTypes.Boolean, (o) =\u003e {\n    o.desc = \"Calms the greeting.  No need for all the spice!\";\n    o.required = false;\n  });\n});\n\nexport default helloWorld;\nexport { task };\n\n// if this is the main module, run the task.  Ideally you wouldn't do this\n// in a single file, but this is just an example.  Here, `main` is the function\n// that bootstraps the cli processing.  It takes a task and runs it based on\n// the parameters.  If the values specified are invalid, it will print out the\n// help text (also can be found using `--help`). If the values are valid, it\n// will run the task.\nif (import.meta.main) {\n  main(task);\n}\n```\n\nThis example lives in `example/simple.ts`. From the repository root you can run:\n\n```\n% deno run example/simple.ts Person\nHello, Person!!!\n% deno run example/simple.ts Person --quiet\nHello, Person.\n% deno run example/simple.ts\nerror: Uncaught (in promise) Error: Type error – requires a string\n    throw new Error(\"Type error – requires a string\");\n          ^ [...]\n```\n\nAdditionally, hort supports help text output:\n\n```\n% deno run example/simple.ts --help\nhelloWorld\n\nA simple hello world task. Nothing fancy here.\n\nArguments\n\n    \u003cname\u003e  Who should we say hello to?\n\nOptions\n\n    --quiet  Calms the greeting.  No need for all the spice!\n```\n\nBeyond what's shown in this example, hort supports nesting tasks and building\ntasks from a directory. The `example/cli.ts` script demonstrates subcommands:\n\n```typescript\nimport { main, Task } from \"../mod.ts\";\nimport { task as listTask } from \"./cli/list.ts\";\nimport { task as catTask } from \"./cli/cat.ts\";\n\nif (import.meta.main) {\n  const t = new Task(\"Pom\", undefined, (t) =\u003e {\n    t.desc = \"A simple example wrapper for Hort CLI\";\n    t.addSubTask(listTask);\n    t.addSubTask(catTask);\n  });\n\n  main(t);\n}\n```\n\nTry it out with:\n\n```bash\ndeno run example/cli.ts list foo\ndeno run --allow-read example/cli.ts cat example/cli/cat.ts\n```\n\n## Motivation\n\nI created hort-cli to simplify my local tooling while exploring Deno. It's\nlikely not what you're looking for (maybe [cliffy](https://cliffy.io) would be\nbetter and more stable for now).\n\nAs mentioned above, thor's ability to build and support more complex CLI use\ncases is something that I've enjoyed. This tool hopefully helps to support that.\n\n## Local testing\n\n```\ndeno test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakechambers%2Fhort-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblakechambers%2Fhort-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakechambers%2Fhort-cli/lists"}