Anstruct - AI-Powered Project Structure Manager

Anstruct is a powerful CLI tool that revolutionizes project structure management using AI. Generate, reverse-engineer, normalize, and sync project structures with simple commands.
# Generate a project from natural language
anstruct aistruct "golang REST API with PostgreSQL" --apply -o ./my-api
# Reverse engineer existing project
anstruct rstruct ./my-project -o project.struct
# Watch and sync in real-time
anstruct watch ./my-app ./my-app.struct --full
Features
- AI-Powered Generation - Create project structures from natural language
- Blueprint System - Define structures in simple
.struct format
- Reverse Engineering - Convert existing projects to blueprints
- Format Normalization - Convert any structure format (tree, ls, markdown) to
.struct
- Real-time Sync - Watch and sync project ↔ blueprint bidirectionally
- History Management - Undo/redo operations with full tracking
- Fast & Efficient - Written in Go for maximum performance
Installation
Prerequisites
Option 1: Using Go Install (Recommended)
go install github.com/alberdjuniawan/anstruct/cmd/anstruct@latest
This will automatically:
- Download and install the latest version
- Place the binary in your Go bin directory
- Work on Windows, Linux, and macOS
Verify installation:
anstruct --version
Note: If anstruct command is not recognized, ensure your Go bin directory is in PATH and restart your terminal.
Adding Go bin to PATH
Linux/macOS (bash)
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.bashrc
source ~/.bashrc
Linux/macOS (zsh)
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc
source ~/.zshrc
Windows (PowerShell - Run as Administrator)
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\go\bin", "User")
Then restart your terminal.
Option 2: From Source
-
Clone the repository
git clone https://github.com/alberdjuniawan/anstruct.git
cd anstruct
-
Build the binary
Linux/macOS:
go build -o anstruct ./cmd/anstruct
Windows (PowerShell):
go build -o anstruct.exe ./cmd/anstruct
-
Install globally (optional)
go install ./cmd/anstruct
Usage after local build:
# Linux/macOS
./anstruct --version
# Windows (PowerShell)
.\anstruct.exe --version
Quick Start
1. Generate from AI Prompt
# Generate blueprint file
anstruct aistruct "nodejs express api with auth" -o api.struct
# Generate project directly
anstruct aistruct "react dashboard with routing" --apply -o ./dashboard
2. Create from Blueprint
# Create myapp.struct
cat > myapp.struct << 'EOF'
myapp/
src/
main.go
routes/
api.go
config/
app.yaml
Dockerfile
README.md
EOF
# Generate project
anstruct mstruct myapp.struct -o ./output
3. Reverse Engineer Project
# Convert project to blueprint
anstruct rstruct ./my-existing-app -o app.struct
4. Watch & Sync
# Two-way sync
anstruct watch ./myapp ./myapp.struct --full
# One-way: blueprint → folder
anstruct watch ./myapp ./myapp.struct --half struct
# One-way: folder → blueprint
anstruct watch ./myapp ./myapp.struct --half folder
Documentation
You can find full guides and references in the Documentation file. It covers everything from basic usage to advanced features — including CLI commands, structure syntax, and AI integration.
Contributing
Contributions are welcome. If you'd like to suggest improvements, fix bugs, or enhance features, please see the Contributing Guide for details.
License
MIT License - see LICENSE file for details.
Acknowledgments
Support