Skip to content

Commit 28e3527

Browse files
committed
added readme content and biome setup
1 parent 7e02845 commit 28e3527

4 files changed

Lines changed: 171 additions & 6 deletions

File tree

README.md

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,111 @@
11
# TreeEx
22

3-
CLI tool that analyzes directory structure and outputs a JSON tree
3+
A CLI tool that analyzes directory structures and outputs them as JSON. Built with Bun and TypeScript.
4+
5+
## Why TreeEx?
6+
7+
Sometimes you just need a quick way to get a directory's structure as JSON - maybe for documentation, feeding into an LLM, or just understanding a codebase. TreeEx does exactly that, with sensible defaults and cross-platform support.
8+
9+
## Installation
10+
11+
### From source
12+
13+
Requirements:
14+
- Bun
15+
- Git
16+
17+
```bash
18+
git clone https://github.com/pratikdev/treeex.git
19+
cd treeex
20+
bun install
21+
```
22+
23+
## Building
24+
25+
```bash
26+
# Build for current platform
27+
bun run build
28+
29+
# Check [package.json](./package.json) for more options
30+
```
31+
32+
This produces a standalone binary in the `build/` directory for your OS
33+
34+
## Usage
35+
36+
```bash
37+
# cd into the build directory
38+
cd build
39+
40+
# Analyze current directory (`/build` directory will be empty though)
41+
treeEx
42+
43+
# Analyze a specific path
44+
treeEx ../src
45+
46+
# Limit depth
47+
treeEx --depth 3
48+
49+
# Unlimited depth
50+
treeEx --depth inf
51+
52+
# Ignore additional patterns
53+
treeEx -i "*.log" -i "*.tmp"
54+
55+
# Include everything (disable default ignores)
56+
treeEx --no-default-ignore
57+
```
58+
59+
## Output Format
60+
61+
TreeEx outputs a JSON tree structure:
62+
63+
```json
64+
{
65+
"name": "root",
66+
"type": "directory",
67+
"children": [
68+
{
69+
"name": "src",
70+
"type": "directory",
71+
"children": [
72+
{
73+
"name": "index.ts",
74+
"type": "file",
75+
"children": []
76+
}
77+
]
78+
},
79+
{
80+
"name": "package.json",
81+
"type": "file",
82+
"children": []
83+
}
84+
]
85+
}
86+
```
87+
88+
## Default Ignore Patterns
89+
90+
By default, TreeEx ignores common noise directories and files:
91+
92+
- `.git`, `.svn`, `.hg`, `.CVS`
93+
- `node_modules`, `vendor`
94+
- `build`, `dist`, `out`
95+
- `.vscode`, `.DS_Store`
96+
97+
Use `--no-default-ignore` to include everything.
98+
99+
## Options
100+
101+
| Option | Description |
102+
|--------|-------------|
103+
| `-d, --depth <level>` | Maximum depth level (default: 20, use "inf" for unlimited) |
104+
| `-i, --ignore <pattern>` | Glob pattern to ignore (can be used multiple times) |
105+
| `--no-default-ignore` | Disable default ignore patterns |
106+
| `-v, --version` | Show version |
107+
| `-h, --help` | Show help |
108+
109+
## License
110+
111+
MIT

biome.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "tab"
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"recommended": true
19+
}
20+
},
21+
"javascript": {
22+
"formatter": {
23+
"quoteStyle": "double"
24+
}
25+
},
26+
"assist": {
27+
"enabled": true,
28+
"actions": {
29+
"source": {
30+
"organizeImports": "on"
31+
}
32+
}
33+
}
34+
}

bun.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@
1616
"build:windows": "bun build index.ts --compile --target=bun-windows-x64 --outfile build/treeEx-windows-x64.exe",
1717
"build:all": "bun run build:linux && bun run build:macos && bun run build:macos-arm && bun run build:windows",
1818
"build:clean": "rm -rf build/",
19-
"typecheck": "tsc --noEmit"
19+
"typecheck": "tsc --noEmit",
20+
"lint": "biome lint .",
21+
"format": "biome format . --write",
22+
"check": "biome check ."
2023
},
2124
"devDependencies": {
25+
"@biomejs/biome": "^2.3.10",
2226
"@types/bun": "latest"
2327
},
28+
"dependencies": {
29+
"commander": "^14.0.2"
30+
},
2431
"peerDependencies": {
2532
"typescript": "^5"
2633
},
@@ -33,8 +40,5 @@
3340
"tool"
3441
],
3542
"author": "Pratik Dev",
36-
"license": "MIT",
37-
"dependencies": {
38-
"commander": "^14.0.2"
39-
}
43+
"license": "MIT"
4044
}

0 commit comments

Comments
 (0)