Sruja is a next-generation architecture-as-code language with first-class support for requirements, ADRs, and extensible validation.
⚠️ Alpha Release (v0.1.0): Sruja is under active development. APIs may change. See ROADMAP.md for the path to v1.0.0.
- 🎯 Architecture DSL: Define systems, containers, components, and relations
- ✅ Validation Engine: Cycle detection, orphan detection, unique IDs, valid references
- 📊 D2 Export: Export to D2 diagrams for rendering
- 🎨 Code Formatter: Auto-format your architecture with
sruja fmt - 🌳 Tree View: Visualize hierarchy with
sruja tree
sruja/
├── cmd/
│ └── sruja/ # Main CLI tool
├── pkg/ # Shared Go packages
│ ├── engine/ # Validation engine
│ ├── language/ # Parser, AST, lexer
│ └── export/ # Exporters (D2, etc.)
└── examples/ # Example .sruja files
curl -fsSL https://raw.githubusercontent.com/sruja-ai/sruja/main/scripts/install.sh | bashDownload the latest release from GitHub Releases.
go install github.com/sruja-ai/sruja/cmd/sruja@latestCreate example.sruja:
architecture "My System" {
system App "My App" {
container Web "Web Server"
datastore DB "Database"
}
person User "User"
User -> Web "Visits"
Web -> DB "Reads/Writes"
}
Export to D2:
sruja export d2 example.srujaLint your code:
sruja lint example.srujaFormat your code:
sruja fmt example.srujaView hierarchy:
sruja tree --file example.sruja- Go 1.25+
# Install dependencies
go mod download
# Setup git hooks (recommended)
make setup-hooks
# Build CLI
make buildA pre-commit hook automatically tests code compilation when you commit changes to the learn/ directory. This prevents broken code from being committed.
Setup:
make setup-hooksThe hook will:
- Test playground examples compile correctly
- Test course code blocks compile correctly
- Test docs code blocks compile correctly
- Block commits if any code fails to compile
See docs/DEVELOPMENT.md for more details.
We welcome contributions of all sizes — from small doc fixes to core features.
- Start with issues and "good first issues":
good first issue
Good for newcomers - Read the contribution guide
- Run local checks:
make test,make fmt,make lint - Add/update tests for new behavior
- Keep changes focused and well‑scoped
- Use Conventional Commits (e.g.,
feat: …,fix: …,docs: …)
MIT