# auth0-toolkit **Repository Path**: mirrors_auth0/auth0-toolkit ## Basic Information - **Project Name**: auth0-toolkit - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

auth0-toolkit

CLI toolkit for common scripts for JS/TS Auth0 projects

--- Inspired by ["Tools without config"](https://blog.kentcdodds.com/automation-without-config-412ab5e47229), ["The Melting Pot of JavaScript"](https://youtu.be/G39lKaONAlA), and [kcd-scripts](https://github.com/kentcdodds/kcd-scripts). - [Usage](#usage) - [Configuration](#configuration) - [Overriding Configuration](#overriding-configuration) - [API](#api) - [Modules](#modules) - [build](#build) - [doc](#doc) - [format](#format) - [init](#init) - [lint](#lint) - [precommit](#precommit) - [test](#test) - [validate](#validate) - [Author](#author) - [License](#license) ## Usage 1. Create a project: - `npm init new-auth0-project` - If it's a TypeScript project: add `types` into `package.json`. For example: - `{ "types": "lib/index" }` 1. Install auth-toolkit: - `npm install --save-dev auth0-toolkit` 1. Run the initialization script: - `npx auth0-toolkit init` 1. Use included scripts: - `npm run build -- --watch` - `npm run build:doc` - `npm run validate` - `npm run format` - `npm run lint` - ... etc. # Configuration This toolkit exposes a bin called `auth0-toolkit`. All scripts are stored in `lib/scripts` and all configuration files are stored in `lib/config`. The toolkit determines whether a project is a TypeScript project or JavaScript project depending on whether the `types` property exists in `package.json`. All included tools can have their configuration overwritten by adding flags to the command or by including configuration files in the root of your project. For example: running `auth0-toolkit format` will run Prettier with the included configuration, but having a `.prettierrc` in your project will cause the toolkit to use that configuration instead. ## Overriding Configuration During the toolkit setup process, configuration files for the libraries used by the toolkit are created in the project root. Libraries natively supporting an "extend" feature will use those by default to allow for toolkit configuration to be used as a starting point. All configuration can be overridden with configuration files, `package.json` properties, or arguments passed to the toolkit binary. # API ## Modules
build

Build project using TypeScript or Babel based on project type.

TypeScript

Babel

doc

Generates documentation files.

format

Formats project files using prettier.

init

Initializes the project

The init script generates necessary files and updates package.json. This script is executed automatically during preinstall and postinstall stages. It can also be manually executed.

The following entries added to package.json:

The following files are created:

lint

Lint project using TSLint or ESLint based on project type.

TSLint

Babel

precommit

The script that is automatically executed before a commit using lintstaged

test

Test project using Jest

validate

Runs all relevant validation steps on the project

Executes all the validation tasks that are relevent to the project from this list:

If the event that triggers the validation script running is the precommit script, lint and test will be skipped since they are already ran separately.

## build

Build project using TypeScript or Babel based on project type.

TypeScript

Babel

**Properties** | Name | Default | Description | | ------------ | ---------------- | --------------------------------------------------------------------------------------- | | [--out-dir] | lib |

Output destination for built files. (Babel)

| | [--outDir] | lib |

Output destination for built files. (Typescript)

| | [--no-clean] | |

If present, does not clean target directory.

| | [OTHERS] | |

All CLI options used by related binary. (tsc or babel)

| **Example** ```js $ npm run build -- --watch --preserveWatchOutput $ npx auth0-toolkit build $ npx auth0-toolkit build --watch --preserveWatchOutput ``` ## doc

Generates documentation files.

**Properties** | Name | Description | | -------- | ---------------------------------------------------------------------- | | [OTHERS] |

All CLI options used by related binary. (jsdoc2md)

| **Example** ```js $ npm run build:doc $ npx auth0-toolkit doc ``` ## format

Formats project files using prettier.

**Properties** | Name | Description | | ------------ | ------------------------------------------------------------------------------------ | | [--no-write] |

If provided, files will not be written to disk. (Defaults to writing to disk)

| | [OTHERS] |

All CLI options used by the related binary. (prettier)

| **Example** ```js $ npm run format $ npx auth0-scripts format ``` ## init

Initializes the project

The init script generates necessary files and updates package.json. This script is executed automatically during preinstall and postinstall stages. It can also be manually executed.

The following entries added to package.json:

The following files are created:

**Properties** | Name | Description | | ------------ | ----------------------------------------------------------------------------------------------- | | [...files] |

Files to lint

| | [--no-cache] |

Disables ESLint --cache arg which is added by this script.

| | [OTHERS] |

All CLI options used by the related binary. (eslint or tslint)

| **Example** ```js $ npx auth0-toolkit init ``` ## lint

Lint project using TSLint or ESLint based on project type.

TSLint

Babel

**Properties** | Name | Description | | ------------ | ----------------------------------------------------------------- | | [...files] |

A list of files to lint.

| | [--no-cache] |

Disables ESLint's --cache arg.

| | [OTHERS] |

All CLI options used by related binary. (TSLint or ESLint)

| **Example** ```js $ npm run lint $ npm run lint my-file.ts -- --config my-config.json $ npx auth0-toolkit lint $ npx auth0-toolkit lint --no-cache $ npx auth0-toolkit lint my-file.ts ``` ## precommit

The script that is automatically executed before a commit using lintstaged

**Properties** | Name | Description | | -------- | ----------------------------------------------------------------------------- | | [OTHERS] |

All CLI options used by the related binary. (lint-staged)

| ## test

Test project using Jest

**Properties** | Name | Description | | ------------ | ---------------------------------------------------------------------- | | [--no-watch] |

If provided, tests run once. (Default is watch mode)

| | [OTHERS] |

All CLI options used by the related binary. (jest)

| **Example** ```js $ npm run test $ npx auth0-toolkit test ``` ## validate

Runs all relevant validation steps on the project

Executes all the validation tasks that are relevent to the project from this list:

If the event that triggers the validation script running is the precommit script, lint and test will be skipped since they are already ran separately.

**Properties** | Name | Description | | ------------ | --------------------------------------------- | | [...scripts] |

A list of scripts to specifically run.

| **Example** ```js $ npm run validate custom-validator $ npx auth0-toolkit validate $ npx auth0-toolkit validate custom-validator,another-validator ``` # Author [Auth0](auth0.com) # License This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.