CLI commands

Style Guide commands

The 4 koast CLI commands for the Style Guide operations.

Every command is one API operation, named by its operationId. Global flags such as --output and --api-url work on all of them, see CLI commands.

extract-brand-style

Extract brand style. POST /v1/brands/{brandId}/style-guide/extractions, API reference.

koast extract-brand-style --brand <brand> --url <url> [--json <file|->]
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.
--urlstringYesThe website to read, such as "koast.ai" or a full https address. At most 2048 characters.

Required scope: write. Accepts --idempotency-key. The CLI sends a key only when you give one. --json <file|-> supplies the whole body. Body flags are applied over it.

Example:

koast extract-brand-style --brand 123 --url URL

get-brand-style-guide

Get brand style guide. GET /v1/brands/{brandId}/style-guide, API reference.

koast get-brand-style-guide --brand <brand>
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.

Required scope: read.

Example:

koast get-brand-style-guide --brand 123

get-brand-website-candidates

Get brand website candidates. GET /v1/brands/{brandId}/style-guide/website-candidates, API reference.

koast get-brand-website-candidates --brand <brand>
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.

Required scope: read.

Example:

koast get-brand-website-candidates --brand 123

save-brand-style-guide

Save brand style guide. PUT /v1/brands/{brandId}/style-guide, API reference.

koast save-brand-style-guide --brand <brand> --source-url <source-url> --guide <guide> --confirmed <confirmed> [--json <file|->] [flags]
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.
--source-urlstringYesThe website the guide was built from, or null. At most 2048 characters.
--guideJSON objectYes
--confirmedbooleanYesTrue only when the user has approved the guide.
--replaces-sitebooleanNoTrue only when the user chose sourceUrl as this brand's own website. Without it, a guide from another site than the brand's saved guide is refused, so a site read to make ads for another brand never replaces this brand's style.

Required scope: write. --json <file|-> supplies the whole body. Body flags are applied over it.

Example:

koast save-brand-style-guide --brand 123 --json body.json

With body.json:

{
  "sourceUrl": "string",
  "guide": {
    "palette": [
      {
        "hex": "string",
        "role": "primary",
        "name": "string",
        "source": "measured"
      }
    ],
    "typography": {
      "heading": {
        "family": "string",
        "weight": 100,
        "fallback": "serif",
        "source": "measured",
        "assetIds": [
          1
        ]
      },
      "body": {
        "family": "string",
        "weight": 100,
        "fallback": "serif",
        "source": "measured",
        "assetIds": [
          1
        ]
      }
    },
    "shapes": {
      "corners": "string",
      "buttons": "string",
      "cards": "string",
      "lines": "string",
      "other": "string"
    },
    "logo": {
      "assetId": 1,
      "use": "onDark"
    },
    "imagery": "string",
    "voice": "string",
    "dos": [
      "string"
    ],
    "donts": [
      "string"
    ]
  },
  "confirmed": true,
  "replacesSite": true
}

On this page