
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
An AI-powered TypeScript npm library for automated code reviews during merge requests, designed for both free and premium use cases. It integrates with multiple SCM providers (e.g., GitHub, GitLab, Bitbucket) and supports dynamic AI models like OpenAI, Anthropic, and local models.
Create a TypeScript npm library that helps developers review code during merge requests using AI, with support for multiple providers and flexible AI model integrations. The library is designed for both Free and Premium versions, offering additional features for paying customers.
npm install -g difflytic
Or as a dev dependency in your project:
npm install --save-dev difflytic
difflytic review gitlab <projectId> <mergeRequestIid> --mode=function
npx difflytic review gitlab <projectId> <mergeRequestIid> --mode=function
--mode
can be file
, block
, or function
(default: file
)npx difflytic review gitlab 12345 42 --mode=block
import { GitLabProvider } from 'difflytic/dist/providers/GitLabProvider';
import { OpenAI } from 'difflytic/dist/ai/OpenAI';
const provider = new GitLabProvider();
const ai = new OpenAI();
const mrData = await provider.fetchMergeRequestData('yourProjectId', 'yourMergeRequestIid');
const changes = mrData.changes || [];
for (const file of changes) {
const diff = file.diff || '';
// ...process diff or use ai.analyzeCode(diff, 'function')
}
Set these as environment variables or in a .difflyticrc.json
or config.json
in your project root:
GITLAB_TOKEN
(required)OPENAI_API_KEY
(required)GITLAB_API_URL
(optional, for self-hosted GitLab)Example .difflyticrc.json
:
{
"GITLAB_TOKEN": "your_token",
"OPENAI_API_KEY": "your_openai_key",
"GITLAB_API_URL": "your_custom_gitlab_domain"
}
To run difflytic automatically on every merge request, add a job to your .gitlab-ci.yml
.
Go to Settings > CI/CD > Variables in your GitLab project and add:
GITLAB_TOKEN
(with api
scope, or at least read_api
and read_repository
)OPENAI_API_KEY
(your OpenAI API key)GITLAB_API_URL
(e.g., https://gitlab.com
or your self-hosted domain, without /api/v4
)These variables will be available to your CI jobs as environment variables.
.gitlab-ci.yml
stages:
- ai_review
ai_code_review:
stage: ai_review
image: node:18
script:
- npm install difflytic
- npx difflytic review gitlab "$CI_PROJECT_ID" "$CI_MERGE_REQUEST_IID" --mode=function
only:
- merge_requests
variables:
GITLAB_TOKEN: "$GITLAB_TOKEN"
OPENAI_API_KEY: "$OPENAI_API_KEY"
GITLAB_API_URL: "$GITLAB_API_URL"
difflytic
and runs the review command for the current MR.MIT
FAQs
AI-powered code review for GitLab/GitHub MRs using OpenAI and more.
The npm package difflytic receives a total of 92 weekly downloads. As such, difflytic popularity was classified as not popular.
We found that difflytic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.