read.tre polygonstew
Use this command to install read.tre:
winget install --id=polygonstew.read.tre -e Bidirectional CLI for the .tre format.
winget install --id=polygonstew.read.tre -e Bidirectional CLI for the .tre format.
Grab the latest tre.exe from releases, drop it in a folder on PATH.
Bidirectional CLI for the .tre format. Companion to my create.tre VS Code extension.(in dev)
OR
scoop install https://raw.githubusercontent.com/polygonstew/read.tre/main/read.tre.json
winget install polygonstew.read.tre <1.0.3 in review>
tre . # current dir -> .tre
tre # that folder -> .tre
tre # build folder structure from a .tre
tre --hidden # include hidden folders (.git, .vscode, etc)
tre -h # help
The reverse mode also reads Windows tree /F /A output, so this works:
tree /F /A > sample.txt
tre sample.txt
Simple 2-space indent. Folders end with /. Files don't.
demo/
readme.md
src/
main.py
utils/
helper.py
tests/
test_main.py
If you redirect tree /F through PowerShell's >, older versions write UTF-16 without a BOM and the parser misreads it. Workaround:
tree /F /A | Out-File -Encoding utf8 sample.txt
cmd's > writes ANSI/UTF-8 and works fine.
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true
Drop the exe somewhere on PATH (C:\tools\ works) and call it from any terminal.