# cms-edit article-tags-from-json — Batch Article Tagging

`article-tags-from-json` sets the `tags` link array on one or more articles from a JSON file. Tag slugs are resolved via the local index — run `cms-edit index sync` first.

```bash
cms-edit index sync
cms-edit article-tags-from-json --json '{...}' --dry-run
cms-edit article-tags-from-json --json '{...}'
```

All writes create **drafts** only.

**Batch behaviour:** Processes every article in the file. Failures on one article do not stop the rest — the command exits non-zero if any item failed and prints which slugs succeeded vs failed.

---

## JSON schema

```jsonc
{
  "articles": [
    {
      "articleSlug": "resources/blog/my-post",
      "tagSlugs": ["asco-2025", "oncology"],
      "append": false
    },
    {
      "articleSlug": "resources/blog/another-post",
      "tagSlugs": ["press-release"],
      "append": true
    }
  ]
}
```

| Key | Required | Description |
|---|---|---|
| `articleSlug` | Yes | Article slug (with or without leading `/`) |
| `tagSlugs` | Yes | Tag slugs to apply |
| `append` | No | When `true`, append to existing tags (deduped). Default: replace |

---

## Session alternative (single article)

```bash
cms-edit open --article-slug resources/blog/my-post
cms-edit set @p0 tags <id1>,<id2> --links
cms-edit diff && cms-edit save
```

Resolve tag IDs: `cms-edit resolve --tag-slug <slug> --json`

---

## Related commands

| Command | Purpose |
|---|---|
| `cms-edit create tag` | Create a new tag |
| `cms-edit create taxonomy-from-json` | Bootstrap tagTypes and tags |
| `cms-edit help taxonomy-from-json` | Taxonomy batch import |