feat: hidden positronick post admin commands (create/update/list) - #28
Merged
Conversation
Server-enforced admin write commands for the blog over /api/admin/posts,
mirroring the soul/listing/profile admin pattern: markAdmin + adminAPIError,
no delete verb, revealed only for cached admins — the server is always the
authority.
- AdminPost{Post; Source} + CreatePost / AdminPost(id) / AdminPosts(list) /
UpdatePost in internal/api/admin.go.
- internal/cli/post.go: post create (--file markdown + frontmatter, field
flags), update (--status/--source, slug->id resolution, feed->api ownership
flip with a tookOwnership warning) and list (any status, source shown).
Registered in registerAdminCommands.
- Create defaults status to draft so an agent post never self-publishes;
unpublish is --status draft (no DELETE).
- mockapi admin posts endpoints + fixtures, goldens, agent-docs regen.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nsollazzo
marked this pull request as ready for review
July 8, 2026 13:55
nsollazzo
force-pushed
the
feat/post-admin-commands
branch
from
July 8, 2026 13:55
35c8266 to
2de102b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hidden, server-enforced admin write commands for the blog — the agent write API — over
/api/admin/posts, mirroring the existing hiddensoul/listing/profileadmin commands.Stacked on
feat/blog-read-commands(needs itsPosttypes).What's here
internal/api/admin.go:AdminPost{Post; Source}+ client methodsCreatePost/AdminPost(id)/AdminPosts(list) /UpdatePost.AdminPostsis named to avoid colliding with the public published-onlyPosts(ctx, kind)reader.internal/cli/post.go: hiddenpost create/update/listviamarkAdmin.create --file <md>— YAML frontmatter + markdown body (likesoul create); field flags override frontmatter.update <id-or-slug>—--file/ field flags /--status/--source; resolves a published slug to its id via the public blog detail endpoint; surfaces the feed→api ownership flip (tookOwnership, plus a stderr warning with the--source feedhand-back hint).list— every post, any status, with itssource.registerAdminCommands.feed-owned, native postsapi-owned), goldens, agent-docs regen.Safety / contract
isAdminguard is the authority; 401/403 → exit 4 with the admin-login hint.draft— an agent post never self-publishes.--status draft.--jsoncontract pinned by goldens (golden diffs are contract changes — note the agent-docs intro line and the newpost-*goldens).Verification
go test -race ./...,go vet ./...,make fmt-check,make lint— all green. Binary smoke-tested:postreveals for a cached admin and is hidden when logged out, exactly like its siblings.🤖 Generated with Claude Code