> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Get CLI publish status

GET https://api.runtype.com/v1/products/{productId}/surfaces/{surfaceId}/cli/publish

Whether the install host serves this `cli` surface, and the commands that install it. Read live from the install host's bucket.

Reference: https://docs.runtype.com/api-reference/runtype-api/products/get-cli-publish-status

## Authentication

- `Authorization` header (bearer token, required) — API key or Clerk session token

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Path parameters

- `productId` (string, required)
- `surfaceId` (string, required)

## Response

### 200

Publish status

- `install` (CliInstallCommands, required)
- `installDomain` (CliInstallDomain, required) — The custom install domain the surface asks for and whether it is verified; null when it asks for none
- `publishedAt` (string, required, nullable) — When the files last changed
- `slug` (string, required, nullable) — The install slug, which is the surface's command name; null while it has none
- `state` (enum, required) — `published`: the install host serves this surface's files under its slug. `not_published`: nothing is published, the surface has no valid command name, or another surface holds the slug.
  - Allowed values: `not_published`, `published`
- `version` (string, required, nullable) — The version in the published `cli.json`

## Errors

### 400 Bad Request Error

Invalid IDs, or a name, install domain (`CLI_INSTALL_DOMAIN_INVALID`) or package the publish refuses

- `error` (string, required)
- `code` (string, optional)
- `issues` (list of V1ProductsProductIdSurfacesSurfaceIdCliPublishGetResponsesContentApplicationJsonSchemaIssuesItems, optional)

### 403 Forbidden Error

Insufficient permissions, `CLI_SURFACE_PUBLISH_DISABLED` while publishing is off for the account, or `CLI_INSTALL_DOMAIN_DISABLED` for an install domain while custom install domains are off

- `error` (string, required)
- `code` (string, optional)
- `issues` (list of V1ProductsProductIdSurfacesSurfaceIdCliPublishGetResponsesContentApplicationJsonSchemaIssuesItems, optional)

### 404 Not Found Error

Product or CLI surface not found

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 502 Bad Gateway Error

`CLI_DIST_UNAVAILABLE`: the install host's storage failed

- `error` (string, required)
- `code` (string, optional)
- `issues` (list of V1ProductsProductIdSurfacesSurfaceIdCliPublishGetResponsesContentApplicationJsonSchemaIssuesItems, optional)

### 503 Service Unavailable Error

`CLI_DIST_NOT_CONFIGURED`: this deployment has no `CLI_DIST` bucket or install host

- `error` (string, required)
- `code` (string, optional)
- `issues` (list of V1ProductsProductIdSurfacesSurfaceIdCliPublishGetResponsesContentApplicationJsonSchemaIssuesItems, optional)

## Types

### CliInstallCommands

- `powershell` (string, required) — The Windows install command: `irm <url>/install.ps1 | iex`
- `sh` (string, required) — The macOS and Linux install command: `curl -fsSL <url> | sh`
- `url` (string, required) — `GET` serves the POSIX install script, e.g. `https://get.runtype.com/<slug>`

### CliInstallDomain

The custom install domain the surface asks for and whether it is verified; null when it asks for none

- `cnameTarget` (string, required) — The host a CNAME for `domain` points at when Runtype serves the domain
- `domain` (string, required) — The custom install domain the surface asks for, e.g. `get.acme.com`
- `files` (CliInstallDomainFiles, required) — Each file the domain serves at its root, as the Runtype install host serves it; copy them to serve the domain yourself
- `state` (enum, required) — `verified`: the TXT record proved control of the domain, and the published files point at it. `pending`: the CLI installs from the Runtype install host until the TXT record is found on a later publish.
  - Allowed values: `pending`, `verified`
- `verification` (CliInstallDomainVerification, required, nullable) — The TXT record that verifies the domain; null until a publish has issued the token

### V1ProductsProductIdSurfacesSurfaceIdCliPublishGetResponsesContentApplicationJsonSchemaIssuesItems

- `code` (string, required)
- `message` (string, required)
- `verdict` (enum, required)
  - Allowed values: `review`, `reject`

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### CliInstallDomainFiles

Each file the domain serves at its root, as the Runtype install host serves it; copy them to serve the domain yourself

- `SKILL.md` (string, required)
- `cli.json` (string, required)
- `install.ps1` (string, required)
- `install.sh` (string, required)

### CliInstallDomainVerification

The TXT record that verifies the domain; null until a publish has issued the token

- `recordName` (string, required) — The TXT record name, `_runtype-install.<domain>`
- `recordValue` (string, required) — The TXT record value: this surface's verification token

## Examples

**Response**

```json
{
  "install": {
    "powershell": "string",
    "sh": "string",
    "url": "string"
  },
  "installDomain": {
    "cnameTarget": "string",
    "domain": "string",
    "files": {
      "SKILL.md": "string",
      "cli.json": "string",
      "install.ps1": "string",
      "install.sh": "string"
    },
    "state": "pending",
    "verification": {
      "recordName": "string",
      "recordValue": "string"
    }
  },
  "publishedAt": "string",
  "slug": "string",
  "state": "not_published",
  "version": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/products/productId/surfaces/surfaceId/cli/publish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```