Gemini CLI guide
How to install Snyk Studio in Gemini CLI using the hooks-based or rules-based approach
Access Snyk Studio in Gemini CLI to ensure generated code is secure at inception (SAI). Snyk Studio supports a default hooks-based approach to SAI for Gemini CLI.
Prerequisite
Install Gemini CLI. For more details, visit the official Gemini CLI readme file.
Install Snyk Studio with hooks support
For installation instructions, visit Getting started with Snyk Studio.
Install Snyk Studio (legacy rules-based approach)
Install with npx
Open up a terminal window and paste the following command:
npx -y snyk@latest mcp configure --tool=gemini-cli
This command:
Downloads the latest version of Snyk's CLI.
Set up Snyk Studio in Gemini CLI.
Configures Snyk Studio's Secure at inception directives in Gemini CLI's global rules file.
To verify installation, use the /mcp list command in Gemini CLI.
The list of tools installed as a part of Snyk Studio are listed below. These tools can be found listed underneath Snyk on the /mcp list screen.
snyk_aibom
Generates an AI Bill of Materials (AI-BOM) for Python software projects in CycloneDX v1.6 JSON format. This experimental feature analyzes local Python projects to identify AI models, datasets, tools, and other AI-related components. Requires an active internet connection and access to the experimental feature (available on request). The command must be run within a Python project directory and requires the CLI from the preview release channel.
snyk_auth
Authenticates the user with Snyk.
snyk_code_scan
Performs Static Application Security Testing (SAST) directly from the Snyk MCP. This command analyzes an application's source code with a SAST scan to identify security vulnerabilities and weaknesses without executing the code.
Snyk supports:
Apex, C/C++, Dart and Flutter, Elixir, Go, Groovy, Java and Kotlin, Javascript, .NET, PHP, Python, Ruby, Rust, Scala, Swift and Objective-C, Typescript, VB.NET
snyk_container_scan
Scans container images for known vulnerabilities in OS packages and application dependencies.
snyk_iac_scan
Analyzes Infrastructure as Code (IaC) files for security misconfigurations.
Supports Terraform (.tf, .tf.json, plan files), Kubernetes (YAML, JSON), AWS CloudFormation (YAML, JSON), Azure Resource Manager (ARM JSON), and Serverless Framework.
snyk_logout
Logs the Snyk MCP out of the current Snyk account by clearing the locally stored authentication token.
snyk_sbom_scan
Experimental command. Analyzes an existing SBOM file for known vulnerabilities in its open-source components. Requires components in SBOM to be identified using PackageURLs (purls).
snyk_sca_scan
Analyzes projects for open-source vulnerabilities and license compliance issues by inspecting manifest files (e.g., package.json, pom.xml, requirements.txt) to understand dependencies and then queries the Snyk vulnerability database.
snyk_send_feedback
Can be used to send feedback to Snyk if needed.
snyk_trust
Trust a given folder to allow Snyk to scan it.
snyk_version
Displays the installed Snyk MCP version.
Optional: Adjust scan frequency
Snyk recommends you use Snyk Studio with the Secure at inception directives, but also provides a smart scan option that allows the LLM to determine when to call Snyk Studio. This option results in lower overall token use and faster iteration, but it increases the risk of insecure code being added to your codebase. Expand the options below for instructions on adjusting directives at installation or after installation.
Alternative installation methods
Expand the relevant method below for installation instructions.
Set up the Snyk MCP Server for alternate installations
As a one-time setup, you need to authenticate and trust the current Project directory. If required, the agentic workflow will likely manage this automatically.
You will not be prompted to authenticate if you already authenticated with the Snyk CLI installed on your system path, or through a prior interaction.
Set Gemini CLI Rules for alternate installations
To practice Secure at inception, Snyk recommends adopting directives that align the LLM for secure code generation and workflows.
Append one of the following contents to the context file at ~/.gemini/GEMINI.md
Uninstall Snyk Studio
To remove Snyk Studio and the associated rulesets from your environment, use:
Last updated
Was this helpful?




