Skip to content

feat: run Trigger tasks on cloud/self-hosted from CLI #2822

@joeljuca

Description

@joeljuca

Is your feature request related to a problem? Please describe.

Hello!

I'm Joel, and I'm new to the community here. So, I'd like to request a feature that'd be very important to me (and others, I'm pretty sure): spinning up a Trigger task, either in trigger.dev cloud or self-hosted, right from its CLI.

I know that it's possible to run it from the GUI, but being able to run it from my CLI would be way better. The CLI DX is much better, much practical than opening the GUI, navigating all these screens (which change over time), finding the exact buttons, running them, etc. – if I could spin it from my local trigger cmd, and getting back a URL to open in browser to see it, it'd be awesome!

Below is a couple examples for how this could work:

# CLI params passed as task params (JSON)
npx trigger.dev task:run my-hello-world-task --name bar --greeting Howdy

# HTTPie-style params
# See: https://httpie.io/docs/cli/examples
npx trigger.dev task:run my-hello-world-task name=bar greeting=Howdy

# Payload file params (local JSON file)
npx trigger.dev task:run my-hello-world-task --payload payload.json

I personally like the HTTPie style more. They figured out a clever way to build up JSON objects out of a great CLI syntax.

I working at this company that uses Trigger, and I'm studying way to increase usage of cloud services. I didn't know Trigger before, and after putting it some time on learning, etc., I learned to love it! Thank you for building it, specially since you made it as OSS!

Describe the solution you'd like to see

Below is a couple examples for how this could work:

# CLI params passed as task params (JSON)
npx trigger.dev task:run my-hello-world-task --name bar --greeting Howdy

# HTTPie-style params
# See: https://httpie.io/docs/cli/examples
npx trigger.dev task:run my-hello-world-task name=bar greeting=Howdy

# Payload file params (local JSON file)
npx trigger.dev task:run my-hello-world-task --payload payload.json

I personally like the HTTPie style more. They figured out a clever way to build up JSON objects out of a great CLI syntax.

Describe alternate solutions

# CLI params passed as task params (JSON)
npx trigger.dev task:run my-hello-world-task --name bar --greeting Howdy

# HTTPie-style params
# See: https://httpie.io/docs/cli/examples
npx trigger.dev task:run my-hello-world-task name=bar greeting=Howdy

# Payload file params (local JSON file)
npx trigger.dev task:run my-hello-world-task --payload payload.json

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions