Skip to content

feat: posts and snippets commands - #16

Merged
imjohnbo merged 1 commit into
catchup/02-sequencesfrom
catchup/03-posts-snippets
Aug 20, 2026
Merged

feat: posts and snippets commands#16
imjohnbo merged 1 commit into
catchup/02-sequencesfrom
catchup/03-posts-snippets

Conversation

@imjohnbo

@imjohnbo imjohnbo commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Part 3 of 8. Base: #15.

What this adds

Two endpoint families that the CLI did not reach at all.

Posts:

kit posts list [--include-content]
kit posts get <id>

Snippets:

kit snippets list [--snippet-type <inline|block>] [--archived] [--include-content]
kit snippets get <id>
kit snippets create <name> --type inline --content "..."
kit snippets create <name> --type block --html "..."
kit snippets update <id> [--name] [--content] [--html] [--archive] [--restore]

Design notes

An inline snippet stores Liquid text in content. A block snippet stores HTML in document_attributes.value_html. The create command checks the pairing before it sends. A mismatch reads as a CLI error instead of a 422.

Snippets have no delete endpoint. update therefore takes --archive and --restore.

Post detail output prints publication_id. A post and a broadcast that came from the same publication share this value. It is how you match one to the other.

Review notes

Issue #7 reported description changes on the three snippet endpoints. That was the signal to check coverage. The CLI had none, so this branch adds it.

Tests: 198 before, 232 after.

Closes #5
Part of #7
Part of #12


The stack

Merge from the top down. Each part builds on the one above it.

PR Contents
1 #14 Client query support and shared helpers
2 #15 Sequence CRUD and sequence emails
3 #16 (this one) Posts and snippets
4 #17 Broadcast filters, account-wide stats, link clicks
5 #18 Subscriber slim listing, warnings, filter
6 #19 Tag rename, remove-by-email, bulk delete
7 #20 Account endpoints and purchase create
8 #21 Spec coverage map and its tests

Base branch: main for part 1, the previous part's branch for the rest.
GitHub retargets each base to main as the part below it merges.

Two endpoint families the CLI had no support for.

Posts (issue #5):
  kit posts list [--include-content]
  kit posts get <id>

Snippets (issue #7):
  kit snippets list [--snippet-type <inline|block>] [--archived]
  kit snippets get <id>
  kit snippets create <name> --type <inline|block> (--content | --html)
  kit snippets create and update reject --content with --html

An inline snippet stores Liquid text in content. A block snippet stores HTML in
document_attributes.value_html. The create command checks the pairing before
sending, so a mismatch reads as a CLI error instead of a 422.

Snippets have no delete endpoint, so update takes --archive and --restore
instead.

Post detail output prints publication_id. Posts and broadcasts that came from
the same publication share it, which is how you match one to the other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kit API spec update: 2 added

1 participant