Getting started
Requirements
- Node.js 24 or newer
- A git repository (opx scans the committed tree)
Install
opx is currently published under the beta tag.
yarn add --dev @allons-y/opx-cli@beta
# or
npm install --save-dev @allons-y/opx-cli@beta
The CLI is deliberately small. Plugins are separate packages that you install yourself, or let opx init install for you.
Set up
yarn opx init
opx init looks at the file types in your committed tree and, for each matching plugin, asks whether to enable it now, never, or later. It then:
- Writes your choices to
.opx/config.json. - Offers to install the plugin packages with your package manager.
- Scaffolds a root
eslint.config.js(only if you don't already have one) so your editor matchesopx lint. - Offers to add a
"lint": "opx lint"script. - Installs a post-commit git hook that nudges you when a commit introduces new file types.
Prefer to skip the prompts? Install a plugin and enable it by hand:
yarn add --dev @allons-y/opx-lint-js
yarn opx enable js
Run it
yarn opx lint # lint everything that's enabled
yarn opx lint --fix # auto-fix where the tool supports it
yarn opx lint src # lint specific paths
Each enabled plugin runs as its own pass, in parallel, with grouped output. The command exits 1 if any plugin reports errors.
Commit the config, ignore the rest
.opx/config.json describes your setup and belongs in version control. .opx/state.json and .opx/cache/ are local. Ignore everything else in the directory:
.opx/*
!.opx/config.json