---
title: CLI
url: https://runapi.ai/docs/resources/cli.md
canonical: https://runapi.ai/docs/resources/cli
locale: en
---

# CLI

The RunAPI CLI is the terminal workflow for invoking model actions,
waiting for asynchronous Tasks, and inspecting callback delivery while
developing an integration. Commands write JSON results to standard
output, so you can use them in scripts and CI jobs.

## Install the CLI

Install the current release on Linux or macOS:

```shell
curl -fsSL https://runapi.ai/cli/install.sh | sh
```

Homebrew and Go installations are also available:

```shell
brew install runapi-ai/tap/runapi
go install github.com/runapi-ai/cli/cmd/runapi@latest
```

## Authenticate

On an interactive workstation, run browser-backed login and check the
result:

```shell
runapi login
runapi auth status
```

For a server or CI job without a browser, import the API key from
standard input instead of placing it in a command argument:

```shell
printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -
runapi auth status
```

For API key creation and rotation, use the [Authentication
Guide](/docs/guides/authentication).

## Inspect an operation

Use command help before composing a request. It lists the inputs
supported by the installed CLI version:

```shell
runapi suno text-to-music --help
```

## Run and wait for a Task

Start an asynchronous task, extract its id from the JSON result with
`jq`, then wait for its terminal result:

```shell
TASK_ID=$(runapi suno text-to-music --async --input '{"model":"suno-v5","vocal_mode":"instrumental","style":"minimal piano","title":"Short Piano Theme"}' | jq -r '.id')
runapi wait "$TASK_ID" --service suno --action text-to-music
```

## Inspect a Task later

Use `get` when you need the current Task state without waiting for a
terminal result:

```shell
runapi get "$TASK_ID" --service suno --action text-to-music
```

Use the [API Reference](/docs) for exact input and response contracts.
Use [SDKs](/docs/resources/sdks) when embedding the same workflow in an
application.
