---
title: "Run the app's own command line"
method: POST
path: "/platform/deployments/{id}/cli"
tags: ["Platform"]
---

# Run the app's own command line

`POST /platform/deployments/{id}/cli`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/deployments/{id}/cli`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Runs one command with the app's own CLI, on the customer's
server. Answers `202` with a `run_id`; poll
`GET /platform/deployments/{id}/cli/{run_id}` until `status`
leaves `pending`.

**Arguments are a list, never a string.** Each element becomes
one `argv` entry and reaches the process through `execve` — no
shell parses any of it, so quoting is not your problem and a
semicolon in a value is a semicolon in a value. A plain string
is accepted and split on whitespace as a convenience, but only
when it contains no quote characters: splitting a quoted string
correctly means implementing a shell, and a half-right shell is
worse than none.

**No docker socket is involved.** The CLI runs in a separate
container built from the app's own image, joined to the app's
own network, with its data mounted — the shape the official CLI
images are designed for. It carries `cap_drop: ALL` and no new
privilege on the machine.

**`manage` scope, and destructive.** A command line can do
anything the app itself can: drop its database, delete a user,
empty a site. That is the same ceiling `uninstall` with
`purge_data` already sits at.

Output is capped at 256 KB and a single command is stopped after
300 seconds.

## Path parameters

- `id` string, required

## Request body

- object
  - `cli` string: Which command line, when the app has more than one. Defaults to the app's main one.
  - `args` string[], required: One element per argument.

## Response `202`

The command was queued

## Other responses

- `400`: An argument was too long, held a control character, or a quoted string was sent
- `401`: Invalid or missing API credentials
- `404`: Resource not found
- `409`: The app is not running, or has no command line on the platform

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
