Improve TOTP docs & README & Make CLI actually support typer + py3.11 (#2791)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Suchintan
2025-06-25 12:59:56 -04:00
committed by GitHub
parent 60dcd6bcb1
commit 9c9760d6ca
9 changed files with 307 additions and 179 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import annotations
import json
import os
from typing import Optional
import typer
from dotenv import load_dotenv
@@ -21,7 +22,7 @@ workflow_app = typer.Typer(help="Manage Skyvern workflows.")
@workflow_app.callback()
def workflow_callback(
ctx: typer.Context,
api_key: str | None = typer.Option(
api_key: Optional[str] = typer.Option(
None,
"--api-key",
help="Skyvern API key",
@@ -32,7 +33,7 @@ def workflow_callback(
ctx.obj = {"api_key": api_key}
def _get_client(api_key: str | None = None) -> Skyvern:
def _get_client(api_key: Optional[str] = None) -> Skyvern:
"""Instantiate a Skyvern SDK client using environment variables."""
load_dotenv()
load_dotenv(".env")
@@ -45,8 +46,8 @@ def run_workflow(
ctx: typer.Context,
workflow_id: str = typer.Argument(..., help="Workflow permanent ID"),
parameters: str = typer.Option("{}", "--parameters", "-p", help="JSON parameters for the workflow"),
title: str | None = typer.Option(None, "--title", help="Title for the workflow run"),
max_steps: int | None = typer.Option(None, "--max-steps", help="Override the workflow max steps"),
title: Optional[str] = typer.Option(None, "--title", help="Title for the workflow run"),
max_steps: Optional[int] = typer.Option(None, "--max-steps", help="Override the workflow max steps"),
) -> None:
"""Run a workflow."""
try: