Seed is a CLI tool that helps you quickly create directory structures from a tree representation. Whether you have a tree structure in your clipboard or a file, Seed can instantly "grow" it into a real directory structure.
brew install jpwallace22/seed/seed
go install github.com/jpwallace22/seed@latest
Available for Debian/Ubuntu, RHEL/Fedora, and Arch Linux distributions.
sudo apt install ./seed_*.deb
# or
sudo dpkg -i seed_*.deb
sudo rpm -i seed_*.rpm
sudo pacman -U seed_*.pkg.tar.zst
Download the latest release for Windows from the releases page.
For other platforms or manual installation:
- Download the appropriate binary for your system from the releases page
- Extract the archive if necessary
- Move the binary to a location in your PATH (e.g.,
/usr/local/bin
on Unix-like systems) - Verify the installation:
seed --version
git clone https://github.com/jpwallace22/seed.git
cd seed
go install
Note
Each release includes a checksums.txt
file for verifying the integrity of your download.
Seed can create directory structures in two ways:
seed -c
# or
seed --clipboard
This will read a tree structure from your clipboard and create the corresponding directories and files.
seed "my-react-app
βββ src
β βββ components
β βββ hooks
β βββ utils
β βββ App.tsx
βββ public
β βββ index.html
βββ package.json"
seed -f path/to/file
# or
seed --file path/to/file
Seed accepts tree structures in the common tree command format. For example:
my-project
βββ src
β βββ components
β β βββ Button.tsx
β β βββ Card.tsx
β βββ utils
β β βββ helpers.ts
β βββ App.tsx
βββ public
β βββ index.html
βββ package.json
Note
Only 4 spaces is supported at this time
my-project
src
components
Button.tsx
Card.tsx
utils
helpers.ts
App.tsx
public
index.html
package.json
You can generate this format using:
- The
tree
command in Unix-like systems - VS Code extensions like "File Tree Generator"
- Manually create it following the format above
- Or commonly generated with AI text gen tools
Seed also accepts JSON input that describes the directory structure. The JSON format should be an array containing directory/file objects and an optional report object:
[
{
"type": "directory",
"name": "my-project",
"contents": [
{
"type": "directory",
"name": "src",
"contents": [
{
"type": "file",
"name": "main.go"
},
{
"type": "directory",
"name": "utils",
"contents": [
{
"type": "file",
"name": "helper.go"
}
]
}
]
}
]
},
{
"type": "report",
"directories": 3,
"files": 2
}
]
Each object in the structure must have:
type
: Either "directory" or "file"name
: The name of the directory or filecontents
: (Optional) An array of nested files and directories (only valid for directory type)
The report object is optional and contains:
directories
: Total number of directoriesfiles
: Total number of files
Seed with throw if the report does not match what was created.
Example usage with JSON:
As string
seed -F json '{"type":"directory","name":"project","contents":[{"type":"file","name":"README.md"}]}'
# or
seed --format json '{"type":"directory","name":"project","contents":[{"type":"file","name":"README.md"}]}'
From clipboard
seed -F json -c
# or
seed --format json -c
From file
Note
Soon the filetype will be auto selected
seed -F json -f path/to/structure.json
# or
seed --format json -f path/to/structure.json
- π Super Fast directory structure creation
- π Direct clipboard support
- π² Supports standard tree format
- ποΈ Supports JSON format
- π Creates both files and directories
Seed is built with performance in mind. Here's a quick look at our parser performance:
Parser Type | Nodes | Time/Operation | Allocations/Operation | Memory/Operation |
---|---|---|---|---|
ASCII Tree | 100 | ~3.7ms | 46 | ~14KB |
ASCII Tree | 1000 | ~13.5ms | 76 | ~16KB |
ASCII Tree | 5000 | ~76ms | 654 | ~54KB |
JSON | 100 | ~3.8ms | 46 | ~14KB |
JSON | 1000 | ~14.1ms | 78 | ~16KB |
JSON | 5000 | ~79ms | 697 | ~56KB |
- Time and memory complexity are linear
- For detailed benchmarks, methodology, and historical data, see the benchmark documentation.
Run benchmarks locally:
make benchmark:new # Standard benchmarks
make benchmark:report # Compare against last benchmarks
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
-
Implement ability to parse from file path -
Add JSON support -
Benchmarks -
man page (before heavy distro to linux) -
Increase package manager distribution -
Support StdIn
-
Add YAML support
-
flag to adjust spacing between 2 and 4 for people who write their own trees with just spaces
This project is licensed under the MIT License - see the LICENSE file for details.
Justin Wallace (@jpwallace22)
- Inspired by the Unix
tree
command - Built with Cobra