§ docs
CI/CD recipes
Drop-in snippets that run nmav audit against a preview URL and fail the job when the score drops below a threshold. Each recipe expects an NMAV_API_KEY secret. Create one from Account settings → API access and store it in your CI provider.
General guidance
- Run the audit after deploy against a preview URL, not on every commit. Audits count against your daily Premium quota.
- Pick a threshold (
--fail-on-score 70is a reasonable floor) and raise it over time as you fix findings. - Upload the JSON artifact so engineers can open the audit directly from a failed run.
GitHub Actions
name: AI visibility audit
on:
deployment_status:
jobs:
audit:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: Audit preview URL
env:
NMAV_API_KEY: ${{ secrets.NMAV_API_KEY }}
PREVIEW_URL: ${{ github.event.deployment_status.target_url }}
run: |
npx -y @nymanmedia/ai-visibility-cli audit "$PREVIEW_URL" \
--fail-on-score 70 --json > audit.json
- name: Upload audit artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: nmav-audit
path: audit.jsonGitLab CI
ai-visibility-audit:
stage: verify
image: node:20
needs: ["deploy_preview"]
variables:
PREVIEW_URL: "$DYNAMIC_ENVIRONMENT_URL"
script:
- npx -y @nymanmedia/ai-visibility-cli audit "$PREVIEW_URL"
--fail-on-score 70 --json > audit.json
artifacts:
when: always
paths:
- audit.json
expire_in: 1 weekStore NMAV_API_KEY in Settings → CI/CD → Variables and mark it as Masked and Protected.
CircleCI
version: 2.1
jobs:
ai-visibility-audit:
docker:
- image: cimg/node:20.11
steps:
- run:
name: Audit preview URL
command: |
npx -y @nymanmedia/ai-visibility-cli audit "$PREVIEW_URL" \
--fail-on-score 70 --json > audit.json
- store_artifacts:
path: audit.json
workflows:
deploy-and-audit:
jobs:
- deploy_preview
- ai-visibility-audit:
requires: [deploy_preview]
context: nyman-mediaAdd NMAV_API_KEY to the nyman-media context from Organization Settings → Contexts.
Interpreting the output
The default table format is optimized for humans. In CI, prefer --json and upload the file as an artifact so you can link directly to it from a failed build. The reference documents every field.