Download content from Sanity.
Every command follows the CLI contract: JSON on stdout, errors on stderr, and command-specific mutation safety controls. Keys resolve as described in Secrets and API keys.
gtm sanity blog
Download blog posts from Sanity.
gtm sanity blog download
Download every blog post to <out-dir>/blogs/<slug>/ (index.md + post.json).
uv run gtm sanity blog download [OPTIONS]
| Option | Type | Default | Description |
|---|
--out-dir | path | out | Output directory; posts are written under <out-dir>/blogs/<slug>/. |
--project-id | text | nsq559ov | Sanity project ID |
--dataset | text | production | Sanity dataset name |
--api-version | text | v2025-02-19 | Sanity API version date string |
--token | text | — | Bearer token for private datasets (public datasets need none). |
--use-cdn, --no-cdn | boolean | false | Read from the cached CDN edge instead of the live origin. Off by default so an archive run never captures stale content or misses just-published/just-deleted posts. |
--use-env-token, --no-env-token | boolean | false | Off by default so a public archive run ignores any ambient SANITY_API_TOKEN and stays reproducible. Pass —use-env-token to authenticate from the environment (an explicit —token always applies regardless). |
--prune, --no-prune | boolean | true | Remove snapshots of posts no longer in the live corpus. |
Last modified on July 14, 2026