---
title: Use Scripto with Claude
description: The full agent loop — install the CLI, self-provision over OTP, draft section by section, publish, and hand the URL to Medium — driven by Claude.
---

This guide runs the whole Scripto loop with Claude (or any agent that can run a terminal). It's the motion Scripto is built around: hand the agent this docs URL, and it installs, provisions, drafts, and publishes.

## The loop, end to end

<Steps>

<Step title="Install the CLI">

```bash
npm install -g @codika-io/scripto
```

</Step>

<Step title="Self-provision over OTP">

```bash
scripto auth login-request --email you@example.com
# Claude asks you for the 6-digit code from your inbox
scripto auth login-complete --email you@example.com --code 123456
scripto whoami
```

No browser, no dashboard. An unknown email is registered on completion.

</Step>

<Step title="Set up the Brief (optional but recommended)">

```bash
scripto articles create --file outline.md     # a skeleton with H2s becomes sections
scripto brief <id> --premise "What this piece is and its angle."
scripto note add <id> --kind decision --title "Lead with the install"
```

</Step>

<Step title="Draft section by section">

```bash
scripto outline <id>                            # map the sections
scripto section set <id> <anchor> --file intro.md
scripto section add <id> --file findings.md --after <anchor>
```

Claude edits one section at a time, so even a long piece never blows its context.

</Step>

<Step title="Publish and import">

```bash
scripto articles publish <id>                   # prints /story/<slug>
```

Paste the URL into Medium's **Import a story**.

</Step>

</Steps>

## Why this works for an agent

- **Cheap context.** The [outline](/concepts/sections) is tiny; the agent pulls only the section it's editing.
- **Stable output.** Every command supports `--json` with a `{ success, data | error }` envelope, so Claude can branch on results and surface `nextAction` hints.
- **No formatting drift.** The server renders Markdown once; publishing yields a page Medium imports faithfully.

<Note>

A Scripto skills **plugin** (one skill per CLI capability — `setup-scripto`, `draft-article`, `edit-section`, `publish-article`, `import-to-medium`, `brief`) ships in its own repo so Claude Code can drive these steps by name. It mirrors the slideless plugin pattern; this page will link the install command once the plugin is published.

</Note>

## A typical session

```text
> Install Scripto and draft a post about our launch.
  → npm install -g @codika-io/scripto
  → scripto auth login-request --email me@acme.com
  → (asks for the code) → scripto auth login-complete …
  → scripto articles create --file draft.md   (id 0a1b2c3d-…)
  → scripto outline 0a1b2c3d-…
  → scripto section set 0a1b2c3d-… a1b2c3d4 --file intro.md
  → scripto articles publish 0a1b2c3d-…
  → https://scripto.codika.io/story/our-launch
> Paste that into Medium's Import a story.
```

## Next

- **[Working with sections](/guides/working-with-sections)** — the editing loop in depth.
- **[Use Scripto in Claude Desktop](/integrations/claude-desktop-mcp)** — the no-terminal path (MCP).
- **[Command reference](/cli/commands)** — every command.
