feat(cli): fixyourdocs init + fixyourdocs report (P0-04)#4
Merged
Conversation
P0-04 — mirror of the TypeScript CLI for the Python package. `init` appends the canonical AGENTS.md block (vendored from `agents-md-snippet`) to AGENTS.md / CLAUDE.md / .cursor/rules / .github/copilot-instructions.md, idempotent. `report` posts a single Docs Feedback Protocol v0 report via `Client.send`. `--version`, `--help`, and `--json` are supported; exit codes are 0 success, 2 user error, 1 transport/server error. Wired up as a `console_script` named `fixyourdocs` via pyproject.toml, so `pipx run fixyourdocs` works once published. Signed-off-by: mstopa <m.stopa94@gmail.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
console_script. Mirrors fixyourdocs/sdk-typescript#5:pipx run fixyourdocs init— appends the canonical AGENTS.md block to AGENTS.md / CLAUDE.md / .cursor/rules / .github/copilot-instructions.md. Idempotent.pipx run fixyourdocs report --doc-url … --summary … --agent …— sends a Docs Feedback Protocol v0 report viaClient.send.src/fixyourdocs/snippet.pyto match the TypeScript SDK byte-for-byte.0success,2user error,1transport / server error.--version,--help, and--jsonare supported.Implements the Python steps of P0-04.
Test plan
ruff check . && mypy src/fixyourdocs && pytest -q— green locally on Python 3.13.fixyourdocs --versionprints0.1.0.fixyourdocs --helpprints usage;fixyourdocs bogusexits2.fixyourdocs initcreatesAGENTS.mdwith the canonical block; second run reports "no changes".fixyourdocs init --jsonprints{ path, changed, created }.fixyourdocs report --doc-url … --summary … --agent claude-code --api-url <mock>posts a v0 report and prints the returned id (covered by tests/test_cli.py with respx).Follow-ups not addressed here
agents-md-snippetREADME and SHA-checks both SDKs against it. Skipped pending P0-07.respx.