{"id":15287556,"url":"https://github.com/linux-china/cli-completion","last_synced_at":"2025-04-13T05:37:29.401Z","repository":{"id":57605113,"uuid":"312760801","full_name":"linux-china/cli-completion","owner":"linux-china","description":"CLI completion for bash, zsh, fish and powershell","archived":false,"fork":false,"pushed_at":"2021-11-28T22:53:21.000Z","size":905,"stargazers_count":22,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T15:44:26.280Z","etag":null,"topics":["bash","cli","completion","fish","oh-my-zsh","powershell","zsh"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/linux-china.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":"2020-11-14T06:34:41.000Z","updated_at":"2025-02-09T01:26:23.000Z","dependencies_parsed_at":"2022-08-27T22:03:51.667Z","dependency_job_id":null,"html_url":"https://github.com/linux-china/cli-completion","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fcli-completion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fcli-completion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fcli-completion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fcli-completion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/cli-completion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670506,"owners_count":21142897,"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":["bash","cli","completion","fish","oh-my-zsh","powershell","zsh"],"created_at":"2024-09-30T15:31:36.737Z","updated_at":"2025-04-13T05:37:29.354Z","avatar_url":"https://github.com/linux-china.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"CLI completion\n==============\n[![cli-completion Crate](https://img.shields.io/crates/v/cli-completion)](https://crates.io/crates/cli-completion)\n\nCLI completion for bash, zsh, fish and powershell.\n\n![CLI Completion](https://github.com/linux-china/cli-completion/blob/master/structure.png?raw=true)\n\n# How to install?\n\n```\n$ cargo install cli-completion\n```\n\n# How to use?\n\nPlease refer https://github.com/clap-rs/clap#using-yaml to write YAML file for the cli.\nOr you can refer [multipass.yaml](https://github.com/linux-china/cli-completion/blob/master/commands/multipass.yaml) as an example.\n\n```\n$ cli-completion --bash commands/multipass.yaml\n```\n\n### bash completion\n\n```\n$ cli-completion --bash xxx.yaml \u003e xxx-completion.sh\n```\n\n### fish completion\n\n```\n$ cli-completion --bash xxx.yaml \u003e xxx-completion.fish\n```\n\n### zsh completion\n\n```\n$ cli-completion --bash xxx.yaml \u003e /usr/local/share/zsh/site-functions/_xxx\n$ autoload -U compinit \u0026\u0026 compinit\n```\n\n### oh-my-zsh completion\n\n```\n$ mkdir ~/.oh-my-zsh/custom/plugins/xxx \n$ cli-completion --zsh xxx.yaml \u003e  ~/.oh-my-zsh/custom/plugins/xxx/_xxx \n```\n\nDon't forget to enable xxx plugin in ~/.zshrc file！\n\n### powershell completion\n\n```\n$ cli-completion --powershell xxx.yaml \u003e xxx-completion.ps\n```\n\n# References\n\n* clap-rs: https://github.com/clap-rs/clap\n* cli-completion crate: https://crates.io/crates/cli-completion\n* Command Line Interface Guidelines: https://clig.dev/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fcli-completion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fcli-completion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fcli-completion/lists"}