Skip to main content

Swain CLI

  • Quick Start

    Install once, generate everywhere.

    • Install: pipx install swain_cli (Python 3.8+ or via virtual environment).
    • Authenticate: Run swain_cli auth login to sign in with your Swain username and password (the interactive wizard uses this credential flow when no token exists). For automation, pass a token via --token or stdin.
    • Schema source: Without flags, the CLI discovers your dynamic swagger. You can target a specific project with --swain-project-id/--swain-connection-id or supply a local file using -i ./openapi.yaml.
    • Interactive mode: Launch swain_cli interactive to choose projects, connections and languages, then preview (and optionally run) the assembled command.
    • Generators: Repeat -v/--lang for every SDK you need and forward extra OpenAPI Generator options via -g, -c or --generator-arg.

    Interactive Mode Walkthrough

    Use the interactive wizard to assemble commands without memorising flags:

    1. Run swain_cli interactive.
    2. Select your project from the list.
    3. Choose a connection and stage.
    4. Specify the output directory (e.g., sdks/) and select one or more languages (e.g., python, typescript).
    5. Review the assembled command and run it to generate the SDK.