Skip to content

MegaLinter Runner

Version Downloads/week Downloads/total GitHub stars

This package allows to run MegaLinter locally before running it in your CD/CI workflow, or simply to locally apply reformatting and fixes without having to install up to date linters for your files




You need to have NodeJS and Docker installed on your computer to run MegaLinter locally with MegaLinter Runner

Global installation

npm install mega-linter-runner -g

Local installation

npm install mega-linter-runner --save-dev

No installation

You can run mega-linter-runner without installation by using npx


npx mega-linter-runner -r beta -e "'ENABLE=MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'

Pre-commit hook

You can run mega-linter-runner as a pre-commit hook

Sample .pre-commit-config.yaml:

  - repo:
    rev: v6.8.0 # Git tag specifying the hook, not mega-linter-runner, version
      - id: megalinter-incremental # Faster, less thorough
          - commit
      - id: megalinter-full # Slower, more thorough
          - push

See .pre-commit-hooks.yaml for more details.


mega-linter-runner [OPTIONS] [FILES]

The options are only related to mega-linter-runner. For MegaLinter options, please use a .mega-linter.yml configuration file

Option Description Default
Directory containing the files to lint current directory
Set this parameter to use a MegaLinter flavor all
You can override the used docker image, including if it's on another docker registry
Environment variables for MegaLinter, following format 'ENV_VAR_NAME=VALUE' for a single value or "'ENV_VAR_NAME=VALUE1,VALUE2'" for a list of values
Warning: Quotes are mandatory
--fix Automatically apply formatting and fixes in your files
Allows to override MegaLinter version used v5
Show mega-linter-runner help
Show mega-linter-runner version
Generate MegaLinter configuration files
--container-name Specify MegaLinter container name
--remove-container Remove MegaLinter Docker container when done

You can also use npx mega-linter-runner if you do not want to install the package


mega-linter-runner -p myFolder --fix
mega-linter-runner -r beta -e "'ENABLE=MARKDOWN,YAML'" -e 'SHOW_ELAPSED_TIME=true'
mega-linter-runner --flavor python --release beta --filesonly path/to/my/ another/path/to/a/file.js and/another/


You can generate a ready-to-use .mega-linter.yml configuration file by running npx mega-linter-runner --install at the root of your repository

Runner Install