---
title: "List running shell commands"
method: GET
path: "/api/shell"
tags: ["shell"]
---

# List running shell commands

`GET /api/shell`

## 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`
- Auth: none required

List currently running shell commands for a location. Exited commands are not included.

## 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`: 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)
