{"id":25220501,"url":"https://github.com/sina-byn/ink-tree-select","last_synced_at":"2026-02-27T09:11:38.263Z","repository":{"id":275751296,"uuid":"927074750","full_name":"sina-byn/ink-tree-select","owner":"sina-byn","description":"Directory tree select component for ink","archived":false,"fork":false,"pushed_at":"2025-04-03T08:29:28.000Z","size":382,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T16:54:01.457Z","etag":null,"topics":["cli","directory-traversal","directory-tree","directory-tree-generator","ink","javascript","nodejs","react","terminal","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ink-tree-select","language":"TypeScript","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/sina-byn.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":"2025-02-04T11:09:34.000Z","updated_at":"2025-11-20T13:11:37.000Z","dependencies_parsed_at":"2025-02-04T12:35:57.937Z","dependency_job_id":null,"html_url":"https://github.com/sina-byn/ink-tree-select","commit_stats":null,"previous_names":["sina-byn/ink-tree-select"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sina-byn/ink-tree-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sina-byn%2Fink-tree-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sina-byn%2Fink-tree-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sina-byn%2Fink-tree-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sina-byn%2Fink-tree-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sina-byn","download_url":"https://codeload.github.com/sina-byn/ink-tree-select/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sina-byn%2Fink-tree-select/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29889055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T08:34:21.514Z","status":"ssl_error","status_checked_at":"2026-02-27T08:32:38.035Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cli","directory-traversal","directory-tree","directory-tree-generator","ink","javascript","nodejs","react","terminal","typescript"],"created_at":"2025-02-10T21:53:52.364Z","updated_at":"2026-02-27T09:11:38.247Z","avatar_url":"https://github.com/sina-byn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ink-tree-select [![NPM version](https://img.shields.io/npm/v/ink-tree-select.svg?style=flat)](https://www.npmjs.com/package/ink-tree-select) [![NPM monthly downloads](https://img.shields.io/npm/dm/ink-tree-select.svg?style=flat)](https://npmjs.org/package/ink-tree-select) [![NPM total downloads](https://img.shields.io/npm/dt/ink-tree-select.svg?style=flat)](https://npmjs.org/package/ink-tree-select)\n\nTree select component built for [ink](https://www.npmjs.com/package/ink)\n\nPlease consider following this project's author, [Sina Bayandorian](https://github.com/sina-byn), and consider starring the project to show your :heart: and support.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Components](#components)\n  - [TreeSelect](#treeselect-)\n  - [VirtualTreeSelect](#virtualtreeselect-)\n\n![Demo GIF](assets/demo.gif)\n\n## Installation\n\n```shell\nnpm i ink-tree-select\n```\n\n## Usage\n\n```js\n// * index.tsx\n// * visit the components section if you need further customization\n\nimport { render, Text } from 'ink';\nimport React, { useState } from 'react';\nimport { TreeSelect } from 'ink-tree-select';\n\nconst App = () =\u003e {\n  const [selectedPath, setSelectedPath] = useState\u003cstring\u003e('');\n  const selectHandler = (path: string) =\u003e setSelectedPath(path);\n\n  return (\n    \u003c\u003e\n      \u003cTreeSelect root='./' onSelect={selectHandler} /\u003e\n      {selectedPath.length \u003e 0 \u0026\u0026 \u003cText\u003e{selectedPath}\u003c/Text\u003e}\n    \u003c/\u003e\n  );\n};\n\nrender(\u003cApp /\u003e);\n```\n\n## Components\n\n### `\u003cTreeSelect /\u003e`\n\n|          |                    Type                     | Default |              Description               |\n|----------|---------------------------------------------|---------|----------------------------------------|\n|   root   |                   string                    |         |         Root directory to scan         |\n| onChange |       `(activePath: string) =\u003e void;`       |         | Triggers on every selected path change |\n| onSelect |      `(selectedPath: string) =\u003e void;`      |         |    Triggers once user hits `Enter`     |\n| options  |            `TreeSelectOptions`              |  `{ }`  |                                        |\n\n#### TreeSelectOptions\n\n```ts\ntype TreeSelectOptions = Partial\u003c{\n  // * directories to ignore - read https://www.npmjs.com/package/fast-glob#ignore\n  ignore: string[];\n  rootAlias: string; // default to '.' - tree's root\n  previewColor: Color; // path preview text color\n  indicatorColor: Color; // ● color\n}\u003e;\n```\n\n### `\u003cVirtualTreeSelect /\u003e`\n\nAccepts a custom tree instead of a directory to scan\n\n|          |                    Type                     | Default |              Description               |\n|----------|---------------------------------------------|---------|----------------------------------------|\n|   tree   |                   `Tree`                    |         |         Custom directory tree          |\n| onChange |       `(activePath: string) =\u003e void;`       |         | Triggers on every selected path change |\n| onSelect |      `(selectedPath: string) =\u003e void;`      |         |    Triggers once user hits `Enter`     |\n| options  |         `VirtualTreeSelectOptions`          |  `{ }`  |                                        |\n\n#### Tree\n\n```ts\ntype Tree = { name: string; fullPath: string; branches: Tree[]; dir?: boolean };\n```\n\n#### VirtualTreeSelectOptions\n\n```ts\ntype VirtualTreeSelectOptions = Partial\u003c{\n  previewColor: Color; // path preview text color\n  indicatorColor: Color; // ● color\n}\u003e;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsina-byn%2Fink-tree-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsina-byn%2Fink-tree-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsina-byn%2Fink-tree-select/lists"}