Oct 21 2025

Automate Coder Tasks via CLI and API

Bartek Gatz
Bartek Gatz

When we introduced Coder Tasks in July 2025 with Coder v2.24, the feature offered a way to run low-interaction jobs with minimal manual involvement. This was perfect for agentic AI workflows, routine maintenance tasks, and other scenarios where developers didn’t want to navigate through multiple UI screens just to launch or monitor a process.

However, the initial release had a major limitation: everything had to be done through the Coder UI. Creating a task, checking its status, viewing logs, or sending additional prompts required point-and-click interaction. This made sense for early experimentation but quickly became a roadblock for teams looking to integrate Coder Tasks into real automation workflows.

Platform teams wanted to trigger tasks as part of CI/CD pipelines. DevOps engineers needed to incorporate them into GitOps-style deployments. Developers hoped to orchestrate them through internal tools or event-driven systems. But without API or CLI access, tasks couldn’t be created automatically, monitored programmatically, or connected seamlessly to existing toolchains.

With our latest release (Coder v2.27), that limitation disappears. The addition of REST API and CLI support for Coder Tasks means you can now create, manage, and interact with tasks entirely through code. Whether it’s integrating with GitHub Actions, scripting automated environment cleanups, or driving complex AI workflows, the full lifecycle of a task is now available programmatically with no UI interaction required.

What you can do now

With the CLI, you can list all existing tasks, create new ones either interactively or in fully automated fashion, check their status, retrieve logs, or even inject additional prompts into a running task: a feature especially useful for long-running AI jobs that might need extra context along the way. Deleting tasks when they’re no longer needed is just as straightforward.

Here’s a quick reference for the CLI commands:

CommandDescription
coder exp task listList all tasks currently in the system.
coder exp task createCreate tasks using a defined task template, interactively or via flags for automation.
coder exp task deleteTerminate an existing task, similar to deleting a workspace.
coder exp task statusCreate tasks using a defined task template, interactively or via flags for automation.
coder exp task logDisplay a one-line status update for any task.
coder exp task sendSend additional prompts to a running task, either inline or from a file.

On the API side, you have access to a dedicated http://coder-server:8080/api/experimental/tasks/ branch under the Coder API, supporting the full lifecycle of a task. Here’s a quick reference for the REST API commands:

MethodEndpointDescription
GET/tasksList all tasks
GET/tasks/{id}Retrieve the status of a single task
POST/tasksCreate a new task
GET/tasks/{id}/logsFetch logs for a specific task
POST/tasks/{id}/sendSend additional prompts to a running task
DELETE/tasks/{id}Delete a specific task

Unlocking new use cases

By introducing these capabilities, we’ve effectively turned Coder Tasks into first-class citizens for automation. Now, a GitHub Action can automatically trigger a Coder Task whenever a pull request is opened. A nightly CI/CD job can use tasks to perform quick analysis of freshly-reported issues. AI-driven tasks can request additional prompts mid-run, entirely through code.

For DevOps and platform teams, this opens the door to building richer internal workflows that don’t rely on manual intervention. And for developers, it means less time clicking through UIs and more time focusing on building the automation they need. Ben Potter, VP of Product at Coder, says:

Our Tasks API lets you programmatically work with popular agents like Claude Code, without having to worry about the underlying infrastructure or Coder-isms like workspaces, builds, or templates. We expect customers to integrate Tasks into GitHub Actions, CI/CD pipelines, Slack, and anywhere else their developers are.

Getting started

If you want to try this out, the best place to begin is with our documentation for both the CLI and API.

Alternatively, you can simply open a terminal and type:

This will give you a quick overview of the available CLI commands and their options so you can start experimenting right away.

Known limitations

As of release 2.27, the CLI and API remain in their “experimental” phase. The Coder Tasks feature itself is currently in Beta, with both the CLI and API scheduled to reach General Availability (GA) at the same time as Coder Tasks’ GA release, planned for the end of 2025.

As with any new feature, there are a few things to be aware of. Task Templates still need to be defined the traditional way via Terraform, and there’s currently no real-time streaming or webhook support for task status or logs. This means you’ll need to poll for updates rather than subscribing to push-based notifications. Finally, while the core lifecycle operations are supported via the CLI and API, some UI-only features (particularly visualizations) aren’t available outside the Coder interface just yet.

Having said that, please also take a look at the new Notification announcements which make it possible to subscribe to Coder Tasks’ status changes events.

Integrate Coder Tasks into your automation workflows now

The bottom line is simple: if you’ve been waiting to integrate Coder Tasks into your automation workflows, the wait is over. With full CLI and API support, you can now build pipelines, scripts, and event-driven systems around Coder Tasks just like any other programmable infrastructure component. It only takes a few minutes to get started, and the possibilities for automation are nearly endless.

Agent ready

Subscribe to our newsletter

Want to stay up to date on all things Coder? Subscribe to our monthly newsletter and be the first to know when we release new things!