{"id":18417073,"url":"https://github.com/yamaton/h2o-curated-data","last_synced_at":"2025-04-07T12:32:15.290Z","repository":{"id":37233687,"uuid":"377216541","full_name":"yamaton/h2o-curated-data","owner":"yamaton","description":"Semi-hand curated command-line option data for many CLI programs, geared toward bioinformatics tools. Shell completion scripts are also available. ","archived":false,"fork":false,"pushed_at":"2024-12-17T02:33:16.000Z","size":42028,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T18:41:10.773Z","etag":null,"topics":["bash","bioinformatics","cli","dataset","fish","shell","vscode-extension","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yamaton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-06-15T15:48:50.000Z","updated_at":"2025-03-10T06:30:48.000Z","dependencies_parsed_at":"2024-12-17T03:49:09.854Z","dependency_job_id":null,"html_url":"https://github.com/yamaton/h2o-curated-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamaton%2Fh2o-curated-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamaton%2Fh2o-curated-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamaton%2Fh2o-curated-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamaton%2Fh2o-curated-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamaton","download_url":"https://codeload.github.com/yamaton/h2o-curated-data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247653180,"owners_count":20973776,"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","bioinformatics","cli","dataset","fish","shell","vscode-extension","zsh"],"created_at":"2024-11-06T04:08:10.548Z","updated_at":"2025-04-07T12:32:10.256Z","avatar_url":"https://github.com/yamaton.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI curated data for shell completion\n\nThis repository contains command-line specs for [Shell Completion](https://marketplace.visualstudio.com/items?itemName=tetradresearch.vscode-h2o) for VS Code. This repository also contains tab completion scripts for bash/zsh/fish shells.\n\nShell completion scripts for bioinformatics tools are located in the separate repositories:\n  * [yamaton/fish-completions-bio](https://github.com/yamaton/fish-completions-bio)\n  * [yamaton/zsh-completions-bio](https://github.com/yamaton/zsh-completions-bio)\n\n\n\n## Loading the data in VS Code\n\n* In VS Code,  type `Ctrl`+`Shift`+`P` (or `⌘`+`⇧`+`P` on macOS) and run following commands:\n  * `Shell Completion: Load Common CLI Data` to load commands in [general.txt](https://github.com/yamaton/h2o-curated-data/blob/main/general.txt)\n  * `Shell Completion: Load Bioinformatics CLI Data` to load commands in [bio.txt](https://github.com/yamaton/h2o-curated-data/blob/main/bio.txt)\n\n\n\n## Shell completion for bash/zsh/fish\n\nThey would be useful especially for bioinformaticians.\n\n### bash\n\nCopy files ([general](https://github.com/yamaton/h2o-curated-data/tree/main/general/bash)) to `~/.bash_completion.d/`, and add the following to `~/.bashrc`.\n\n```bash\nfor bcfile in ~/.bash_completion.d/* ; do\n    . \"$bcfile\"\ndone\n```\n\n\n\n### zsh\n\nSave files ([bio](https://github.com/yamaton/zsh-completions-bio/tree/main/completions), [general](https://github.com/yamaton/h2o-curated-data/tree/main/general/zsh)) to `~/.zfunc`, then add the following line to `~/.zshrc`.\n\n```zsh\nfpath=( ~/.zfunc \"${fpath[@]}\" )\n```\n\n\n\n### fish\n\nSave files ([bio](https://github.com/yamaton/fish-completions-bio/tree/main/completions), [general](https://github.com/yamaton/h2o-curated-data/tree/main/general/fish)) to `~/.config/fish/completions/`.\n\n\n\n\n\n## How I prepare the data\n\nI use `h2o` (closed source code) to extract CLI specs, and then apply [yq](https://github.com/mikefarah/yq) to convert from JSON to YAML.\n\nHere is how I extracted the CLI info from [medaka](https://github.com/nanoporetech/medaka), for example.\n\n```shell\n# Just see how it works\n$ h2o --command medaka\n\n# ...OK. H2o seems to fail parsing some.\n# So save the help document as text file for manual editing...\n$ medaka --help \u003e medaka.txt\n\n# Edit medaka.txt s.t. command options, subcommands, and descriptions are placed nicely.\n# ...\n# ...\n# After finishing the edit, extract the data as YAML file.\n$ h2o --file medaka.txt --format json | yq eval -P \u003e bio/yaml/medaka.yaml\n\n# Add TLDR to the YAML, then convert it to JSON and bash/zsh/fish scripts\n# group=bio sets the environment variable and run make\n# The makefile calls multiple scripts including\n#    - Add TLDR to YAML\n#    - Convert YAML to JSON\n#    - Create bash/zsh/fish scripts\n#    - Take the entire JSON as an array, create a gzipped JSON file\n$ group=bio make\n\n```\n\n\n\n## Data structure\n\nHere is a sample file.\n\n```yaml\nname: tar\ndescription: an archiving utility\noptions:\n  - names:\n      - -x\n      - --extract\n      - --get\n    argument: \"\"\n    description: extract files from an archive\n  - names:\n      - -v\n      - --verbose\n    argument: \"\"\n    description: verbosely list files processed\nversion: tar (GNU tar) 1.34\n```\n\n\n\nAs you can see,  an entry has following key-values:\n\n* name (string)\n* description (string)\n* options (list)\n  * names (list of strings)\n  * argument (string)\n  * description (string)\n* [optional] positionalArguments\n  * name (string)\n  * description (string)\n* **[optional]** subcommands:\n  * (Here comes a list of the entire structure. Nested.)\n* [optional] inheritedOptions (same type as options)\n* [optional] usage (string)\n* [optional] version (string)\n* [optional] tldr (string)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamaton%2Fh2o-curated-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamaton%2Fh2o-curated-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamaton%2Fh2o-curated-data/lists"}