Run Tabnine CLI in your CI/CD pipeline to automate tasks on every pull request — code review, documentation generation, test scaffolding, and more.
Overview
Tabnine CLI can run in non-interactive (headless) mode inside CI/CD pipelines, triggered automatically on pull requests and merge requests. The provided integrations install the CLI, authenticate, and execute a prompt against your codebase — the agent has full access to the diff, the repository, and the platform's API to post comments and results.
The behavior is entirely driven by the prompt you provide. The out-of-the-box configurations include a comprehensive code review prompt, but you can customize or replace it to automate any task.
Example Use Cases
Use Case
What the Agent Does
Code Review
Audits the PR diff for bugs, security issues, performance, and posts inline comments (included out-of-the-box)
Documentation
Generates or validates documentation for changed code and posts it as a PR comment
Test Generation
Scaffolds unit tests for new or modified functions
Coverage Analysis
Identifies untested code paths in the diff and suggests what to cover
Changelog Drafting
Summarizes PR changes into a changelog entry
Migration Validation
Checks database migrations for safety and backward compatibility
Custom Policies
Enforces team-specific conventions, naming rules, or architectural constraints
Each of these is achieved by changing the prompt passed to tabnine -y -p "..." in your pipeline configuration.
Before setting up any integration, ensure you have:
Tabnine account with Agents enabled for your team
TABNINE_KEY — Tabnine Personal Access Token. Obtain this from your Tabnine admin console.
Node.js 20 — Available in the CI runner (GotLab/Bibucket provided configurations use the node:20 image)
The TABNINE_KEY is a Personal Access Token used for non-interactive (headless) authentication. Store it as a secret/secured variable in your CI/CD platform — never commit it to your repository.
Customizing the Prompt
The core of every integration is a single call to the Tabnine CLI in non-interactive mode:
The prompt defines what the agent does. The provided configurations include a detailed code review prompt, but you can replace it with any instructions. Your prompt can reference:
Platform APIs — Instructions for the agent to call the GitHub/GitLab/Bitbucket API
Shell commands — The agent can execute commands you describe in the prompt
Tabnine tools — Remote code search, coaching guidelines, and other built-in capabilities
The -y flag enables auto-accept mode, so the agent executes tool calls without waiting for confirmation — essential for non-interactive CI/CD environments.
The Included Code Review Prompt
The out-of-the-box configurations include a comprehensive code review prompt that:
1
Fetches the PR/MR diff
Uses the platform's API to obtain the diff for the pull/merge request.
2
Classifies the change
Assigns a risk tier (Low, Standard, High) to the change.
3
Audits the code
Checks for correctness, security, performance, and other issues.
4
Analyzes cross-repo impact
Uses Tabnine's context engine to assess effects across repositories.
5
Validates against coaching guidelines
Applies team-configured coaching guidelines to the change.
6
Posts inline comments
Adds actionable suggestions on specific lines in the diff.
7
Posts a summary comment
Provides an overall assessment in a summary comment on the PR/MR.
The review evaluates code against these categories, in priority order: