---
title: "Execute Shell Command"
method: POST
path: "/api/bash/command"
tags: ["bash"]
---

# Execute Shell Command

`POST /api/bash/command`

Executes a shell command and returns its output or background process information.

## Request body

- CommandParams
  - `command` string, required — Shell command to execute

## Response `200`

Successfully executed command

- CommandResponse
  - `output` string, nullable — Command output if available
  - `process_id` integer, nullable — Process ID if running in background
  - `status` string — Command status: 'completed' or 'background'

## Other responses

- `422` — Validation Error
- `500` — Internal server error

## Changes

- **2026-07-13** `5424450258fc` — 1 info
  - endpoint added
- **2025-01-13** `a2d864f3a8db` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/cuse-dev/apis/fastapi/changes/api/bash/command/post.md)

---

[API](https://skmtc.dev/cuse-dev/apis/fastapi.md) · [All operations](https://skmtc.dev/cuse-dev/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cuse-dev/fastapi/revisions/5424450258fc/schema)
