StructTool is a command-line tool that saves and recreates folder structures.
It can be used as a lightweight project template manager, allowing you to:
- Save folder structures
- Recreate structures later
- Store multiple versions
- Save file contents (optional)
- Organize templates using tags
- Search templates by tag
- Display structure trees
- Store templates as JSON or TXT
- Quick Start
- Quick Usage
- Features
- Installation
- Initialize a Project
- Commands
- Load a Structure
- List Structures
- Remove a Structure
- Show Version History
- Search by Tag
- Tree View
- Versioning
- Storage Location
- Structure Layout
- JSON Structure Format
- Roadmap
- Development
- Command Table
- License
✅ Save folder structures
✅ Recreate structures
✅ JSON and TXT formats
✅ Optional file content storage
✅ Structure versioning
✅ Tags and categories
✅ Search by tag
✅ Tree visualization
✅ Ignore files and folders
✅ Cross-platform support
# Initialize configuration files
structtool init
# Save a structure
structtool save website .
# Show saved structures
structtool list
# Recreate a structure
structtool load website ./NewProjectStructTool can be invoked using either:
structtool(full command)strt(short alias)
Examples:
structtool init
strt init
structtool save website .
strt save website .Clone the repository:
git clone https://github.com/Chikine/Folder-Structure-Tool
cd structtoolInstall locally:
pip install .Verify installation:
structtool --helpBefore saving structures, initialize StructTool in your project:
structtool initThis creates two configuration files:
.structignore
.structtool.json
Defines files and folders that should not be saved.
Example:
# Node.js
node_modules
dist
# Python
__pycache__
*.pyc
# Git
.git
# IDE
.vscode
.idea
These patterns are automatically applied when running:
structtool save website .Stores default StructTool settings.
Example:
{
"default_format": "json",
"include_content": false,
"ignore_file": ".structignore",
"default_tags": [],
"max_content_size_kb": 100
}This allows structtool save to reuse project settings without repeatedly specifying command-line options.
If configuration files already exist, StructTool will preserve them:
structtool initTo overwrite existing files:
structtool init --force# Initialize configuration
structtool init
# Save the current project
structtool save website .
# Show available structures
structtool list
# Load the structure elsewhere
structtool load website ./NewProjectSave a folder structure:
structtool save website .structtool save website . --format jsonstructtool save website . --format txtBy default only folder/file names are stored.
To save file contents:
structtool save website . --include-contentExample:
structtool save react-app . \
--format json \
--include-contentIgnore specific paths while saving:
structtool save website . \
--ignore node_modules .git distExample:
structtool save website . \
--ignore node_modules .git __pycache__Attach tags to structures:
structtool save react-app . \
--tags react frontend viteMetadata example:
{
"name": "react-app",
"tags": [
"react",
"frontend",
"vite"
],
"latest_version": 1
}Load the latest version of a structure:
structtool load website ./NewProjectResult:
NewProject/
├── src/
├── public/
└── package.json
Display all saved structures:
structtool listExample:
react-app
website
api-server
Delete a structure and all versions:
structtool remove websiteDisplay saved versions:
structtool history websiteExample:
v1.json
v2.json
v3.json
Search structures using tags:
structtool search reactExample:
react-app
react-dashboard
react-admin
Display a saved structure:
structtool show websiteExample:
src
├── components
├── pages
├── App.jsx
└── main.jsx
public
└── favicon.ico
Each save creates a new version automatically.
Example:
structtool save website .Creates:
v1.json
Saving again:
structtool save website .Creates:
v2.json
Saving again:
structtool save website .Creates:
v3.json
Latest version is automatically used when loading.
C:\Users\<username>\.structtool\structures
~/.structtool/structures
~/.structtool/structures
Example:
.structtool/
└── structures/
└── website/
├── metadata.json
├── v1.json
├── v2.json
└── v3.txt
Metadata:
{
"name": "website",
"tags": [
"frontend",
"react"
],
"latest_version": 3
}Example:
{
"format": "json",
"include_content": true,
"items": [
{
"type": "dir",
"path": "src"
},
{
"type": "file",
"path": "src/App.jsx",
"content": "export default function App() {}"
}
]
}Planned features:
- Export structures
- Import structures
- Structure diff
- Structure validation
- Remote template repositories
- .structignore support
- Interactive project wizard
- Better tree rendering
Run from source:
python -m structtool.cliInstall editable version:
pip install -e .| Command | Description |
|---|---|
structtool init |
Create .structignore and .structtool.json |
structtool save |
Save a folder structure |
structtool load |
Recreate a structure |
structtool list |
Show saved structures |
structtool history |
Show version history |
structtool show |
Display structure tree |
structtool search |
Search by tags |
structtool remove |
Delete a structure |
MIT License