---
title: "Get shell command"
method: GET
path: "/api/shell/{id}"
tags: ["shell"]
---

# Get shell command

`GET /api/shell/{id}`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/shell/{id}`
- Auth: none required

Get one shell command, including its status and exit code once exited.

## Path parameters

- `id` string, required

## Query parameters

- `location` object, nullable
  - `directory` string, nullable

## Response `200`

Success

- object
  - `location` LocationPublicRef, required
    - `directory` string, required
  - `data` ShellInfo, required
    - `id` string, required
    - `status` 'running' | 'exited' | 'timeout' | 'killed', required
    - `command` string, required
    - `cwd` string, required
    - `shell` string, required
    - `file` string, required
    - `pid` integer
    - `exit` number
    - `signal` string
    - `metadata` object, required
    - `time` object, required
      - `started` number, required: Start time in milliseconds since the Unix epoch
      - `completed` number

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: ShellNotFoundError | LocationNotFoundError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
