smpub Logo

User Guide

  • Installation
    • Requirements
    • Basic Installation
    • Optional Dependencies
      • HTTP/API Support
      • Interactive Mode
      • Development Tools
      • Documentation
      • All Dependencies
    • Verify Installation
    • Next Steps
  • Quick Start
    • Create a Simple Handler
    • Try CLI Mode
    • Try Interactive Mode
    • Try HTTP Mode
    • Next Steps
  • Publishing Guide: How to Expose Your Library with smpub
    • Table of Contents
    • Overview
    • Prerequisites
    • Step-by-Step Guide
      • Step 1: Install smpub
      • Step 2: Create Handler Classes
      • Step 3: Create Publisher Application
      • Step 4: Create Entry Point
      • Step 5: Test Your CLI
    • Handler Requirements
      • Required Elements
      • Optional but Recommended
    • Best Practices
      • 1. Separation of Concerns
      • 2. Type Hints for Free Validation
      • 3. Clear Documentation
      • 4. Error Handling
      • 5. Handler Organization
      • 6. Publisher Best Practices
    • Common Patterns
      • Pattern 1: Database Operations
      • Pattern 2: File Operations
      • Pattern 3: Service Integration
    • Complete Example
    • Summary

Guides

  • Publisher Class
    • Basic Usage
    • Methods
      • publish()
      • run()
  • Handler Classes
    • Basic Handler
  • CLI Mode
    • Usage
    • Help
  • HTTP Mode
    • Starting Server
    • Endpoints
    • Swagger UI
  • Validation
    • Automatic Validation
  • Interactive Mode
    • Installation
    • Complete Test Sequence
      • Step 1: Install and Setup
      • Step 2: Register Test App
      • Step 3: Test Interactive Mode
      • Step 4: Verify Results
      • Step 5: Cleanup
    • What Happens
    • Interactive vs Normal Mode
    • Questionary Advantages
    • Parameter Types
      • Text Input (str, int, float)
      • Boolean Confirmation
      • Literal Selection
  • Best Practices
    • Handler Design
    • Type Hints
    • Error Handling

Examples

  • Examples
    • Available Examples
      • Calculator App
    • Running Examples
  • Calculator Example
    • Source Code
    • Features
    • CLI Usage
    • HTTP Usage

API Reference

  • Publisher API Reference
  • PublishedClass API Reference
  • HTTP API Reference
    • FastAPI Integration
  • Interactive API Reference
  • Validation API Reference

Appendix

  • Architecture
    • Overview
    • Layered Architecture
    • Core Components
      • Publisher
      • PublishedClass
      • PublisherContext
      • ApiSwitcher
    • Data Flow
      • CLI Mode Flow
      • HTTP Mode Flow
    • Validation Layer
      • Pydantic Integration
    • Interactive Layer
      • Textual Integration
    • HTTP Layer
      • FastAPI Integration
      • CLI Command: smpub <app> serve
    • Registry System
      • Local Registry (.published)
      • Global Registry (~/.smartlibs/publisher/registry.json)
    • Design Principles
      • 1. Separation of Concerns
      • 2. Convention over Configuration
      • 3. Progressive Enhancement
      • 4. SmartSwitch Foundation
    • Extension Points
      • Custom Validators
      • Custom Routes
      • Custom Interactive Forms
    • Performance Considerations
      • Memory
      • Validation
      • HTTP
    • Future Architecture
      • Planned Enhancements
      • Compatibility
  • Why smpub? The Missing Link Between CLI and API
    • Previously, on SmartSwitch…
    • The Write-Once Problem
    • The smpub Pattern: SmartSwitch + Publishing
      • Step 1: Define Handlers with SmartSwitch
      • Step 2: Publish with smpub
      • Step 3: Register and Use
    • What You Actually Get
      • 1. Zero Boilerplate Interfaces
      • 2. Registry Management
      • 3. Interactive Mode
      • 4. Hierarchical Commands
      • 5. Type Validation Everywhere
    • The Registry Pattern
    • What smpub Is NOT
      • ❌ Not a Web Framework
      • ❌ Not a CLI Customization Framework
      • ❌ Not for Public APIs
    • When to Use smpub
      • ✅ Perfect Fit
      • ❌ Wrong Fit
    • The Architectural Win: ApiSwitcher
    • Real-World Workflow
      • Development
      • Local Testing
      • Production Deployment
      • Team Sharing
    • Comparison: The Full Picture
    • Key Takeaways
    • What’s Next?

Publishing

  • Publishing Guide: How to Expose Your Library with smpub
    • Table of Contents
    • Overview
    • Prerequisites
    • Step-by-Step Guide
      • Step 1: Install smpub
      • Step 2: Create Handler Classes
      • Step 3: Create Publisher Application
      • Step 4: Create Entry Point
      • Step 5: Test Your CLI
    • Handler Requirements
      • Required Elements
      • Optional but Recommended
    • Best Practices
      • 1. Separation of Concerns
      • 2. Type Hints for Free Validation
      • 3. Clear Documentation
      • 4. Error Handling
      • 5. Handler Organization
      • 6. Publisher Best Practices
    • Common Patterns
      • Pattern 1: Database Operations
      • Pattern 2: File Operations
      • Pattern 3: Service Integration
    • Complete Example
    • Summary
smpub
  • Search


© Copyright 2025, Genropy Team.

Built with Sphinx using a theme provided by Read the Docs.