अपडेट पर वापस जाएँ
New releaseJul 21, 2026

secretlint v13.0.3

प्लगेबल लिंटिंग टूल क्रेडेंशियल कमिट करने से रोकने के लिए।

साझा करें

Secretlint Actions Status

Secretlint is that Pluggable linting tool to prevent committing credentials.

Secretlint एक Pluggable linting tool है जो credentials को commit करने से रोकता है।

Features

  • Scanner: किसी project में credentials खोजें और उनकी रिपोर्ट करें
  • Project Friendly: अपने project को आसानी से set up करें और CI services को integrate करें
  • Pre-Commit Hook: credential files को commit करने से रोकें
  • Pluggable: custom rule बनाने और flexible configuration की अनुमति दें
  • Documentation: उस कारण का वर्णन करें जिससे rule इसे secret के रूप में detect करता है

Quick Demo

आप secretlint linting result https://secretlint.github.io/ पर देख सकते हैं।

Quick Start

आप एक ही command में अपने project पर Secretlint का उपयोग करके देख सकते हैं।

यदि आपने पहले से Docker install किया हुआ है:

docker run -v `pwd`:`pwd` -w `pwd` --rm -it secretlint/secretlint secretlint "**/*"

यदि आपने पहले से Node.js install किया हुआ है:

npx @secretlint/quick-start "**/*"

चलाने के बाद, यदि आपको खाली result मिलता है और exit status 0 है, तो आपका project सुरक्षित है। अन्यथा, आपको कुछ error report मिलेगा, आपके project में credential raw data के रूप में शामिल है।

An example of secretlint results

आप continuous security चाहते हैं, कृपया निम्नलिखित installation guide देखें और pre-commit hook तथा CI setup करें।

Installation

Using Docker

Prerequisites: Docker आवश्यक है

हमारे Docker container का उपयोग करें ताकि आप Node.js और secretlint वाला environment उतनी ही तेज़ी से प्राप्त कर सकें जितनी तेज़ी से आप उन्हें download कर सकते हैं।

आप निम्नलिखित command से current directory के सभी files को secretlint के साथ check कर सकते हैं:

docker run -v `pwd`:`pwd` -w `pwd` --rm -it secretlint/secretlint secretlint "**/*"

secretlint/secretlint docker container design से ही बिना configuration के काम करता है।

इस Docker Image में built-in packages हैं:

अधिक जानकारी के लिए, कृपया secretlint's Dockerfile देखें।

Using Node.js

Prerequisites: Node.js 22+ आवश्यक है।

Secretlint JavaScript में लिखा गया है। आप npm का उपयोग करके Secretlint install कर सकते हैं:``` npm install secretlint @secretlint/secretlint-rule-preset-recommend --save-dev

फिर आपको एक कॉन्फ़िगरेशन फ़ाइल सेट करनी चाहिए:```
npx secretlint --init

