{"id":31206352,"url":"https://github.com/itsjustmechris/type-picker","last_synced_at":"2026-05-03T20:34:46.959Z","repository":{"id":315478721,"uuid":"1059681967","full_name":"ItsJustMeChris/type-picker","owner":"ItsJustMeChris","description":"TypeScript cli utility to give LLM agents (claude code, openai codex) editor / tsserver level 'hover' insights. ","archived":false,"fork":false,"pushed_at":"2025-09-18T19:47:45.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T22:10:39.260Z","etag":null,"topics":["claude","claude-code","code","codex","openai","openai-codex","picker","script","type","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ItsJustMeChris.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-18T19:34:38.000Z","updated_at":"2025-09-18T19:47:48.000Z","dependencies_parsed_at":"2025-09-18T22:11:53.739Z","dependency_job_id":null,"html_url":"https://github.com/ItsJustMeChris/type-picker","commit_stats":null,"previous_names":["itsjustmechris/type-picker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ItsJustMeChris/type-picker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJustMeChris%2Ftype-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJustMeChris%2Ftype-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJustMeChris%2Ftype-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJustMeChris%2Ftype-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsJustMeChris","download_url":"https://codeload.github.com/ItsJustMeChris/type-picker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJustMeChris%2Ftype-picker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32584170,"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":["claude","claude-code","code","codex","openai","openai-codex","picker","script","type","typescript"],"created_at":"2025-09-20T19:45:58.329Z","updated_at":"2026-05-03T20:34:46.908Z","avatar_url":"https://github.com/ItsJustMeChris.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type Picker CLI\n\nA Bun-powered command line tool that asks the TypeScript compiler for ground-truth types. Designed to plug real compiler knowledge into LLM or automation workflows so they stop hallucinating imports, definitions, and module shapes.\n\n## Features\n- Query the type at any file location using line/column or a regex match.\n- Outputs rich JSON including type strings, symbol metadata, signatures, property summaries, declaration snippets, and project-wide diagnostics.\n- Points at diagnostics from the TypeScript compiler so AI agents can gracefully degrade when the program does not type-check.\n- Fast to invoke from other tooling thanks to Bun + pure TypeScript implementation (no editor or IDE dependencies).\n\n## Installation Script\nUse the helper script to link `tsp` onto your PATH (defaults to `~/.local/bin`):\n\n```bash\n./scripts/tsp-manage.sh install\n```\n\nUpdate or remove the link later: as `./scripts/tsp-manage.sh update` or `./scripts/tsp-manage.sh uninstall`.\n\nSet `TSP_INSTALL_PATH` to override the exact destination, or `TSP_INSTALL_DIR` to change just the parent directory.\n`./scripts/tsp-manage.sh` will try to append the path export to your detected shell (zsh/bash) automatically; set `TSP_SKIP_PATH_UPDATE=1` to skip.\n\n## Getting Started\nInstall dependencies (Bun will also generate the lockfile):\n\n```bash\nbun install\n```\n\nBuild the distributable JavaScript and declaration files:\n\n```bash\nbun run build\n```\n\nYou can run the compiled CLI directly with Node or Bun:\n\n```bash\nnode dist/cli.js path/to/file.ts --line 10 --column 5\n# or\nbun run dist/cli.js -- path/to/file.ts --regex \"loadUsers\"\n```\n\n## CLI Usage\n```\ntsp \u003cfile\u003e (--line \u003cn\u003e --column \u003cn\u003e | --regex \u003cpattern\u003e) [options]\n```\n\n| Option | Description |\n| --- | --- |\n| `--line \u003cn\u003e` / `--column \u003cn\u003e` | 1-based location of the node to inspect |\n| `--regex \u003cpattern\u003e` | Regex used to locate the first match in the file (uses global matching by default) |\n| `--regex-flags \u003cflags\u003e` | Custom flags for the regex search |\n| `--index \u003cn\u003e` | Zero-based index of the regex match to inspect |\n| `--project \u003cpath\u003e` | Path to a `tsconfig.json` or a project directory to load compiler options |\n| `--pretty` / `--compact` | Control JSON formatting (pretty is enabled by default) |\n| `--omit-diagnostics` | Drop diagnostic messages from the output |\n| `--omit-properties` | Drop the property summary table |\n| `--omit-signatures` | Drop call / construct signature details |\n| `--omit-project-diagnostics` | Drop project-wide diagnostics aggregated across the build graph |\n| `--version` | Print the package version |\n| `--help` | Display the usage summary |\n\n### Example\n```bash\nnode dist/cli.js examples/sample.ts --line 15 --column 9 --omit-properties --omit-diagnostics\n```\nProduces (truncated) JSON:\n\n```json\n{\n  \"file\": \"/path/to/examples/sample.ts\",\n  \"position\": { \"line\": 15, \"column\": 9, \"offset\": 288 },\n  \"matchedText\": \"users\",\n  \"nodeKind\": \"Identifier\",\n  \"typeString\": \"User[]\",\n  \"symbol\": {\n    \"name\": \"users\",\n    \"flags\": { \"flags\": 2, \"names\": [\"BlockScopedVariable\"] }\n  }\n  // …additional metadata omitted…\n}\n```\n\n## Automating With LLMs\n- Store the CLI on your `$PATH` (e.g. `npm install -g` in a future package, or symlink `dist/cli.js`).\n- Have the agent call `tsp` before emitting completions that need accurate types.\n- Inspect `diagnostics` to short-circuit when the program cannot be compiled yet.\n- Trim the JSON payload or disable sections with `--omit-*` flags to keep prompts small.\n\n## Development\n- Run `bun run typecheck` while iterating to stay within TypeScript’s strict mode.\n- Use `bun run dev -- \u003cargs\u003e` to invoke the CLI directly from source with Bun’s transpiler.\n- Rebuild with `bun run build` before packaging or committing compiled artifacts.\n\n## Roadmap Ideas\n- Keep a persistent `tsserver` process warm for faster repeated queries.\n- Generalize the transport so non-TypeScript LSP servers can plug in.\n- Add a streaming mode that yields minimal JSON for token-by-token prompting.\n\n---\nThis project started as an experiment to make AI-assisted coding feel like using a real IDE—feedback and contributions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjustmechris%2Ftype-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsjustmechris%2Ftype-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjustmechris%2Ftype-picker/lists"}