chassis

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 1 Imported by: 0

README

Chassis

Build Release Go Version Go Report Card

A lightweight CLI tool to scaffold project directory structures from layout definition files.

Installation

From Source
go install github.com/pyzamo/chassis@latest
Pre-built Binaries

Download the latest release for your platform from the Releases page.

Commands

chassis analyze - Extract Templates with AI

Analyzes existing projects and uses Google Gemini AI to generate reusable scaffolding templates.

chassis analyze <source> [flags]

Arguments:

  • <source> - Local directory or GitHub repo URL

Flags:

  • --format string - Output format: tree, yaml, json (default: tree)
  • --max-depth int - Maximum depth to analyze (default: 5)

Examples:

# Analyze local project
chassis analyze ./my-app > template.txt

# Analyze GitHub repository
chassis analyze https://github.com/gin-gonic/gin > gin-template.txt
chassis build - Create Project Structure

Creates directory structure from a layout definition file.

chassis build <layout-file> [target-dir]

Arguments:

  • <layout-file> - Path to layout file (or - for stdin)
  • [target-dir] - Target directory (defaults to current directory)

Flags:

  • -v, --verbose - Print every path created/skipped
  • --indent int - Space width for plain-text parser (default: 2)

Layout Formats

Plain-Text Tree
project/
  src/
    main.py
    utils/
      helpers.py
      constants.py
  tests/
    test_main.py
  requirements.txt
  README.md
YAML

Use null for files, {} for empty directories

backend:
  cmd:
    server:
      main.go: null
  internal:
    handlers: {}
    models: {}
  go.mod: null
frontend:
  src:
    App.tsx: null
    index.tsx: null
  package.json: null
JSON
{
  "webapp": {
    "client": {
      "src": {
        "App.tsx": null,
        "index.tsx": null
      },
      "package.json": null
    },
    "server": {
      "main.js": null,
      "package.json": null
    }
  }
}

Quick Start

# 1. Set up Gemini API key (one-time, get free key at https://aistudio.google.com/app/apikey)
export GEMINI_API_KEY='your-key-here'

# 2. Analyze existing project to extract template
chassis analyze ./my-project > template.txt

# 3. Create new projects from template
chassis build template.txt ./new-project

Examples

Complete Workflow
# Extract template from an existing Express.js app
chassis analyze ./my-express-app > express-template.txt

# app/
#   # Core application files
#   server.js
#   app.js
#   # Route definitions
#   routes/
#     api.js
#   # Data models
#   models/
#     model.js
#   # Middleware functions
#   middleware/
#     auth.js
#   # Configuration
#   config/
#     config.js
#   package.json

# Create new projects from this template
chassis build express-template.txt project-1
Quick Examples

Go Microservice

api:
  cmd:
    server:
      main.go: null
  internal:
    handlers:
      auth.go: null
      user.go: null
    models:
      user.go: null
  go.mod: null
  Dockerfile: null
  README.md: null

Save as microservice.yaml and run:

chassis build microservice.yaml my-service

Python Package

{
  "my_package": {
    "src": {
      "my_package": {
        "__init__.py": null,
        "core.py": null,
        "utils.py": null
      }
    },
    "tests": {
      "test_core.py": null,
      "test_utils.py": null
    },
    "setup.py": null,
    "requirements.txt": null,
    "README.md": null
  }
}

Save as python-package.json and run:

chassis build python-package.json

Contributions are welcome! Please feel free to submit a Pull Request.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ai
Package ai provides AI integration for analyzing and extracting project skeletons
Package ai provides AI integration for analyzing and extracting project skeletons
analyze
Package analyze provides functionality for analyzing directory structures
Package analyze provides functionality for analyzing directory structures
fsutil
Package fsutil provides filesystem utility functions
Package fsutil provides filesystem utility functions
generate
Package generate handles creation of the actual filesystem structure
Package generate handles creation of the actual filesystem structure
github
Package github provides GitHub repository analysis functionality
Package github provides GitHub repository analysis functionality
parse
Package parse handles parsing of various layout file formats
Package parse handles parsing of various layout file formats
validate
Package validate handles validation of the parsed tree structure
Package validate handles validation of the parsed tree structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL