# Articles in the CLI

The unspar articles commands start an article from a topic and give you the finished text. You can also ask for changes and publish the article without leaving the terminal.

Web version: https://www.unspar.com/docs/cli/articles/

An article is a single piece of text for your site, like a guide or a comparison. You start it from a topic, and Unspar researches and writes it in the background. When it's done, you can read and publish it. The `unspar articles` commands handle all of this from the terminal, working on the same articles you see under [Articles](https://app.unspar.com/articles) in the web app.

Each article belongs to a project, which represents one website in Unspar. The project supplies defaults for every new article, like its language and template. A template controls what kind of text Unspar writes and how it does the research. You can override these defaults for a single article using the options below.

If you haven't installed the CLI yet, start with the [CLI overview](https://www.unspar.com/docs/cli/).

## Which commands are there?

Commands that spend credits or publish ask for confirmation first. Since a script can't answer a prompt, pass `--force` to skip it. [Scripting](https://www.unspar.com/docs/cli/scripting/) covers this in more detail.

| Command                                                       | What it does                                                    | Asks first               |
| ------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------ |
| `unspar articles list`                                        | Lists your articles, 30 by default.                             | No                       |
| `unspar articles show <article-id>`                           | Shows one article in detail.                                    | No                       |
| `unspar articles status <article-id>`                         | Shows where an article stands. `--wait` waits until it is done. | No                       |
| `unspar articles create`                                      | Creates an article from a topic and starts writing it.          | Yes, unless `--no-queue` |
| `unspar articles queue <article-id>`                          | Starts an article you saved with `--no-queue`.                  | Yes                      |
| `unspar articles content <article-id>`                        | Prints the finished text as Markdown.                           | No                       |
| `unspar articles artifacts <article-id>`                      | Lists the files Unspar made for the article.                    | No                       |
| `unspar articles revise <article-id>`                         | Asks for changes to a finished article.                         | Yes                      |
| `unspar articles revisions <article-id>`                      | Lists the rounds of changes and what the next one costs.        | No                       |
| `unspar articles restore-revision <article-id> <revision-id>` | Brings back the text from before a round.                       | Yes                      |
| `unspar articles derive <article-id> --format <format>`       | Writes a short post from a finished article.                    | Yes                      |
| `unspar articles publish <article-id>`                        | Sends the article to its outlet.                                | Yes                      |
| `unspar articles approve <article-id>`                        | Approves an article that waits for approval.                    | No                       |
| `unspar articles retry <article-id>`                          | Continues a failed article from its last saved step.            | Yes                      |
| `unspar articles cancel <article-id>`                         | Stops an article that is waiting or being written.              | No                       |

## What do the statuses mean?

An article moves through several statuses while Unspar works on it. You can check them with `status`, filter lists by them, and wait for them with `--wait`.

| Status            | What it means                                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------------------------- |
| `draft`           | Saved and not started. No credits are held.                                                                       |
| `queued`          | Waiting for a free slot. Its credits are held.                                                                    |
| `processing`      | Unspar researches and writes.                                                                                     |
| `completed`       | Finished. The credits were charged, and you can read the text.                                                    |
| `failed`          | Stopped before the end. The text costs nothing, but images it already got can.                                    |
| `cancelled`       | Someone stopped it. The credits held for the text went back.                                                      |
| `action_required` | Finished, but the charge didn't close cleanly. Unspar settles it every 10 minutes. Don't start the article again. |

Publishing has a status of its own. `status` shows it as `publishing_status`, and `published_at` is set once the article is on your site.

## Find your articles

Use `list` to browse your articles, `show` to inspect one in detail, and `status` for a quick check.

```sh
unspar articles list --project <project-id> --status completed
unspar articles show <article-id>
unspar articles status <article-id>
```

These options narrow the list down:

| Option             | What it does                                                                               |
| ------------------ | ------------------------------------------------------------------------------------------ |
| `--project <id>`   | Only articles of this project.                                                             |
| `--status <value>` | Only articles with this status, from the table above.                                      |
| `--search <text>`  | Only articles that match the text.                                                         |
| `--sort <field>`   | `created_at` or `updated_at`. A minus in front, like `-updated_at`, puts the newest first. |
| `--limit <n>`      | Up to this many rows.                                                                      |
| `--all`            | All rows.                                                                                  |

## Start an article

Every article needs a project and a brief. The brief is your topic, like "How DNS caching works", up to 10,000 bytes. Leave writing instructions out of the brief. Your project's site context already defines who the site is for, and the template sets the structure and style. See [Projects and site context](https://www.unspar.com/docs/guides/projects-and-site-context/).

