Skip to main content

Docflows

CLI equivalents of two dashboard pages: Admin Tasks → Configure Docflows Webhook (admin-only setup) and User Tasks → Manage Docflows (triggering a suggestion). Follow the two linked pages above for the concepts (what a webhook does, how a suggestion gets reviewed) - this page covers the equivalent commands.

Get Webhook Credentials

sudodocs admin integrations webhook 42

Prints the same Payload URL and Secret the dashboard's Webhook dialog shows (admin-only) - paste these into GitHub's or Jira's webhook settings the same way as Setting up the Webhook in GitHub/Jira.

Configure Screenshot Settings

sudodocs admin integrations preview-settings 42 \
--url-pattern "https://pr-{pr_number}.preview.example.com" \
--auth-type basic \
--username "svc-account" \
--password "..." \
--route-map "templates/admin_dashboard.html=>/admin/dashboard"

Admin-only. CLI equivalent of Configure Screenshot Settings for Docflows.

OptionDescription
--url-patternPreview URL pattern. Supports {pr_number}, {branch}, {sha} tokens.
--auth-typenone, basic, header, session_cookie, or form_login.
--username, --passwordFor basic or form_login.
--header-name, --header-valueFor header.
--session-cookie-name, --session-cookie-valueFor session_cookie.
--login-url, --login-username-selector, --login-password-selector, --login-submit-selectorFor form_login.
--route-mapGLOB=>ROUTE1,ROUTE2 (repeatable) - maps a changed-file glob to preview routes to screenshot.

Trigger a Docflows Suggestion

Not admin-only - available to any doc-team member. Useful for backfilling a suggestion, or triggering one from a CI job that already has the PR details, without waiting for the GitHub webhook:

sudodocs docflow \
--pr-number 128 \
--pr-title "Add bulk export endpoint" \
--pr-body "Adds POST /api/v1/export for bulk data export." \
--pr-author "jsmith"
OptionRequiredDescription
--pr-numberYesThe PR number.
--pr-titleYesThe PR title.
--pr-bodyYesThe PR description/body.
--pr-authorYesThe PR author's username.
--pr-branchNoHead branch name. Required for Screenshot Docflows if your preview URL pattern uses {branch}.
--pr-shaNoHead commit SHA. Required for Screenshot Docflows if your preview URL pattern uses {sha}.
--screenshotNoAttach a locally captured screenshot instead of SudoDocs' own Playwright capture. Format as ROUTE=PATH. Repeatable.

Requires integration_id to be set in sudodocs.yaml - there is no environment variable for it, since it identifies which connected repository the suggestion belongs to.

The generated suggestion goes through the same Information Architect / Technical Writer / Editor pipeline as a webhook-triggered one, and lands in the same Docflows inbox for triage - the CLI only replaces the trigger, not the review or push steps, which stay browser-first.

CI-Offload for Screenshots

When your preview or staging environments are isolated behind a corporate VPN, protected by complex multi-factor SSO, or otherwise unreachable by SudoDocs' public Cloud Run workers, capture screenshots inside your own CI environment and upload them directly with the repeatable --screenshot flag - this bypasses SudoDocs' own Playwright screenshot stage entirely and trusts the provided image files.

sudodocs docflow \
--pr-number 128 \
--pr-title "Update analytics panel" \
--pr-body "Refactors dashboard widgets." \
--pr-author "jsmith" \
--screenshot /dashboard=./screenshots/dashboard.png \
--screenshot /settings=./screenshots/settings.png

An example GitHub Actions workflow is provided at sudodocs-cli/examples/github-actions-ci-offload-screenshots.yml inside the SudoDocs CLI repository package, showing how to check out code, install sudodocs-cli and Playwright, capture screenshots of specific routes, and call sudodocs docflow with the resulting files.

Headless API

The CLI is a thin wrapper over https://api.sudodocs.com/api/v1. If you're integrating from a language other than Python, call the API directly with the same Bearer token:

EndpointMethodAuthWrapped by
/docflows/generatePOSTAny doc-team membersudodocs docflow
/admin/integrations/{id}/webhookGETAdmin onlysudodocs admin integrations webhook
/admin/integrations/{id}/preview-settingsPOSTAdmin onlysudodocs admin integrations preview-settings
/jobs/{job_id}GETAny doc-team memberPolled automatically by sudodocs docflow