open-workbench-platform

command module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: MIT Imports: 13 Imported by: 0

README ΒΆ

ο»Ώ# Open Workbench Platform

Go Platform

πŸš€ A powerful command-line tool for scaffolding modern web applications with pre-configured templates and best practices.

What is Open Workbench Platform?

Open Workbench Platform is a Go-based command-line interface that helps developers quickly bootstrap new projects using carefully crafted templates. It eliminates the repetitive setup process and ensures you start with a solid foundation following industry best practices.

Key Features

  • 🎯 Dynamic Template System: Advanced templating with conditional logic, parameter validation, and post-scaffolding actions
  • πŸ–₯️ Terminal User Interface (TUI): Beautiful interactive interface for template selection and configuration
  • πŸ“‹ Parameter Groups: Organized parameter collection with grouping and conditional visibility
  • βœ… Validation & Error Handling: Comprehensive input validation with custom regex patterns and error messages
  • πŸ”§ Post-Scaffolding Actions: Automatic file cleanup, dependency installation, and git initialization
  • 🌐 Cross-Platform: Works on Windows, macOS, and Linux
  • πŸ“¦ Multiple Installation Methods: Homebrew, Scoop, GitHub Releases, and source builds

Quick Start

Installation

From GitHub Releases
# Download from https://github.com/jashkahar/open-workbench-platform/releases
# Extract and add to PATH
# Homebrew (macOS)
brew install jashkahar/tap/om

# Scoop (Windows)
scoop bucket add jashkahar https://github.com/jashkahar/scoop-bucket
scoop install om

Usage

# Interactive mode (recommended)
om

# CLI mode with flags
om create <template> <project-name> --owner="Your Name" [flags]


CLI Mode Examples

# Create a Next.js project with all features
om create nextjs-full-stack my-app --owner="John Doe"

# Create a React project without testing
om create react-typescript my-react-app --owner="Dev Team" --no-testing

# Create a FastAPI project without git initialization
om create fastapi-basic my-api --owner="Backend Team" --no-git

# Get help for CLI mode
om create --help

Available Templates

🎨 nextjs-full-stack

A production-ready Next.js application with:

  • TypeScript: Full TypeScript support with strict configuration
  • Testing: Jest or Vitest with comprehensive test setup
  • Styling: Tailwind CSS with PostCSS configuration
  • Docker: Ready-to-use Dockerfile for containerization
  • Quality Tools: ESLint, Prettier, and Husky for code quality
  • CI/CD Ready: GitHub Actions workflows included

⚑ fastapi-basic

A FastAPI backend template with:

  • FastAPI: Modern, fast web framework for building APIs
  • Uvicorn: ASGI server for running the application
  • Python Best Practices: Virtual environment setup and dependency management
  • API Documentation: Automatic OpenAPI/Swagger documentation
  • Hot Reload: Development server with auto-reload capability

🎯 react-typescript

A modern React application with:

  • Vite: Lightning-fast build tool and dev server
  • TypeScript: Full TypeScript support
  • Modern Tooling: ESLint, Prettier configuration
  • Component Library: Ready-to-use component structure

πŸš€ express-api

A Node.js Express API template with:

  • Express.js: Fast, unopinionated web framework
  • TypeScript: Full TypeScript support
  • Testing: Jest setup with API testing utilities
  • Documentation: Swagger/OpenAPI documentation

🟒 vue-nuxt

A Vue.js Nuxt application with:

  • Nuxt 3: Full-stack Vue.js framework
  • TypeScript: Full TypeScript support
  • Auto-imports: Automatic component and composable imports
  • SSR Ready: Server-side rendering configuration

Dynamic Template System

The CLI uses an advanced dynamic templating system that supports:

Parameter Types

  • String: Text input with validation
  • Boolean: Yes/No questions with defaults
  • Select: Single-choice dropdown
  • Multiselect: Multiple-choice selection

Conditional Logic

Parameters can be conditionally shown based on other parameter values:

{
  "name": "TestingFramework",
  "condition": "IncludeTesting == true",
  "type": "select",
  "options": ["Jest", "Vitest"]
}

Validation

Custom validation with regex patterns and error messages:

{
  "name": "ProjectName",
  "validation": {
    "regex": "^[a-z0-9-]+$",
    "errorMessage": "Project name can only contain lowercase letters, numbers, and hyphens."
  }
}

Post-Scaffolding Actions

Automatic cleanup and setup after project creation:

  • File Deletion: Remove files based on conditions
  • Command Execution: Run setup commands like npm install or git init

Project Structure

om/
β”œβ”€β”€ main.go                   # Main CLI application entry point
β”œβ”€β”€ tui.go                    # Terminal User Interface implementation
β”œβ”€β”€ types.go                  # Shared type definitions
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ templating/           # Dynamic templating system
β”‚   β”‚   β”œβ”€β”€ discovery.go      # Template discovery and validation
β”‚   β”‚   β”œβ”€β”€ parameters.go     # Parameter processing and validation
β”‚   β”‚   └── processor.go      # Template processing and file operations
β”‚   └── template/             # Legacy template system (deprecated)
β”œβ”€β”€ templates/                # Template directory
β”‚   β”œβ”€β”€ nextjs-full-stack/    # Next.js full-stack template
β”‚   β”œβ”€β”€ fastapi-basic/        # FastAPI backend template
β”‚   β”œβ”€β”€ react-typescript/     # React + TypeScript template
β”‚   β”œβ”€β”€ express-api/          # Express.js API template
β”‚   └── vue-nuxt/            # Vue.js Nuxt template
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ README.md            # Documentation overview and index
β”‚   β”œβ”€β”€ user-guide.md        # Complete user guide
β”‚   β”œβ”€β”€ architecture.md      # System architecture
β”‚   β”œβ”€β”€ template-system.md   # Template system guide
β”‚   β”œβ”€β”€ development.md       # Development guide
β”‚   β”œβ”€β”€ DOCUMENTATION_UPDATES.md # Documentation updates summary
β”‚   └── VERSION_UPDATE_SUMMARY.md # Version update summary
β”œβ”€β”€ CONTRIBUTING.md           # Contribution guidelines
β”œβ”€β”€ LICENSE                   # MIT License
└── .goreleaser.yml          # Release automation

