Skip to content

Commit b1214c4

Browse files
committed
fixing README.md
1 parent 7132373 commit b1214c4

File tree

3 files changed

+85
-9
lines changed

3 files changed

+85
-9
lines changed

.github/workflows/cd.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
steps:
3131
- name: Checkout Code
3232
uses: actions/checkout@v5
33+
with:
34+
fetch-depth: 0 # Need full history for git bundle
3335

3436
- name: Set up Python
3537
uses: actions/setup-python@v6
@@ -45,8 +47,9 @@ jobs:
4547
fi
4648
4749
- name: Set version in version.py
50+
env:
51+
VERSION: ${{ github.event.inputs.version }}
4852
run: |
49-
VERSION="${{ github.event.inputs.version }}"
5053
echo "Setting version to $VERSION"
5154
python - <<'PY'
5255
import os, re, pathlib
@@ -248,6 +251,9 @@ jobs:
248251
run: |
249252
git clone repo.bundle repo
250253
cd repo
254+
git checkout main
255+
echo "Current branch: $(git branch --show-current)"
256+
echo "Current commit: $(git rev-parse HEAD)"
251257
252258
- name: Push commit and tag to main
253259
working-directory: ./repo

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ pylint-report.txt
270270
# ==============================================================================
271271
# PyInstaller builds
272272
*.spec.bak
273-
treemapper
274-
treemapper.exe
273+
/treemapper
274+
/treemapper.exe
275275

276276
# GitHub release artifacts
277277
release-notes.md

README.md

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TreeMapper
22

3-
A tool for converting directory structures to YAML format, designed for use with Large Language Models (LLMs).
4-
TreeMapper maps your entire codebase into a structured YAML file, making it easy to analyze code, document projects, and
3+
A tool for converting directory structures to structured formats (YAML, JSON, or text), designed for use with Large Language Models (LLMs).
4+
TreeMapper maps your entire codebase into a structured file, making it easy to analyze code, document projects, and
55
work with AI tools.
66

77
[![Build Status](https://img.shields.io/github/actions/workflow/status/nikolay-e/TreeMapper/ci.yml)](https://github.com/nikolay-e/TreeMapper/actions)
@@ -18,10 +18,10 @@ pip install treemapper
1818

1919
## Usage
2020

21-
Generate a YAML tree of a directory:
21+
Generate a structured representation of a directory:
2222

2323
```bash
24-
# Map current directory to stdout
24+
# Map current directory to stdout (YAML format)
2525
treemapper .
2626

2727
# Map specific directory to stdout
@@ -33,11 +33,29 @@ treemapper . -o my-tree.yaml
3333
# Use "-" to explicitly output to stdout
3434
treemapper . -o -
3535

36+
# Output in JSON format
37+
treemapper . --format json
38+
39+
# Output in plain text format
40+
treemapper . --format text -o output.txt
41+
42+
# Limit directory traversal depth
43+
treemapper . --max-depth 3
44+
45+
# Skip file contents (structure only)
46+
treemapper . --no-content
47+
48+
# Limit file size for content reading
49+
treemapper . --max-file-bytes 10000
50+
3651
# Custom ignore patterns
3752
treemapper . -i ignore.txt
3853

3954
# Disable all default ignores
4055
treemapper . --no-default-ignores
56+
57+
# Combine multiple options
58+
treemapper . -o tree.json --format json --max-depth 5 --max-file-bytes 50000
4159
```
4260

4361
### Options
@@ -49,10 +67,15 @@ Arguments:
4967
DIRECTORY Directory to analyze (default: current directory)
5068
5169
Options:
52-
-o, --output-file FILE Output YAML file (default: stdout)
70+
-o, --output-file PATH Output file (default: stdout)
5371
Use "-" to force stdout output
54-
-i, --ignore-file FILE Custom ignore patterns file
72+
--format {yaml,json,text} Output format (default: yaml)
73+
-i, --ignore-file PATH Custom ignore patterns file
5574
--no-default-ignores Disable all default ignores (.gitignore, .treemapperignore, etc.)
75+
--max-depth N Maximum depth to traverse (default: unlimited)
76+
--no-content Skip reading file contents (structure-only mode)
77+
--max-file-bytes N Maximum file size to read in bytes (default: unlimited)
78+
Larger files will show a placeholder
5679
-v, --verbosity [0-3] Logging verbosity (default: 0)
5780
0=ERROR, 1=WARNING, 2=INFO, 3=DEBUG
5881
--version Show version and exit
@@ -75,6 +98,7 @@ Use `--no-default-ignores` to disable all default ignores and only use patterns
7598

7699
### Example Output
77100

101+
**YAML format (default):**
78102
```yaml
79103
name: my-project
80104
type: directory
@@ -94,6 +118,52 @@ children:
94118
Documentation here...
95119
```
96120
121+
**JSON format (`--format json`):**
122+
```json
123+
{
124+
"name": "my-project",
125+
"type": "directory",
126+
"children": [
127+
{
128+
"name": "src",
129+
"type": "directory",
130+
"children": [
131+
{
132+
"name": "main.py",
133+
"type": "file",
134+
"content": "def main():\n print(\"Hello World\")\n"
135+
}
136+
]
137+
},
138+
{
139+
"name": "README.md",
140+
"type": "file",
141+
"content": "# My Project\nDocumentation here...\n"
142+
}
143+
]
144+
}
145+
```
146+
147+
**Text format (`--format text`):**
148+
```
149+
================================================================================
150+
Directory Tree: my-project
151+
================================================================================
152+
153+
src/ (directory)
154+
main.py (file)
155+
--- BEGIN CONTENT ---
156+
def main():
157+
print("Hello World")
158+
--- END CONTENT ---
159+
160+
README.md (file)
161+
--- BEGIN CONTENT ---
162+
# My Project
163+
Documentation here...
164+
--- END CONTENT ---
165+
```
166+
97167
## License
98168
99169
Apache License 2.0 - see [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)