Skip to content

docs(cli): bootstrap basic agent docs for the CLI#815

Open
arcjet-rei wants to merge 4 commits intomainfrom
rei/docs/eng-711-basic-docs
Open

docs(cli): bootstrap basic agent docs for the CLI#815
arcjet-rei wants to merge 4 commits intomainfrom
rei/docs/eng-711-basic-docs

Conversation

@arcjet-rei
Copy link
Copy Markdown
Contributor

Summary

  • New /cli reference page under the For Agents sidebar group covering install, browser-based device auth, agent flags (--output json, --fields), command surface, and typical workflows.
  • Added Option C: CLI on agent-get-started.mdx between Option B and Common agent prompts. Reuses Steps 3–4 of the existing flow for the framework-specific code.
  • Appended a ## CLI block to public/llms.txt so agents that fetch the canonical map see the CLI alongside the Plugin and MCP server.
  • Wired /cli into src/lib/sidebars.ts (For Agents → CLI, between MCP Server and Arcjet Guards).

npx -y @arcjet/cli@latest is the lead install path everywhere — works on macOS, Linux, and Windows with no install step. npm install -g @arcjet/cli, Homebrew, and release archives are listed as alternatives for permanent installs. The device authorization flow (arcjet auth login) is framed as the default; ARCJET_TOKEN is the headless escape hatch.

Closes ENG-711.

Test plan

  • npm run dev/cli renders, sidebar entry appears under For Agents, internal links resolve.
  • Option C section renders correctly on /agent-get-started with intra-page anchors (#step-2-get-your-arcjet_key, #step-3-install-the-sdk, #step-4-add-protection) resolving to the existing steps.
  • public/llms.txt is reachable and the new CLI block is positioned between the MCP Server section and Use cases.
  • Spot-check command examples against arcjet --help for the current CLI build.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arcjet-docs Ready Ready Preview, Comment Apr 25, 2026 5:19pm

Request Review

Copy link
Copy Markdown
Contributor

@arcjet-review arcjet-review Bot left a comment

Choose a reason for hiding this comment

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

Arcjet Review — 🔴 High Risk

Decision: Blocked

Rationale: PR has merge conflicts. Resolve conflicts before review.

Review: 6067c42e | Powered by Arcjet Review

Add a /cli reference page, an Option C section on agent-get-started, and
a CLI block in llms.txt so AI coding agents can discover and use the CLI
as a low-round-trip path for environment introspection. Lead with
`npx -y @arcjet/cli@latest` since it works on macOS, Linux, and Windows
with no install step. Frame `arcjet auth login` as the default and
ARCJET_TOKEN as the headless escape hatch.

Closes ENG-711.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arcjet-rei arcjet-rei force-pushed the rei/docs/eng-711-basic-docs branch from 308b57f to f70b8da Compare April 25, 2026 15:52
@arcjet-rei arcjet-rei added the ai-review Trigger an AI review. label Apr 25, 2026
@arcjet-review arcjet-review Bot removed the ai-review Trigger an AI review. label Apr 25, 2026
Copy link
Copy Markdown
Contributor

@arcjet-review arcjet-review Bot left a comment

Choose a reason for hiding this comment

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

Arcjet Review — 🟢 Low Risk

Decision: Approved

Rationale: Docs-only PR adding a new CLI documentation page (cli.mdx), updating the agent get-started guide with an Option C section, adding a CLI section to llms.txt, and registering the new page in the sidebar. No code, dependency, infra, auth, or migration changes. The previous review blocked on merge conflicts; the diff now applies cleanly. Found one likely-broken self-referential anchor link worth fixing before merge but it does not warrant blocking.

Summary of Changes

Adds new /cli documentation page and a CLI option (Option C) to the agent get-started guide, mirrors the CLI surface into llms.txt, and adds a CLI sidebar entry. Documentation-only change.

Notes

Previous block (merge conflicts) appears resolved — the diff applies cleanly. No security-review skill load needed for a pure docs change; nothing in the diff exposes secrets, auth flows, or executable code paths.

Review: 47af423d | Powered by Arcjet Review

Comment thread src/content/docs/agent-get-started.mdx Outdated
Comment thread src/content/docs/agent-get-started.mdx Outdated
Comment thread src/content/docs/cli.mdx
Comment thread src/content/docs/cli.mdx
Comment thread public/llms.txt
Comment thread public/llms.txt
Comment thread src/content/docs/cli.mdx
- Renumber Option C steps to C1–C4 in agent-get-started.mdx so the
  headings produce unique anchor slugs and don't collide with Option B's
  Step 3 / Step 4. Inline the .env snippet in Step C2 instead of relying
  on a self-referential anchor that resolved to the wrong section.
- Update cross-reference to Option B's framework-specific steps with
  explicit step titles ("Step 3: Install the SDK" / "Step 4: Add
  protection") so the link text and target are unambiguous.
- Add `<id>` placeholder to `arcjet analyze dry-run-impact --site-id`
  in both cli.mdx and llms.txt — it now matches the rest of the table.
- Add `<id>` placeholder to `arcjet analyze ip --site-id --ip <ip>` in
  both files for the same consistency reason.
- Shorten `arcjet requests list` row description to
  "List recent requests; filter by conclusion." so the column doesn't
  overflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adding the "CLI" entry to the For Agents sidebar group shifted every
sidebar-bearing page by one row, producing a pixel diff on every page
screenshot. Also refreshes the llms.txt text snapshot to include the
new ## CLI section.

Regenerated using mcr.microsoft.com/playwright:v1.58.2-jammy (matches
the chromium-linux baseline used by CI). All 167 tests pass on a clean
verification run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The two troubleshooting screenshots regenerated locally on Apple Silicon
under Rosetta-emulated linux/amd64 still diverged from CI's amd64
rendering by ~4000px each (ratio 0.01). Other 165 snapshots stayed
under the 100-pixel `maxDiffPixels` threshold; troubleshooting's
text-heavy "Common errors" section pushes the diff over.

The HTML output is byte-identical between CI's `dist/` and the local
build (verified by md5sum), and CI's actual rendering is internally
deterministic across initial run and retry — so the divergence is
purely in Chromium font rasterization between native amd64 and
Rosetta-emulated amd64. The CI-rendered actuals are the right
baselines for a CI-only test fixture, so committing CI's bytes is
strictly correct.

Captured from #815 run 24935705869, blob-report-4
artifact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread src/content/docs/cli.mdx
- You need to answer questions about the user's Arcjet environment without standing up an MCP server.
- The user has not yet configured an MCP connection or the Arcjet plugin.

If the user has Node.js available, every command works with no install via `npx -y @arcjet/cli@latest <command>`. See [Install](#install) for permanent installation paths.
Copy link
Copy Markdown
Contributor

@davidmytton davidmytton Apr 25, 2026

Choose a reason for hiding this comment

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

This should go underneath Install below, since it's a prerequisite for npx

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.

2 participants