File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,63 @@ node dist/cli.js --root . --infer-root --gitkeep --from tree.txt
5050cat tree.txt | node dist/cli.js --root . --infer-root
5151```
5252
53+ ### Run modes
54+
55+ #### 1) Global (installed from npm)
56+
57+ After ` npm i -g structforge ` :
58+
59+ ``` bash
60+ # Linux/macOS
61+ structforge --root /tmp/out --infer-root --from ./tree.txt
62+ # or piping inline text
63+ cat << 'EOF ' | structforge --root /tmp/out --infer-root --verbose
64+ my-app/
65+ src/
66+ index.ts
67+ package.json
68+ EOF
69+ ```
70+
71+ ``` powershell
72+ # Windows PowerShell
73+ structforge --root "D:\out" --infer-root --from .\tree.txt
74+ @"
75+ my-app/
76+ src/
77+ index.ts
78+ package.json
79+ "@ | structforge --root "D:\out" --infer-root --verbose
80+ ```
81+
82+ #### 2) Local (using the built dist of this repo)
83+
84+ ``` bash
85+ pnpm i && pnpm build
86+ node dist/cli.js --root /tmp/out --infer-root --from ./tree.txt
87+ # or
88+ cat tree.txt | node dist/cli.js --root /tmp/out --infer-root
89+ ```
90+
91+ #### 3) Dev (ts-node, without building)
92+
93+ ``` bash
94+ pnpm i
95+ pnpm dev -- --root /tmp/out --infer-root --from ./tree.txt
96+ # or
97+ cat tree.txt | pnpm dev -- --root /tmp/out --infer-root
98+ ```
99+
100+ Tips:
101+
102+ * Preview first:
103+
104+ ``` bash
105+ structforge --root /tmp/out --infer-root --dry-run --from ./tree.txt
106+ ```
107+ * Create placeholders for empty dirs: add ` --gitkeep ` .
108+ * Increase logs: add ` --verbose ` .
109+
53110### Input rules (read carefully)
54111
55112* ** Do not add comments or annotations** in the structure. Only list directories and files.
You can’t perform that action at this time.
0 commit comments