Skip to content

Commit

Permalink
Add composio triggers show (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade authored Aug 30, 2024
1 parent ae75de8 commit 09761b3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/composio/cli/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ def _triggers(
context.console.print(f"• {_trigger.name}")


@_triggers.command(name="show")
@click.argument("name", type=str)
@handle_exceptions()
@pass_context
def _show(context: Context, name: str) -> None:
(trigger,) = context.client.triggers.get(triggers=[name])

context.console.print(f"• Showing: [green][bold]{name}[/bold][/green]")
context.console.print(
f"• Enable using: [green]composio triggers enable {name.lower()}[/green]"
)
context.console.print("• Config schema")
for prop, config in trigger.config.properties.items():
context.console.print(
f" • [bold]{prop} ({config.type})[/bold]: {config.description}"
)


class GetTriggerExamples(HelpfulCmdBase, click.Command):
examples = [
click.style("composio triggers get <trigger_id>", fg="green")
Expand Down

0 comments on commit 09761b3

Please sign in to comment.