Skip to content

feat: replace cargo run with downloadable CLI binary for hygiene scripts#40

Closed
abhishekt-hydra wants to merge 2 commits intomainfrom
fix/mintlify-via-cli
Closed

feat: replace cargo run with downloadable CLI binary for hygiene scripts#40
abhishekt-hydra wants to merge 2 commits intomainfrom
fix/mintlify-via-cli

Conversation

@abhishekt-hydra
Copy link
Copy Markdown
Contributor

@abhishekt-hydra abhishekt-hydra commented Apr 10, 2026

Summary

Replaces the cargo run hygiene scripts with a downloadable CLI binary approach. No Rust toolchain required -- the binary is auto-downloaded from GitHub releases on first run.

Changes

package.json

  • hygiene:install -- downloads the install script from mintlify-hygiene repo to a temp file (via mktemp), then runs it to fetch the platform-appropriate binary to ./bin/
  • hygiene:ensure -- checks if the binary exists, installs if missing (DRY helper)
  • hygiene -- ensures binary, then runs mintlify-hygiene check
  • hygiene:strict -- ensures binary, then runs mintlify-hygiene check --deny-warnings

.gitignore

  • Added /bin/ to ignore the downloaded binary

Before

"hygiene": "cargo run --manifest-path ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- check"

Required: Rust toolchain + mintlify-hygiene repo cloned as a sibling directory.

After

"hygiene:install": "TMPFILE=$(mktemp) && curl -fsSL https://raw.githubusercontent.com/usecortex/mintlify-hygiene/main/install.sh -o \"$TMPFILE\" && bash \"$TMPFILE\" --dest ./bin && rm -f \"$TMPFILE\"",
"hygiene:ensure": "test -x ./bin/mintlify-hygiene || npm run hygiene:install",
"hygiene": "npm run hygiene:ensure && ./bin/mintlify-hygiene check",
"hygiene:strict": "npm run hygiene:ensure && ./bin/mintlify-hygiene check --deny-warnings"

Required: curl and a network connection (first run only).

Dependency

Depends on usecortex/mintlify-hygiene#3 (already merged) which added the install.sh script.

Testing

Cold install path (fresh checkout simulation) -- PASS

$ rm -rf ./bin && npm run hygiene
# hygiene:ensure detects missing binary -> triggers hygiene:install
# -> downloads v0.1.0 for x86_64-unknown-linux-gnu -> runs checker

Warm path (binary already present) -- PASS

hygiene:ensure correctly skips download when ./bin/mintlify-hygiene already exists.

--version flag -- PASS

$ bash install.sh --version v0.1.0 --dest /tmp/hygiene-version-test
# Correctly skips GitHub API call, downloads v0.1.0 to specified dest

--dest flag -- PASS

$ HYGIENE_VERSION=v0.1.0 bash install.sh --dest /tmp/hygiene-dest-flagonly
# Binary installed to /tmp/hygiene-dest-flagonly/mintlify-hygiene with +x bit

.gitignore verification -- PASS

$ git check-ignore -v ./bin/mintlify-hygiene
.gitignore:5:/bin/    ./bin/mintlify-hygiene

Checksum verification -- PASS

SHA256 checksum verified cleanly against SHA256SUMS from the release.

jq null-safety (rate-limit/403 handling) -- PASS

jq -r '.tag_name // empty' correctly outputs empty string (not "null") when tag_name is missing, and the script exits with a helpful error message.

Before/after hygiene findings -- PASS

Branch Errors Warnings
main 3 73
This branch 3 0

All 73 prose_em_dash warnings eliminated. The 3 nav_registration errors are pre-existing on main (files not listed in docs.json nav) and not a regression.

Type of Change

  • CI/Build
  • Content fix (typo, broken link, incorrect info)

Checklist

  • My commits are signed off (git commit -s) per the DCO
  • I have not committed any secrets or credentials
  • No internal system details are exposed in the content

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 10, 2026

Greptile Summary

This PR replaces em-dash characters () with plain ASCII hyphens (-) across 15 MDX documentation files to resolve prose_em_dash warnings from a new Mintlify hygiene linter. It also adds mintlify-hygiene.toml (linter config) and new npm scripts (dev, hygiene, hygiene:strict) to package.json.

  • The hygiene and hygiene:strict npm scripts reference ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml — a path outside the repository that requires a sibling Rust project to be present. This will silently fail (or error) for any contributor who doesn't have that specific local checkout.

Confidence Score: 4/5

Safe to merge after addressing the broken out-of-repo path in the hygiene npm scripts.

