oxnorm-cli
v1.0.2
Published
A CLI tool to help developers quickly configure oxlint, oxfmt, husky, lint-staged, and commitlint
Maintainers
Readme
oxnorm
A CLI tool to help developers quickly configure oxlint, oxfmt, husky, lint-staged, and commitlint for their projects.
Features
- 🚀 One-command setup - Configure all tools with a single command
- 🔍 Smart detection - Automatically detects already installed packages
- 🧹 Legacy cleanup - Optionally removes old prettier/eslint/stylelint configs
- 📝 Editor support - Generates VSCode and Zed editor configurations
- 🔒 Version validation - Ensures Node.js compatibility with Vite 8 and OXC
- 📦 Package manager aware - Auto-detects npm, yarn, or pnpm
Requirements
- Node.js >= 18.18.0
- A project with
package.json
Installation
# Using pnpm (recommended)
pnpm add oxnorm -g
# Using npm
npm install oxnorm -gUsage
Initialize project configuration
# Run in your project directory
ox initThis will:
- Check your Node.js version
- Ask which editors to configure (VSCode/Zed)
- Ask about removing legacy config files
- Install and configure all tools
Skip version check
ox init --skip-version-checkWhat gets configured
oxfmt
- Installs
oxfmtas dev dependency - Adds
formatscript to package.json
oxlint
- Installs
oxlintas dev dependency - Creates
.oxlintrc.jsonconfiguration - Adds
lintscript to package.json
husky
- Installs
huskyas dev dependency - Creates
.husky/pre-commithook - Creates
.husky/commit-msghook
lint-staged
- Installs
lint-stagedas dev dependency - Configures lint-staged in package.json
commitlint
- Installs
@commitlint/cliand@commitlint/config-conventional - Creates
commitlint.config.jswith custom rules
Editor configuration
VSCode (.vscode/settings.json):
{
"oxc.fmt.configPath": ".oxfmtrc.json",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}Zed (.zed/settings.json):
{
"tab_size": 4,
"format_on_save": "on",
"formatter": "language_server",
"languages": {
"TypeScript": { "formatter": { "language_server": { "name": "oxfmt" } } },
"JavaScript": { "formatter": { "language_server": { "name": "oxfmt" } } }
// ...
}
}Commit Message Convention
This tool configures commitlint with the following commit types:
| Type | Description |
| ---------- | ------------------------------------- |
| feat | New feature |
| fix | Bug fix |
| docs | Documentation changes |
| style | Code style changes (formatting, etc.) |
| refactor | Code refactoring |
| perf | Performance improvements |
| test | Adding or updating tests |
| build | Build system changes |
| ci | CI/CD configuration |
| chore | Maintenance tasks |
| revert | Revert a previous commit |
| release | Release version |
Example: feat: add user authentication
Development
# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage
# Lint
pnpm lint
# Format
pnpm formatLicense
MIT
