Skip to content

feat(cli): fixyourdocs init + fixyourdocs report (P0-04)#4

Merged
mstopa merged 1 commit into
mainfrom
feat/p0-04-cli
May 24, 2026
Merged

feat(cli): fixyourdocs init + fixyourdocs report (P0-04)#4
mstopa merged 1 commit into
mainfrom
feat/p0-04-cli

Conversation

@mstopa
Copy link
Copy Markdown
Contributor

@mstopa mstopa commented May 24, 2026

Summary

  • Adds the Python half of the FixYourDocs CLI as a 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 via Client.send.
  • Snippet content is vendored in src/fixyourdocs/snippet.py to match the TypeScript SDK byte-for-byte.
  • Exit codes: 0 success, 2 user error, 1 transport / server error. --version, --help, and --json are supported.

Implements the Python steps of P0-04.

Test plan

  • ruff check . && mypy src/fixyourdocs && pytest -q — green locally on Python 3.13.
  • fixyourdocs --version prints 0.1.0.
  • fixyourdocs --help prints usage; fixyourdocs bogus exits 2.
  • In an empty dir, fixyourdocs init creates AGENTS.md with the canonical block; second run reports "no changes".
  • fixyourdocs init --json prints { 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

  • Snippet drift CI (P0-04 step 6 verification): a workflow that fetches the upstream agents-md-snippet README and SHA-checks both SDKs against it. Skipped pending P0-07.
  • End-to-end against the deployed Hub (P0-04 "Done when"): blocked on P0-08 / P0-09. Unit and integration coverage here use respx.

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>
@mstopa mstopa merged commit 395cf51 into main May 24, 2026
6 checks passed
@mstopa mstopa deleted the feat/p0-04-cli branch May 24, 2026 16:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant