diff --git a/src/smarttools/web/docs_content.py b/src/smarttools/web/docs_content.py index f5c2e00..e6abb4e 100644 --- a/src/smarttools/web/docs_content.py +++ b/src/smarttools/web/docs_content.py @@ -27,8 +27,9 @@ Create tools that work with any AI provider and compose them like Unix pipes.

# Install SmartTools pip install smarttools -# Create your first tool interactively -smarttools create +# Create your first tool (choose your style) +smarttools ui # Visual builder with menus +smarttools create # CLI wizard # Or install a tool from the registry smarttools registry install official/summarize @@ -36,6 +37,12 @@ smarttools registry install official/summarize # Use it! cat article.txt | summarize +
+

Two Ways to Build

+

smarttools ui launches a visual builder with menus and forms. + smarttools create uses a command-line wizard. Both create the same YAML config files.

+
+

How It Works

Each tool is a YAML file that defines:

    @@ -69,7 +76,8 @@ output: "{summary}"

    Next Steps

    @@ -2065,6 +2073,239 @@ output: "{formatted}" ("whats-next", "What's Next?"), ], }, + + "visual-builder": { + "title": "The Visual Builder", + "description": "Build tools without touching YAML using the terminal UI", + "content": """ +

    Not everyone wants to write YAML by hand. SmartTools includes a full-featured +terminal UI that lets you create, edit, and test tools with menus and forms—no text editor required.

    + +
    +

    What You'll Learn

    + +
    + +

    Launching the Visual Builder

    + +

    Start the UI with a single command:

    + +
    smarttools ui
    + +

    You'll see a menu-driven interface that works in any terminal:

    + +
    +
    ┌─────────────────────────────────────────────────────────┐
    +│                  SmartTools Manager                      │
    +├─────────────────────────────────────────────────────────┤
    +│                                                          │
    +│   [ List all tools      ]                               │
    +│   [ Create new tool     ]                               │
    +│   [ Edit existing tool  ]                               │
    +│   [ Delete tool         ]                               │
    +│   [ Test tool           ]                               │
    +│   [ Manage providers    ]                               │
    +│   [ Exit                ]                               │
    +│                                                          │
    +│         Use ↑↓ to navigate, Enter to select             │
    +│                                                          │
    +└─────────────────────────────────────────────────────────┘
    +
    + +
    +

    Pro Tip: Mouse Support

    +

    If you have urwid installed (pip install urwid), + the UI supports mouse clicks! Just click on menu items instead of using arrow keys.

    +
    + +

    Creating Tools Visually

    + +

    Select "Create new tool" to open the tool builder. It has two main sections:

    + +
    +
    +

    1. Info & Arguments

    +
      +
    • Set tool name and description
    • +
    • Add custom flags (--format, --max, etc.)
    • +
    • Define the output template
    • +
    +
    +
    +

    2. Processing Steps

    +
      +
    • Add prompt steps (with provider selection)
    • +
    • Add code steps (Python processing)
    • +
    • Reorder steps with move up/down
    • +
    +
    +
    + +

    Step-by-Step: Creating a Summarizer

    + +
      +
    1. Launch: Run smarttools ui
    2. +
    3. Select: Choose "Create new tool"
    4. +
    5. Info: Go to "Info & Args", set name to summarize
    6. +
    7. Add Argument: Click "Add Argument", set flag to --length, default to 100
    8. +
    9. Add Step: Go to "Steps", select "Add Prompt Step"
    10. +
    11. Provider: Choose your AI provider (or create one)
    12. +
    13. Prompt: Enter your prompt template with {input} and {length}
    14. +
    15. Save: Select "Save Tool" from the main menu
    16. +
    + +

    Managing Providers

    + +

    The UI makes it easy to add, edit, and delete AI providers without touching config files:

    + +
    +
    ┌─────────────────────────────────────────────────────────┐
    +│                   Manage Providers                       │
    +├─────────────────────────────────────────────────────────┤
    +│                                                          │
    +│   claude         claude -p                              │
    +│   opencode       opencode                                │
    +│   mock           echo '[MOCK RESPONSE]'                 │
    +│   ────────────────────────────────────────              │
    +│   [ + Add New Provider ]                                │
    +│   [ ← Back to Main Menu ]                               │
    +│                                                          │
    +└─────────────────────────────────────────────────────────┘
    +
    + +

    Select a provider to edit or delete it. Adding a new provider shows a form:

    + + + +

    Testing Tools

    + +

    Before deploying a tool, test it with the built-in mock provider:

    + +
      +
    1. Select "Test tool" from the main menu
    2. +
    3. Choose the tool you want to test
    4. +
    5. Enter test input in the text editor
    6. +
    7. See the result (uses mock provider by default)
    8. +
    + +

    This lets you verify your prompts and variable substitution without making real API calls.

    + +

    Keyboard Shortcuts

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyAction
    / Navigate menu items
    EnterSelect / confirm
    EscCancel / go back
    TabMove to next field (in forms)
    qQuit the application
    + +

    UI Backends

    + +

    SmartTools automatically uses the best available terminal UI library:

    + +
    +
    +

    urwid (Best)

    +

    Mouse support, smooth

    +

    pip install urwid

    +
    +
    +

    snack

    +

    BIOS-style dialogs

    +

    apt install python3-newt

    +
    +
    +

    dialog/whiptail

    +

    Fallback option

    +

    apt install dialog

    +
    +
    + +

    CLI vs Visual Builder

    + +

    When should you use each?

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Use the UI when...Use YAML when...
    You're new to SmartToolsYou're comfortable with YAML
    Building your first few toolsMaking quick edits
    Managing providersCopying tools between machines
    Testing interactivelyVersion control integration
    + +

    Next Up

    + +

    Now that you know both ways to build tools:

    + + +""", + "headings": [ + ("launching", "Launching the Visual Builder"), + ("creating-tools", "Creating Tools Visually"), + ("managing-providers", "Managing Providers"), + ("testing", "Testing Tools"), + ("keyboard-shortcuts", "Keyboard Shortcuts"), + ("ui-backends", "UI Backends"), + ("cli-vs-ui", "CLI vs Visual Builder"), + ("next-up", "Next Up"), + ], + }, } @@ -2082,6 +2323,7 @@ def get_toc(): SimpleNamespace(slug="getting-started", title="Getting Started", children=[ SimpleNamespace(slug="installation", title="Installation"), SimpleNamespace(slug="first-tool", title="Your First Tool"), + SimpleNamespace(slug="visual-builder", title="Visual Builder"), SimpleNamespace(slug="yaml-config", title="YAML Config"), ]), SimpleNamespace(slug="arguments", title="Custom Arguments", children=[]),