@luxkit/cli
v1.0.6
Published
One-click project formatting & VSCode config CLI
Downloads
848
Readme
lux
One-click project formatting & VSCode config CLI
English | 中文
What is lux?
lux is a CLI tool that initializes project formatting configs and VSCode workspace settings with a single command. It generates ESLint, Prettier, Stylelint, CSpell, EditorConfig files and VSCode settings from battle-tested presets — with smart merge and conflict resolution.
✨ Key Highlights
| Feature | Description |
| :------------------------- | :----------------------------------------------------------------------------- |
| 🎯 One Command Setup | lux fmt web generates all linting & formatting configs instantly |
| 🔧 5 Fmt Presets | web · electron · uniapp · node · nest — each with curated rules |
| 🖥️ 6 VSCode Presets | web · electron · uniapp · node · nest · go — settings + extensions |
| 🔀 Smart Merge | Preset wins for linting keys; user wins for personal preferences |
| 🛡️ Conflict Resolution | neverOverwrite / forceOverwrite lists + --force flag |
| 📦 Auto Install | Detects bun / pnpm / yarn / npm and installs devDependencies |
| 🔍 Fuzzy Matching | Typo a preset name? Levenshtein distance finds the closest match |
| 🧪 Dry Run | Preview all changes with --dry-run before writing anything |
| 🔗 Script Injection | Auto-injects <pm> lint / <pm> format scripts into package.json |
| 🌐 Proxy Management | Persistent proxy config with set / unset — copy to CMD / PowerShell / Bash |
| 🔄 Self-Update | lux update checks and installs the latest version automatically |
Quick Start
# Install globally (pick your package manager)
npm install -g @luxkit/cli
# or
bun add -g @luxkit/cli
# Initialize formatting configs
lux fmt web # Generate ESLint, Prettier, Stylelint, CSpell, EditorConfig
# Initialize VSCode settings
lux vscode web # Generate .vscode/settings.json + extensions.json
# List available presets
lux fmt list
lux vscode listCLI Commands
| Command | Description |
| :-------------------------- | :------------------------------------------------- |
| lux fmt <preset> | Initialize formatting config files |
| lux fmt list | List available fmt presets |
| lux vscode <preset> | Initialize VSCode workspace settings |
| lux vscode list | List available VSCode presets |
| lux set <key=value> [...] | Persist proxy env vars (e.g. https_proxy=http://127.0.0.1:7890) |
| lux unset | Clear all stored proxy configuration |
| lux show env | Display stored proxy environment variables |
| lux vpn cmd | Copy CMD proxy commands to clipboard |
| lux vpn pw | Copy PowerShell proxy commands to clipboard |
| lux vpn bash | Copy Bash proxy commands to clipboard |
| lux update | Update @luxkit/cli to the latest version |
| lux update --check | Check for available updates without installing |
Available Presets
| Preset | Fmt | VSCode | Stack |
| :--------- | :-: | :----: | :--------------------------- |
| web | ✅ | ✅ | Vue / React / TS / CSS |
| electron | ✅ | ✅ | Electron + Web stack |
| uniapp | ✅ | ✅ | UniApp / WeChat Mini Program |
| node | ✅ | ✅ | Node.js backend |
| nest | ✅ | ✅ | NestJS backend |
| go | — | ✅ | Go backend |
Options
lux fmt <preset> [options]
--force Force overwrite existing files
--no-install Skip dependency installation
--dry-run Preview without writing filesHow It Works
lux fmt web
│
▼
Parse CLI args ──► Resolve preset (fuzzy match on typo)
│
▼
For each config file:
│
├── File not found? ──► Create
├── In neverOverwrite? ──► Skip
├── In forceOverwrite? ──► Overwrite
└── Exists + --force? ──► Overwrite / Skip
│
▼
Inject scripts into package.json (<pm> → bun run / pnpm run / ...)
│
▼
Auto-install devDependencies (detects lockfile)Tech Stack
| Category | Technology | | :------- | :----------------------------------------- | | Language | TypeScript 6.0 (ESM-only) | | Runtime | Node.js 18+ | | Build | tsup | | Test | Vitest (unit + acceptance) | | CLI | Commander.js | | Output | Chalk | | Bundle | Zero runtime deps (chalk + commander only) |
Development
git clone [email protected]:TTT1231/lux.git
cd lux
bun install
bun link # Register `lux` globally for testing
lux fmt web # Test it on any project
bun test # Run tests
bun build # Build to dist/
bun code:check:all # lint + format + spell check🤝 Support
If you have any questions or run into issues, feel free to open an issue on GitHub.
📄 License
ISC — Free to use, modify, and distribute.
