---
title: "Run shell command"
method: POST
path: "/workspaces/{id}/agent/sessions/{sid}/shell"
tags: ["agent"]
---

# Run shell command

`POST /workspaces/{id}/agent/sessions/{sid}/shell`

## Path parameters

- `id` string, required
- `sid` string, required

## Request body

- ProtoShellCommandRequest
  - `command` string
  - `session_id` string
  - `term_width` integer

## Response `200`

OK

- ProtoShellCommandResponse
  - `exit_code` integer
  - `output` string

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-07-17** `0fc77e68cc86` — 1 breaking
  - api path removed without deprecation
- **2026-07-16** `bf3b824e3c67` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/charmbracelet/apis/crush-api/changes/workspaces/:id/agent/sessions/:sid/shell/post.md)

---

[API](https://skmtc.dev/charmbracelet/apis/crush-api.md) · [All operations](https://skmtc.dev/charmbracelet/apis/crush-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/charmbracelet/crush-api/revisions/81bee9ef86c6/schema)
