Git Integrations

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.

How It Works

┌─────────────────────┐
│  Developer opens    │
│  a Pull Request     │
└────────┬────────────┘

┌─────────────────────┐
│  CI/CD pipeline     │
│  triggers           │
└────────┬────────────┘

┌─────────────────────┐
│  Tabnine CLI installs│
│  and authenticates  │
└────────┬────────────┘

┌─────────────────────┐
│  Agent executes     │
│  your prompt        │
└────────┬────────────┘

┌─────────────────────┐
│  Results posted     │
│  on the PR/MR       │
└─────────────────────┘

The agent runs with access to:

  • The full repository — it can read any file, not just the diff

  • Shell commands — it can run build tools, test runners, linters, etc.

  • The platform API — it can post comments, fetch PR metadata, and interact with the hosting platform

  • Tabnine's context engine — it can search across your organization's repositories, fetch service summaries, and validate against coaching guidelines

Supported Platforms

Platform
Integration Type
Trigger

Composite Action

pull_request event

CI Job

merge_request_event pipeline

Pipeline Step

Pull request pipelines

Prerequisites

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)

circle-info

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:

  • Environment variables — CI/CD variables like PR number, commit SHAs, branch names

  • 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

circle-info

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:

Priority
Category
Examples

P0

Correctness & Logic

Null dereferences, off-by-one errors, async issues

P0

Data Integrity

Missing transactions, idempotency problems

P1

Security

SQL injection, hardcoded secrets, auth gaps

P1

API Contract Safety

Breaking changes, backward compatibility

P1

Error Handling

Silent failures, missing cleanup

P1

Performance

N+1 queries, blocking I/O, resource leaks

P2

Deployment Safety

Migration risks, missing feature flags

P2

Observability

Missing logging, exposed sensitive data

P2

Maintainability

Naming, conventions, documentation

Optional Configuration

All integrations support these optional settings:

Setting
Description
Default

Tabnine Host

URL of your Tabnine console (for self-hosted / EMT installations)

https://console.tabnine.com

Model ID

Override the AI model used by the agent

System default from admin console

Next Steps

Set up Tabnine CLI in your CI/CD pipeline:

See Also

Last updated

Was this helpful?