{"id":15669033,"url":"https://github.com/dcdunkan/cly","last_synced_at":"2025-10-06T08:07:09.744Z","repository":{"id":62422791,"uuid":"505520457","full_name":"dcdunkan/cly","owner":"dcdunkan","description":"A tiny solution for creating tiny command line applications with Deno. Zero third-party dependencies!","archived":false,"fork":false,"pushed_at":"2022-06-20T16:44:44.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T04:44:06.686Z","etag":null,"topics":[],"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/dcdunkan.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}},"created_at":"2022-06-20T16:38:19.000Z","updated_at":"2024-06-15T20:40:57.000Z","dependencies_parsed_at":"2022-11-01T17:32:39.067Z","dependency_job_id":null,"html_url":"https://github.com/dcdunkan/cly","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dcdunkan/cly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fcly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fcly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fcly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fcly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcdunkan","download_url":"https://codeload.github.com/dcdunkan/cly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fcly/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554909,"owners_count":24269062,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":[],"created_at":"2024-10-03T14:21:10.408Z","updated_at":"2025-10-06T08:07:04.613Z","avatar_url":"https://github.com/dcdunkan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"_The Command Line Y-interface._\n\n# CLY\n\nA tiny solution for creating tiny command line applications, with zero\nthird-party dependencies. Easy to setup and configurable!\n\nSee the Deno module here: https://deno.land/x/cly\n\n```ts\nimport { ClyApp } from \"https://deno.land/x/cly/mod.ts\";\n\nconst app = new ClyApp(\"App name\")\n  .default(() =\u003e console.log(\"Hello!\"))\n  .command(\"help\", () =\u003e console.log(app.getHelp()));\n\napp.run();\n```\n\nLook, how easy it is!\n\nSee the [examples.ts](example.ts) for a full example.\n\nThis library is minimal, but powerful. Few methods and stuff. But you can do a\nlot with it. Here are the options that you can configure.\n\n## Options\n\n```ts\nconst app = new ClyApp(\"App\", {\n  description: \"App description\",\n  version: \"1.0.0\",\n  help: \"Work with App from the command line!\",\n  executableName: \"app-command-name\",\n  parseOptions: {},\n  forUnknownShow: \"error\",\n  unknownMsg: (cmd) =\u003e `error: command not found '${cmd}'`,\n});\n```\n\n- \u003csamp\u003ehelp\u003c/samp\u003e ─ A custom help message to be used when help message has to\n  be printed. If not set, a help message is generated with available commands,\n  version, usage, and description.\n- \u003csamp\u003eversion\u003c/samp\u003e ─ Version to print under the generated help message. If\n  not specified, just the app name is printed. Version is prefixed with\n  \u003csamp\u003ev\u003c/samp\u003e.\n- \u003csamp\u003edescription\u003c/samp\u003e ─ Description to add on top of the generated help\n  message. Nothing is printed as description if not used.\n- \u003csamp\u003eexecName\u003c/samp\u003e ─ Executable name for the usage hint in the help\n  message.\n- \u003csamp\u003eparseOptions\u003c/samp\u003e ─ Argument options to be used with the Deno's\n  standard \u003csamp\u003eflag\u003c/samp\u003e module's argument parser.\n  https://deno.land/std/flags/mod.ts\n- \u003csamp\u003eforUnknownShow\u003c/samp\u003e ─ You can pass \"**error**\",\n  \"**help**\", or \"**default_handler**\" as the value. So, when an\n  unknown command is used with your CLI application, you could either print out\n  \"unknown command\" error (or the custom error, if one set using\n  \u003csamp\u003eunknownMsg\u003c/samp\u003e), or help message or the default handler, if one is\n  set.\n- \u003csamp\u003eunknownMsg\u003c/samp\u003e ─ A custom error message for unknown commands. A\n  function that returns a that custom error message as string. It takes the\n  entered command as a parameter.\n\n## Methods\n\n- \u003csamp\u003edefault\u003c/samp\u003e ─ Registers a default handler. Used when no commands are\n  passed in.\n- \u003csamp\u003ecommand\u003c/samp\u003e ─ Registers a command and it's handler.\n\n  ```ts\n  import { ClyApp } from \"https://deno.land/x/cly/mod.ts\";\n\n  const app = new ClyApp(\"App\");\n\n  app.command(\"help\", handler);\n  app.command([\"joke\", \"tell-joke\"], handler);\n  app.command({\n    command: \"command\", // or [\"command\", \"alias-1\", \"alias-2\", ...],\n    // description to be used in the help generated message.\n    description: \"Command description\",\n  }, handler);\n  ```\n\n  The handler function takes parsed arguments as the arguments. Doesn't have to\n  return anything.\n\n  You could also type the arguments.\n\n  ```ts\n  app.command\u003c{ A: boolean }\u003e(\"run\", (args) =\u003e {\n    console.log(args.A);\n  });\n  ```\n- \u003csamp\u003erun\u003c/samp\u003e ─ Start your application.\n- \u003csamp\u003egetHelp\u003c/samp\u003e ─ Returns the help message.\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  Go, create your \u003cb\u003eCommand Line Y-Interface\u003c/b\u003e...\u003cbr\u003e\n  \u003ca href=\"LICENSE\"\u003eLicensed under MIT\u003c/a\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdunkan%2Fcly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcdunkan%2Fcly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdunkan%2Fcly/lists"}