You can check the price before you start. The CLI doesn't have a dedicated estimate command, so call the endpoint through `unspar api`. This creates nothing and holds no credits; the response shows the article's class and credit cost.

```sh
unspar api post /articles/estimate --field project=<project-id> --field "brief=How DNS caching works"
```

`--field` only sends text. To price the fact-check too, send the body as JSON, because `fact_check` has to be `true` or `false`.

```sh
unspar api post /articles/estimate --body '{"project":"<project-id>","brief":"How DNS caching works","fact_check":true}'
```

Then start the article.

```sh
unspar articles create --project <project-id> --brief "How DNS caching works"
```

The CLI asks: "Create this article and start generating it? Generation spends team credits." Once you confirm, it prints the new article along with its ID, and Unspar starts writing right away. The response may include a warning, such as a note that the template does no research, but warnings don't stop the article.

These options apply only to the article you are creating:

| Option                    | What it does                                                                          | Without it                             |
| ------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------- |
| `--title`                 | A working title.                                                                      | Unspar finds a title.                  |
| `--language`              | A language tag like `en-US` or `de-DE`.                                               | The project's language.                |
| `--content-template <id>` | A template from `unspar templates list`, like `template:builtin:technical_explainer`. | The project's default template.        |
| `--voice <id>`            | A voice from `unspar voices list`, like `voice:builtin:friendly_explainer`.           | The template's or the project's voice. |
| `--outlet <id>`           | An outlet from `unspar outlets list`.                                                 | The project's default outlet.          |
| `--fact-check`            | Turns the fact-check on. `--fact-check=false` turns it off.                           | What the template says.                |
| `--scheduled-at <time>`   | A time to publish, in RFC 3339 format like `2026-12-01T07:00:00+01:00`.               | No publishing time.                    |
| `--client-reference`      | Your own reference, 1 to 128 visible characters without spaces.                       | None.                                  |
| `--no-queue`              | Saves the article without starting it.                                                | Unspar starts writing right away.      |
| `--wait`                  | Waits until the article is done.                                                      | The command returns right away.        |

The fact-check reviews the article's claims after writing and fixes clear errors it can back up with a source. It adds 1 credit for a Short text or an Article, and more for In-depth and Report, and you are only charged if the check completes. See [Research, sources and citations](https://www.unspar.com/docs/guides/research-sources-and-citations/).

Once an article has a scheduled publishing time, you can no longer request rounds of changes. If you might want to revise it first, set the publishing time when you run `publish` instead.

### Save it now, start it later

With `--no-queue`, Unspar saves the article as a `draft` and holds no credits. `queue` starts it later and spends the credits then.

```sh
unspar articles create --project <project-id> --brief "How DNS caching works" --no-queue
unspar articles queue <article-id>
```

`--wait` doesn't work together with `--no-queue`, because a draft never finishes on its own.

## Wait for it

Add `--wait` to `create`, or wait later with the article's ID.

```sh
unspar articles status <article-id> --wait --interval 30s --timeout 1h
```

The CLI checks every 10 seconds and gives up after 30 minutes. `--interval` and `--timeout` change that. The interval can't be shorter than 1 second. While it waits, the CLI prints progress lines to stderr. When the article reaches a final status, it prints that status once.

The command exits with 0 for `completed` and `published`. It exits with 1 for `failed`, `cancelled`, and `action_required`, and when the time runs out. Ctrl+C stops the wait, while the article keeps running.

If an article fails, `status` explains why in `status_reason` and in its failure section.

## Read the finished article

`content` prints the text as Markdown. With `--output`, it writes the text into a new file instead.

```sh
unspar articles content <article-id> --with-images --output article.md
```

- `--output` never overwrites an existing file. Pick a new name or delete the old file first.
- `--with-images` inserts the approved images as Markdown images, with alt text and captions. The image files stay on Unspar's server, and the featured image isn't part of the text.
- `--format html` returns an error, because Unspar writes articles as Markdown.

`show` gives you everything else. It lists the images and counts the research sources. If the article had a fact-check, `show` prints the report with each correction, its source, and any claims you should check yourself. Use `show --json` to get the full source list and the entire text in `content`.

## Ask for changes

A revision round sends your feedback to an editor. The editor applies it to the existing text and keeps everything else word for word. A round adds no new facts, links, or images.

```sh
unspar articles revise <article-id> --feedback "Shorten the introduction to two sentences." --wait
unspar articles content <article-id>
```

Write the feedback like a note to an editor: what to change and where. It can be 3 to 4,000 characters long. For longer feedback, put it in a file and use `--feedback-file changes.txt`.

