feat(article): pull and push articles for IDE Markdown editing (YT-5) #53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/article-pull-push-YT-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements YT-5: a
yt articlecommand surface (list, inspect, pull, push, create, delete) so Knowledge Base articles can be edited locally in any IDE and pushed back. The web editor renders Markdown but does not reflow tables, which is the original pain point.yt article pull <ID>writes a YAML-frontmatter Markdown file (id,id_readable,summary,project,parent,tags,updated,content_sha256). The body is preserved byte-for-byte (no whitespace, line-ending, or table normalization), so any IDE-side reformatting that touches only the body produces no remote diff.yt article push <file>parses the frontmatter, fetches the current remote, and refuses ifremote.updated > local.updatedunless--ignore-staleis passed. Flag is--ignore-stalerather than--forceto match the project's no---forcerule. If the body SHA matches the snapshot AND the summary did not change, push is a no-op (no POST), sopullthen immediatepushdoes not bump the article.yt article create <file>accepts either bare Markdown or a file with frontmatter. Project / parent / summary can come from CLI flags, frontmatter, or (for summary) the first# H1line in the body. On success the assigned id is written back into the file's frontmatter so the nextpushworks.yt article delete <ID>mirrorsyt issue delete(--yesto skip the confirmation prompt).yt article listandyt article inspectround out the read side;listsupports--project <KEY>and--query <s>;inspectpreviews the first 20 lines by default and accepts--full.Open-question decisions (from the issue):
--ignore-stale. Project rule bans--forceflag names.createinfersproject:from frontmatter when--projectis omitted;--projecttakes precedence when both are present.Test coverage:
src/commands/article/frontmatter.rstests).src/commands/article/push.rstests).--help(tests/article_roundtrip.rs).#[ignore]d by default, runs undercargo test -- --ignoredwhenYT_LIVE_URL,YT_LIVE_TOKEN,YT_LIVE_ARTICLE_IDare set. No project-widelive-testsfeature gate exists in this repo, so#[ignore]is the closest match.cargo fmt,cargo clippy --all-targets -- -D warnings, andcargo test --all-targetsare all green locally (281 unit + 3 integration tests pass; the live round-trip is ignored).Test plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test --all-targetscargo build --releaseand./target/release/yt article --helpshows all six verbs🤖 Generated with Claude Code