Usage

TLDR

npx codefather-init
npm run codefather

Commands

  • codefather: checks if your access rules are respected in your repository.

  • codefather-init: creates a default config at the root of your repository and adds a codefather command to your package.json.

    • If a .github/CODEOWNERS file is present, it will be used to generate the config.

    • Accepts two optional flags:

      • json: generates a json config file instead of a ts one.

      • overwrite: overwrite an existing codefather config.

        • example: npm run codefather-init json overwrite

  • codefather-github: similar to codefather, but designed to run in a GitHub Action environment

You can either add a script shortcut in your package.json:

"scripts": {
  "codefather": "codefather",
}

Or directly run the commands with npx.

👉 The CLI mode only checks files that are staged, unstaged, newly created, or deleted. Once a file is committed, it won’t be rechecked unless modified again. For full enforcement across all commits, use Codefather in a GitHub Action.

Last updated