Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions torchbase/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,30 @@ def _info(torch):
pass


@cli.group("workflow")
def workflow():
"Workflow management and inspection commands."
pass


@workflow.command("inspect")
@click.argument("workflow_spec", required=True)
@click.option("--verbose", is_flag=True, default=False, help="Show detailed parameter information.")
def inspect(workflow_spec, verbose=False):
"Inspect a workflow and display its structure as an ASCII diagram."
from torchbase.workflow_inspect import inspect_workflow

try:
diagram = inspect_workflow(workflow_spec, verbose=verbose)
click.echo(diagram)
except FileNotFoundError as e:
raise click.ClickException(f"Workflow not found: {e}")
except ValueError as e:
raise click.ClickException(f"WDL parsing error: {e}")
except Exception as e:
raise click.ClickException(f"Error inspecting workflow: {e}")


#
# File handling helper
#
Expand Down
Loading
Loading