Development

Prerequisites

  • Go 1.21 or later
  • Git

Building from Source

git clone https://github.com/jashkahar/open-workbench-platform.git
cd open-workbench-platform
go mod tidy
go build -o om main.go

Running in Development

# Run with TUI
go run main.go ui

# Run simple interactive mode
go run main.go

Adding New Templates

  1. Create a new directory in templates/ with your template name
  2. Add a template.json file with parameter definitions
  3. Include your template files with Go template syntax where needed
  4. Test the template using the CLI

Template Manifest Structure

{
  "name": "Template Name",
  "description": "Template description",
  "parameters": [
    {
      "name": "ParameterName",
      "prompt": "User prompt",
      "group": "Group Name",
      "type": "string|boolean|select|multiselect",
      "required": true,
      "default": "default value",
      "options": ["option1", "option2"],
      "condition": "OtherParam == true",
      "validation": {
        "regex": "^[a-z0-9-]+$",
        "errorMessage": "Custom error message"
      }
    }
  ],
  "postScaffold": {
    "filesToDelete": [
      {
        "path": "file-to-delete.js",
        "condition": "IncludeFeature == false"
      }
    ],
    "commands": [
      {
        "command": "npm install",
        "description": "Installing dependencies...",
        "condition": "InstallDeps == true"
      }
    ]
  }
}

Architecture

Core Components

  1. Main Application (main.go)

    • Command-line argument parsing
    • Entry point for different modes (TUI, interactive, non-interactive)
    • Orchestrates the scaffolding process
  2. Terminal User Interface (tui.go)

    • Beautiful interactive template selection
    • Uses Bubble Tea for TUI framework
    • Integrates with template discovery system
  3. Dynamic Templating System (internal/templating/)

    • Discovery: Template discovery and validation
    • Parameters: Parameter collection, validation, and processing
    • Processor: Template processing and file operations
  4. Template System

    • JSON-based template manifests
    • Conditional logic and validation
    • Post-scaffolding actions

Data Flow

  1. Template Discovery: CLI discovers available templates from embedded filesystem
  2. Template Selection: User selects template via TUI or command line
  3. Parameter Collection: Dynamic parameter collection with validation
  4. Template Processing: Files are processed with parameter substitution
  5. Post-Scaffolding: Conditional file deletion and command execution

Release Automation

This project uses GoReleaser for automated releases:

  • Multi-platform builds: Windows, macOS, and Linux (AMD64 and ARM64)
  • Package managers: Homebrew and Scoop support
  • GitHub Releases: Automatic release creation with changelog
  • Checksums: SHA256 checksums for all binaries

Release Process

  1. Create and push a new tag: git tag v0.5.0 && git push origin v0.5.0
  2. GitHub Actions automatically builds and releases
  3. Binaries are available on GitHub Releases
  4. Homebrew and Scoop packages are updated automatically

Contributing

We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.

Development Guidelines

  • Follow Go best practices and conventions
  • Add tests for new features
  • Update documentation for any changes
  • Use conventional commit messages

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Join our community discussions

Roadmap

Completed βœ…

  • Dynamic template system with conditional logic
  • Terminal User Interface (TUI)
  • Parameter validation and grouping
  • Post-scaffolding actions
  • Multiple template types (Next.js, FastAPI, React, Express, Vue)
  • Homebrew and Scoop installation support
  • Release automation with GoReleaser
  • Non-interactive CLI mode with command-line flags
  • Optional git initialization
  • Comprehensive error handling with help guidance
  • Template selection in interactive mode

In Progress 🚧

  • Template preview functionality
  • Plugin system for custom templates

Planned πŸ“‹

  • CI/CD integration templates
  • Cloud deployment templates
  • Template validation and testing framework
  • Template marketplace
  • IDE integration plugins
  • Template versioning and updates

Contributing: See CONTRIBUTING.md for details on how to contribute to this project.

Documentation ΒΆ

Overview ΒΆ

Package main provides the Open Workbench CLI, a command-line tool for scaffolding modern web applications with pre-configured templates and best practices.

The CLI supports multiple execution modes:

  • Interactive mode for guided project creation
  • Non-interactive CLI mode with command-line flags

Features:

  • Dynamic template system with conditional logic
  • Parameter validation and grouping
  • Post-scaffolding actions
  • Cross-platform support

Usage:

om        # Interactive mode
om create # CLI mode with flags

Package main provides shared type definitions for the Open Workbench CLI. This file contains data structures used throughout the application for template processing, parameter handling, and configuration management.

Directories ΒΆ

Path Synopsis
internal
templating
Package templating provides the core templating system for the Open Workbench CLI.
Package templating provides the core templating system for the Open Workbench CLI.

Jump to

Keyboard shortcuts

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