अंत में, आप किसी भी फ़ाइल या निर्देशिका पर Secretlint को इस तरह चला सकते हैं:``` npx secretlint "**/*"

:memo: Secretlint [glob pattern](https://github.com/mrmlnc/fast-glob#basic-syntax) का समर्थन करता है और glob pattern को double quote में लपेटा जाना चाहिए।

`npm install --global` का उपयोग करके Secretlint को globally install करना भी संभव है। लेकिन, हम इसकी सिफारिश नहीं करते, कुछ rules globally टूट सकते हैं।

### Single-Executable Binary का उपयोग करना

**पूर्वापेक्षाएँ:** कोई नहीं

आप single-executable binary का उपयोग करके Node.js के बिना `secretlint` command का उपयोग कर सकते हैं।

1. [Releases page](https://github.com/secretlint/secretlint/releases) से नवीनतम binary डाउनलोड करें
2. फ़ाइल की permission को executable में बदलें: `chmod +x ./secretlint`
3. configuration फ़ाइल बनाने के लिए `./secretlint --init` चलाएँ
4. अपने project को lint करने के लिए `./secretlint "**/*"` चलाएँ

अधिक जानकारी के लिए, कृपया [publish/binary-compiler](https://github.com/secretlint/secretlint/blob/master/publish/binary-compiler) README देखें।

## Usage

`secretlint --help` Usage दिखाता है।

    Secretlint CLI that scan secret/credential data.
    
    Usage
    $ secretlint [file|glob*]
    
    Note
    supported glob syntax is based on picomatch (the engine used by micromatch)
    https://github.com/micromatch/picomatch#globbing-features
    https://github.com/micromatch/micromatch#matching-features
    
    Options
    --init             setup config file. Create .secretlintrc.json file from your package.json
    --format           [String] formatter name. Default: "stylish". Available Formatter: checkstyle, compact, github, jslint-xml, junit, pretty-error, stylish, tap, unix, json, mask-result, table
    --output           [path:String] output file path that is written of reported result.
    --secretlintrc     [path:String] path to .secretlintrc config file. Default: .secretlintrc.*
    --secretlintignore [path:String] path to .secretlintignore file. Default: .secretlintignore
    --stdinFileName    [String] filename to process STDIN content. Some rules depend on filename to check content.
    --no-color         disable ANSI-color of output.
    --no-terminalLink  disable terminalLink of output.
    --no-maskSecrets   disable masking of secret values; secrets are masked by default.
    --no-glob          disable glob pattern interpretation; treat all inputs as literal file paths.
    --no-gitignore     disable .gitignore cascade respect; .gitignore files are
                       respected by default (since v13).
    
    Options for Developer
    --profile          Enable performance profile.
    --secretlintrcJSON [String] a JSON string of .secretlintrc. use JSON string instead of rc file.
    
    Experimental Options
    --locale            [String] locale tag for translating message. Default: en
    
    Examples
    # Scan a single file
    $ secretlint ./README.md

    # Scan all files (wrap glob in double quotes to avoid shell expansion)
    $ secretlint "**/*"
    $ secretlint "source/**/*.ini"

    # Treat inputs as literal paths (for SvelteKit (group) / Next.js [param] etc.)
    $ secretlint --no-glob "src/(auth)/login.ts"

    # Lint STDIN content (filename hint affects which rules apply)
    $ echo "SECRET" | secretlint --stdinFileName=secret.txt

    # Use a custom config file
    $ secretlint "**/*" --secretlintrc=.secretlintrc.custom.json

    # Scan files ignored by .gitignore (e.g. to verify build artifacts)
    $ secretlint --no-gitignore "dist/**/*"

    # Mask secrets in a file in-place
    $ secretlint .zsh_history --format=mask-result --output=.zsh_history

    # Output JSON for programmatic parsing
    $ secretlint "**/*" --format=json --output=secretlint-report.json

    # Output GitHub Actions annotations in CI
    $ secretlint "**/*" --format=github
    
    Exit Status
    Secretlint exits with the following values:
    
        - 0:
          - Linting succeeded, no errors found.
          - Found lint error but --output is specified.
        - 1:
          - Linting failed, errors found.
        - 2:
          - Unexpected error occurred, fatal error.


## Configuration

Secretlint में एक configuration फ़ाइल `.secretlintrc.{json,yml,js}` होती है।

- Document: [Configuring Secretlint](https://github.com/secretlint/secretlint/blob/master/docs/configuration.md)

`secretlint --init` चलाने के बाद, आपकी directory में एक `.secretlintrc.json` फ़ाइल होगी।

इसमें, आप कुछ rules इस तरह configured देखेंगे:```json
{
  "rules": [
    {
      "id": "@secretlint/secretlint-rule-preset-recommend"
    }
  ]
}

id प्रॉपर्टी secretlint नियम पैकेज का नाम है।

श्रेणियाँ