CLI API Reference
Complete reference for the Agnech command-line interface. Installation, authentication, commands, and configuration options.
Overview
The Agnech CLI provides powerful security scanning capabilities from your terminal. It's designed for local development, CI/CD pipelines, and automated security workflows.
7 Engines
Deep analysis
CI/CD Ready
Pipeline integration
Multiple Formats
JSON, SARIF, HTML
Installation
Bash
System Requirements
Node.js 18+ required for npm installation. Binary releases available for Windows, macOS (Intel/ARM), and Linux (x64/ARM).
Authentication
Authenticate with your Agnech API key for full feature access.
Bash
API Key Locations
The CLI checks for API keys in this order:
- 1.
--keycommand line flag - 2.
AGNECH_API_KEYenvironment variable - 3.
~/.agnech/credentialsfile - 4.
.agnech.yamlin project root
Basic Usage
Bash
Command Reference
scanRun security analysis on code
agnech scan [path] [options]reportGenerate security reports
agnech report [type] [options]fixApply automated fixes
agnech fix [finding-id] [options]configManage configuration
agnech config [action] [options]authManage authentication
agnech auth [action]versionShow version information
agnech versionBash
Configuration
Configure default behavior via agnech.yaml in your project root.
YAML
Bash
Exit Codes
Exit codes for CI/CD integration and scripting.
| Code | Meaning |
|---|---|
0 | Success - No findings or only info-level findings |
1 | Findings detected - Critical or high severity findings present |
2 | Configuration error - Invalid config or missing required options |
3 | Authentication error - Invalid or expired API key |
4 | Scan error - Analysis failed to complete |
5 | Network error - Unable to connect to Agnech services |
Bash