{"id":20832380,"url":"https://github.com/andimiller/decline-completion","last_synced_at":"2025-04-10T07:48:47.405Z","repository":{"id":184716528,"uuid":"672234437","full_name":"andimiller/decline-completion","owner":"andimiller","description":"A module for the decline command line parser to enable bash and zsh autocomplete","archived":false,"fork":false,"pushed_at":"2023-08-07T12:50:18.000Z","size":15,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T08:02:08.010Z","etag":null,"topics":["cli","completion","decline","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andimiller.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":"2023-07-29T11:26:47.000Z","updated_at":"2025-02-07T09:47:36.000Z","dependencies_parsed_at":"2024-11-18T01:35:51.494Z","dependency_job_id":null,"html_url":"https://github.com/andimiller/decline-completion","commit_stats":null,"previous_names":["andimiller/decline-completion"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fdecline-completion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fdecline-completion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fdecline-completion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fdecline-completion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andimiller","download_url":"https://codeload.github.com/andimiller/decline-completion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248181880,"owners_count":21060890,"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","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":["cli","completion","decline","scala"],"created_at":"2024-11-18T00:11:40.150Z","updated_at":"2025-04-10T07:48:47.388Z","avatar_url":"https://github.com/andimiller.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# decline-completion\nA module for the decline command line parser to enable bash and zsh autocomplete\n\n## Caveats\n\nThis is currently oriented around supporting command line interfaces with a lot of subcommands, and will traverse the tree and expose options available on each subcommand for autocomplete.\n\nIf you heavily use shared configuration options which are not attached to subcommands, be aware these are currently not supported, but may be in a future release.\n\n## Usage\n\nAdd the dependency, currently available for JVM, JS and Native:\n\n```scala\nlibraryDependencies ++= List(\n  \"net.andimiller\" %%% \"decline-completion\" % \"0.0.2\"\n)\n```\n\nAdd a new subcommand that can expose the output from this library:\n\n```scala\nlazy val othercommand = Opts.subcommand(\"???\", \"???\").as(???)\n\nlazy val completion = Opts.subcommand(\"completion\", \"output autocompletion scripts for common shells\") {\n  val bash = Opts.subcommand(\"bash\", \"output autocompletion script for bash\").as(\n    IO.println(\n      Completion.bashCompletion(cli)\n    )\n  )\n  val bash = Opts.subcommand(\"bash\", \"output autocompletion script for bash\").as(\n    IO.println(\n      Completion.zshBashcompatCompletion(cli)\n    )\n  ) \n\n}\n\nlazy val cli = Command(\"myprogram\", \"my program does things\") {\n  othercommand orElse completion\n}\n```\n\nThen call it on the command line to use it:\n\n### bash\n\n```sh\nmyprogram completion bash \u003e myprogram-completion.bash\nsource myprogram-completion.bash\n```\n\n### zsh\n\n```sh\nmyprogram completion zsh \u003e myprogram-completion.zsh\nsource myprogram-completion.zsh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandimiller%2Fdecline-completion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandimiller%2Fdecline-completion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandimiller%2Fdecline-completion/lists"}