CLI and AI Agents (MCP)
Check your changes before you push, from the terminal or from the AI agent that wrote them. Same rules and gate as the pull request check.
1. Create an API key
In the dashboard open Settings → API keys, create a key and set it as ZELSIS_API_KEY in your shell. Node 18 or newer and git are the only requirements.
export ZELSIS_API_KEY=your-key2. Run a check
npx zelsis checkThis scans your uncommitted changes. The rest of the repository goes along as context, because some issues only show across files (a migration and the route that reads the table, for example), but only the files you changed decide the result:
CRITICAL app/api/checkout/route.ts:14 Payment Amount or Price Controlled by the Client
Anyone can edit the request and pay any price they like.
Fix: Accept only a plan key from the client and look up the price server-side.
Zelsis gate: FAILED · 1 finding(s) in changed files · 214 file(s) scanned- FAILED (exit code 1): a proven critical issue in your changes.
- WARNING (exit code 0): high-severity issues worth a look. Add
--strictto exit 1 here too. - PASSED (exit code 0).
Options:
--allscans and gates on every file, not only your changes.--base origin/mainalso counts commits since that ref as changed. Useful in a pre-push hook.--jsonprints the raw result for scripts.
Fix guidance is shown on Pro and Team plans; on Free each finding names the issue, its line and what it allows.
3. Let your AI agent check its own code
zelsis mcp starts an MCP server with one tool, zelsis_check. After the agent edits code it can call the tool, read the findings and fix them before you review the change.
Claude Code
claude mcp add zelsis --env ZELSIS_API_KEY=your-key -- npx -y zelsis mcpCursor, Windsurf and other MCP clients (mcp.json)
{
"mcpServers": {
"zelsis": {
"command": "npx",
"args": ["-y", "zelsis", "mcp"],
"env": { "ZELSIS_API_KEY": "your-key" }
}
}
}To make the agent use it every time, run npx zelsis init in the repository. It adds a short rule to the agent instruction files you already have (CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md): run zelsis verify before calling a task done and fix critical and high findings first. If none exist it creates AGENTS.md and CLAUDE.md. Running it again changes nothing, --dry-run only prints the plan, and it never writes your API key.
What gets sent
- Files git tracks, plus new files that are not gitignored. Gitignored files such as
.envare never read. - Build folders, dependencies, binaries, lockfiles and files over 512 KB are skipped.
- Up to about 3.5 MB per check, changed files first.
Files are scanned in memory and released when the check ends, the same as repository scans. See Data Handling.