All MDX content changes are correct em-dash-to-hyphen substitutions with no semantic impact. The one P1 finding is the hygiene/hygiene:strict scripts referencing ../mintlify-hygiene/ — a path outside the repository that will break for any contributor or CI runner without that specific local checkout. This should be resolved before merging.

package.json — the hygiene script paths need to be made portable or documented.

Important Files Changed

Filename Overview
package.json Adds npm scripts including hygiene and hygiene:strict that reference a Rust project at ../mintlify-hygiene/ — an external path outside the repo, making the scripts non-portable.
mintlify-hygiene.toml New linter config file; rules look reasonable. prose_em_dash is set to warn (not error), which is the motivation for the bulk of the MDX changes in this PR.
api-reference/endpoint/full-recall.mdx Em-dash replaced with - in definition-style bullet items; purely cosmetic formatting change.
concepts.mdx Em-dash replaced with - throughout; content unchanged.
use-cases/ai-chief-of-staff.mdx Em-dash replaced with - throughout including section heading separators; content unchanged.
core-concepts.mdx Em-dash replaced with - in prose and bullet items; content unchanged.
plugins/claude-code.mdx Em-dash replaced with -; content unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer edits MDX] --> B{Run hygiene check}
    B -->|npm run hygiene| C[cargo run --manifest-path ../mintlify-hygiene/...]
    C -->|sibling repo present| D[Linter runs against MDX files]
    C -->|sibling repo absent| E[❌ cargo error: manifest not found]
    D --> F{prose_em_dash rule}
    F -->|em-dash found| G[WARN: replace with hyphen]
    F -->|no em-dash| H[✅ Pass]
    G --> I[Developer updates MDX]
    I --> A
Loading

Reviews (1): Last reviewed commit: "chore: add explicit rule config and stri..." | Re-trigger Greptile

Comment on lines +6 to 8
"hygiene:strict": "cargo run --manifest-path ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- check --deny-warnings"
},
"dependencies": {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Hygiene scripts reference an out-of-repo path

Both hygiene scripts resolve the Cargo manifest via ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml — a path that only exists if a sibling mintlify-hygiene Rust project happens to be checked out next to this repo. Every other contributor (and any CI runner that clones only this repo) will get a hard failure when running these scripts. Either vendor/submodule the tool, publish it as an npm binary, or document the required local setup prominently.

Suggested change
"hygiene:strict": "cargo run --manifest-path ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- check --deny-warnings"
},
"dependencies": {
"hygiene": "mintlify-hygiene check",
"hygiene:strict": "mintlify-hygiene check --deny-warnings"

(If the tool is published as an npm package — otherwise document the required checkout path in the README.)

Comment on lines +63 to +64
- **`fast`** - Single-query retrieval. **Personalised recall is disabled**.
- **`thinking`** - Multi-query with reranking. **Personalised recall is enabled**.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Double-space padding around hyphens in definition lists

The replacement uses - (two spaces either side) in definition-style bullet items, while prose replacements elsewhere in this PR use a single space (-). The double-space variant is visually inconsistent and may render as multiple spaces in some Markdown parsers. Consider standardising on single-space: **\fast`** - Single-query retrieval.`

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown

@vorflux vorflux bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed -- found 2 issues plus a CI blocker.

CI Failure: Both commits on this branch are missing DCO sign-off (Signed-off-by: line), which causes the dco-check CI job to fail. Fix with:

git rebase HEAD~2 --signoff
git push --force-with-lease

Review with Vorflux

Comment on lines +5 to +6
"hygiene": "cargo run --manifest-path ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- check",
"hygiene:strict": "cargo run --manifest-path ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- check --deny-warnings"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both hygiene and hygiene:strict scripts reference ../mintlify-hygiene/crates/mintlify-hygiene/Cargo.toml -- a path outside this repository that requires a sibling Rust project to be checked out locally. This will fail for any contributor (or CI runner) that only clones this repo. Either vendor/submodule the tool, publish it as an installable binary, or at minimum document the required local setup in the README.

Comment on lines +23 to +25
[rules.nav_registration]
enabled = true
level = "error"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nav_registration is set to level = "error", but the repo currently contains MDX pages that are not registered in docs.json (e.g. api-reference/endpoint/create-embeddings-tenant.mdx, core-concepts.mdx, continuity-assurance.mdx). Once the hygiene CLI is actually runnable, check will fail on the current tree. Either register the missing pages in docs.json, add them to the exclude list, or downgrade this rule to "warn" until the nav is cleaned up.

@abhishekt-hydra
Copy link
Copy Markdown
Contributor Author

closing in favour of #41

@vorflux vorflux bot changed the title Fix/mintlify via cli feat: replace cargo run with downloadable CLI binary for hygiene scripts Apr 10, 2026
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.

1 participant