{"id":19522044,"url":"https://github.com/aretrosen/tabman","last_synced_at":"2026-05-03T11:32:36.495Z","repository":{"id":224260435,"uuid":"762847953","full_name":"aretrosen/tabman","owner":"aretrosen","description":"A tab completion and argument parsing library for Javascript and Typescript CLI programs.","archived":false,"fork":false,"pushed_at":"2024-04-22T02:55:38.000Z","size":149,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T11:03:34.085Z","etag":null,"topics":["argument-parser","cli","cli-app","completion","completions","node","node-js","node-module","nodejs","tab-completion","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@kyvernetes/tabman","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aretrosen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-02-24T21:19:18.000Z","updated_at":"2024-04-29T10:34:26.000Z","dependencies_parsed_at":"2024-02-24T22:18:31.307Z","dependency_job_id":"954cbf62-4afe-4a25-8505-6c0daf6e6c41","html_url":"https://github.com/aretrosen/tabman","commit_stats":null,"previous_names":["aretrosen/tabman"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aretrosen/tabman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretrosen%2Ftabman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretrosen%2Ftabman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretrosen%2Ftabman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretrosen%2Ftabman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aretrosen","download_url":"https://codeload.github.com/aretrosen/tabman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aretrosen%2Ftabman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32567257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["argument-parser","cli","cli-app","completion","completions","node","node-js","node-module","nodejs","tab-completion","typescript"],"created_at":"2024-11-11T00:36:55.370Z","updated_at":"2026-05-03T11:32:36.480Z","avatar_url":"https://github.com/aretrosen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tabman\n\n**Tabman** is a library for JavaScript and TypeScript command line interface (CLI) programs that provides functionality for tab completion and argument parsing.\n\n## Usage\n\nTo use `Tabman`, first import `Completions` and `argFunction`, and then define your desired completions as an object. For example:\n\n```typescript\nconst myCompletions = {\n  \"--help\": { __desc: \"Some kinda help\" },\n  add: {\n    __desc: \"Some kinda add\",\n    \"--dev\": {\n      __desc: \"Some kinda dev\",\n    },\n    \"--prod\": {\n      __desc: \"Some kinda prod\",\n    },\n    \"--opt\": {\n      __desc: \"Some kinda optional\",\n    },\n  },\n  cache: [\"ls\", \"dir\", \"clean\"],\n  global: {\n    add: {},\n    cache: {},\n  },\n};\n\nmyCompletions.global.add = myCompletions.add;\nmyCompletions.global.cache = myCompletions.cache;\n```\n\nNext, specify the type of each argument or option. While there are some automated methods for detecting certain types, it is generally better to explicitly declare them for clarity and consistency.\n\n```typescript\nconst typer: Record\u003cstring, argFunction\u003e = {\n  global: \"boolean\",\n  add: \"boolean\",\n  cache: \"boolean\",\n};\n```\n\nThen, create an instance of the `Completion` class, passing it the completions object, the type definitions, and an optional map of aliases. If you don't have any aliases, you can simply pass an empty `Map()`.\n\n```typescript\nconst someCompletions = new Completion(myCompletions, typer, new Map());\n```\n\nFinally, call the `nextCompletions` method on the `Completion` instance whenever you want to generate a list of possible completions. You must provide the name of the current shell and any additional completions you want to include.\n\n```typescript\nconst compgen = someCompletions.nextCompletions(\"zsh\");\n```\n\nThe `nextCompletions` method reads the value of the `COMP_LINE` environment variable and generates completions based on the current state of the command line input. You can now use any logging function you want, for simplicity use `console.log`.\n\n## Example Usage:\n\nSee a simple example [here](/example/tabman-usage/).\n\n## To-dos:\n\n- [ ] Completions for `bash` and `pwsh`, maybe `nushell` too.\n- [ ] An inbuilt logging function.\n- [ ] A better algorithm to automatically detect argument type.\n\n## Why \"Tabman\"?\n\nNo deep meaning here - just some letter-swapping fun: tab → bat → Batman = **Tabman**.\n\n## Contribution Guidelines:\n\nThank you for considering contributing to **Tabman**! I welcome contributions from anyone who wants to improve the project. You are also welcome to contribute by writing new features and reporting any issues you may find.\n\nIf you discover a security vulnerability, please do not disclose it publicly. Instead, please email the details to me privately at `\u003caretrosen AT proton DOT me\u003e`. Your help in keeping `Tabman` secure is greatly appreciated!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faretrosen%2Ftabman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faretrosen%2Ftabman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faretrosen%2Ftabman/lists"}