| Rule               | Value                                                           |
| ------------------ | --------------------------------------------------------------- |
| First round        | Free                                                            |
| Later rounds       | Normally 1 credit each, charged only when the round succeeds    |
| Rounds per article | Up to 10, one at a time. Failed rounds count.                   |
| Which articles     | Completed, and not approved, scheduled, publishing or published |
| Time per round     | Usually about a minute                                          |

`revisions` shows whether a round can start now and what it costs. It also lists the rounds so far, newest first, with what the editor changed and what it didn't do. `revisions <article-id> --wait` waits for a running round.

If you liked the earlier text better, bring it back with the revision ID from `revisions`. A restore is free and instant. The text you replace stays in the history, so you can restore it the same way.

```sh
unspar articles restore-revision <article-id> <revision-id>
```

While a round runs, Unspar refuses to approve or publish the article, and to change its outlet or publishing time. The error names the reason `revision_active`. Wait with `revisions --wait`, then try again. [The article page](https://www.unspar.com/docs/guides/the-article-page/) shows the same feature in the web app.

## Make a short post from an article

`derive` writes one short text for another channel from a finished article. You pick one format per command.

| Format               | For              |
| -------------------- | ---------------- |
| `linkedin_post`      | LinkedIn         |
| `long_linkedin_post` | LinkedIn, longer |
| `x_post`             | X                |
| `newsletter_note`    | A newsletter     |

```sh
unspar articles derive <article-id> --format newsletter_note
```

The short post is a new article with its own ID. It uses only the finished text, in the project's language and voice. It normally costs 1 credit. Wait for it with `unspar articles status <new-article-id> --wait`.

The post has no link to your article. If the article is already on your site, its address is in `parent_published_url` of the JSON answer, so add it when you copy the post. Unspar doesn't post to social networks. To send the post to an outlet, use `unspar articles publish <new-article-id> --outlet <outlet-id>`.

## Publish it

`publish` sends a finished article to its outlet. An outlet is a site you connected to Unspar, like your WordPress blog. Without `--outlet`, the article keeps the outlet it has, which is usually the project's default.

```sh
unspar articles publish <article-id>
unspar articles publish <article-id> --outlet <outlet-id> --scheduled-at 2026-12-01T07:00:00+01:00
```

The CLI asks "Publish this article to its outlet? Published content leaves Unspar." Without `--scheduled-at`, Unspar publishes as soon as possible, normally within a minute. Publishing runs in the background. `unspar articles status <article-id>` shows the result in `publishing_status` and `published_at`.

The key needs permission to publish. A login with **Full access** has it, and **Read only** doesn't. An outlet that isn't ready refuses the article. `unspar outlets list` shows which outlets are ready, and [Outlets](https://app.unspar.com/outlets) in the web app is where you fix them. See [Outlets and publishing](https://www.unspar.com/docs/guides/outlets-and-publishing/).

## Approve an article for auto-publish

A project can publish finished articles on its own, as long as a person approves each one first. You set this up in the web app; see [Scheduling and auto-publish](https://www.unspar.com/docs/guides/auto-publish/). Running `approve` gives that approval, doing the same thing as **Approve for auto-publish** in the web app.

```sh
unspar articles approve <article-id>
```

You can't undo an approval, and the CLI doesn't ask first. The key needs the **Publish approval** permission, which **Full access** doesn't include. Log in with **Custom** under **Advanced settings** and pick it there.

## What if an article fails?

`status` tells you why an article stopped and whether a retry makes sense. `source_unavailable` means a source you gave couldn't be read, and a retry doesn't help while it is still unreachable.

`retry` continues a failed article from its last saved step. Finished steps stay, and you don't pay for them again. The remaining steps can cost credits, so the CLI asks first. Unspar limits how often one article can run again.

```sh
unspar articles retry <article-id>
```

`cancel` stops an article that is queued or being written. The credits held for the text go back. The CLI doesn't ask first.

```sh
unspar articles cancel <article-id>
```

## What has no command of its own?

A few article actions only exist in the REST API. You can reach them with `unspar api`; see [Scripting](https://www.unspar.com/docs/cli/scripting/#call-the-api-directly).

| What you want                          | Command                                                     |
| -------------------------------------- | ----------------------------------------------------------- |
| See the price before you start         | `unspar api post /articles/estimate`                        |
| Change a draft or a failed article     | `unspar api patch /articles/<article-id>`                   |
| Delete an article                      | `unspar api delete /articles/<article-id>`                  |
| Check whether a draft would start      | `unspar api get /articles/<article-id>/queue-readiness`     |
| See each attempt to publish an article | `unspar api get /articles/<article-id>/publishing-attempts` |
