@luxkit/cli 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -76
- package/dist/index.js +842 -384
- package/dist/skills/lux/references/custom-preset-setting.md +67 -0
- package/dist/skills/lux/skill.md +12 -2
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -18,48 +18,29 @@
|
|
|
18
18
|
|
|
19
19
|
### What is lux?
|
|
20
20
|
|
|
21
|
-
`lux` is a CLI tool that
|
|
21
|
+
`lux` is a CLI tool that sets up project lint configs and VSCode workspace settings with a single command — saving you from repetitive configuration overhead and wasted tokens. It generates ESLint, Prettier, CSpell, Stylelint,EditorConfig configs and VSCode settings from presets — with smart merge and conflict resolution. Configurations can be customized to your needs.
|
|
22
22
|
|
|
23
23
|
<div align="center">
|
|
24
24
|
<img src="https://github.com/TTT1231/lux/blob/main/demo.gif?raw=true" alt="lux demo" width="640" />
|
|
25
25
|
</div>
|
|
26
26
|
|
|
27
|
-
### ✨ Key Highlights
|
|
28
|
-
|
|
29
|
-
| Feature | Description |
|
|
30
|
-
| :------------------------- | :--------------------------------------------------------------------------------------------------- |
|
|
31
|
-
| 🎯 **One Command Setup** | `lux fmt web-vue` generates all linting & formatting configs instantly |
|
|
32
|
-
| 🔧 **6 Fmt Presets** | `web-vue` · `web-react` · `electron-vue` · `uniapp` · `node` · `nest` — each with curated rules |
|
|
33
|
-
| 🖥️ **7 VSCode Presets** | `web-vue` · `web-react` · `electron-vue` · `uniapp` · `node` · `nest` · `go` — settings + extensions |
|
|
34
|
-
| 🔀 **Smart Merge** | Preset wins for linting keys; user wins for personal preferences |
|
|
35
|
-
| 🛡️ **Conflict Resolution** | `neverOverwrite` / `forceOverwrite` lists + `--force` flag |
|
|
36
|
-
| 📦 **Auto Install** | Detects bun / pnpm / yarn / npm and installs devDependencies |
|
|
37
|
-
| 🔍 **Fuzzy Matching** | Typo a preset name? Levenshtein distance finds the closest match |
|
|
38
|
-
| 🧪 **Dry Run** | Preview all changes with `--dry-run` before writing anything |
|
|
39
|
-
| 🔗 **Script Injection** | Auto-injects `<pm> lint` / `<pm> format` scripts into package.json |
|
|
40
|
-
| 🌐 **Proxy Management** | Persistent proxy config with `set` / `unset` — copy to CMD / PowerShell / Bash |
|
|
41
|
-
| 🔄 **Self-Update** | `lux update` checks and installs the latest version automatically |
|
|
42
|
-
|
|
43
|
-
<br />
|
|
44
|
-
|
|
45
27
|
### Quick Start
|
|
46
28
|
|
|
47
29
|
```bash
|
|
48
30
|
# Install globally (pick your package manager)
|
|
49
31
|
npm install -g @luxkit/cli
|
|
50
|
-
# or
|
|
51
|
-
bun add -g @luxkit/cli
|
|
52
32
|
|
|
53
|
-
# Initialize
|
|
54
|
-
lux
|
|
33
|
+
# Initialize skill and preset
|
|
34
|
+
lux init && lux init --preset
|
|
35
|
+
|
|
36
|
+
# Lint usage
|
|
37
|
+
lux fmt web-vue # Configure web-vue lint — ESLint, Prettier, CSpell
|
|
55
38
|
lux fmt web-vue --stylelint # Also include Stylelint
|
|
56
39
|
lux fmt web-vue --editorconfig # Also include EditorConfig
|
|
57
40
|
|
|
58
|
-
#
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# Initialize AI coding tool skills
|
|
62
|
-
lux init # Select tool interactively, copy skills to project
|
|
41
|
+
# VSCode config (optional)
|
|
42
|
+
# If you've already configured globally, you can skip this
|
|
43
|
+
lux vscode web-vue # Generate .vscode/settings.json + extensions.json (per-project)
|
|
63
44
|
|
|
64
45
|
# List available presets
|
|
65
46
|
lux fmt list
|
|
@@ -68,15 +49,26 @@ lux vscode list
|
|
|
68
49
|
|
|
69
50
|
<br />
|
|
70
51
|
|
|
52
|
+
### Custom Configuration
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Check if skill and presets are initialized (skip if already done)
|
|
56
|
+
lux init && lux init --preset
|
|
57
|
+
|
|
58
|
+
# Use an agent to customize a preset
|
|
59
|
+
/lux help me configure my web react lint template to fit my development project style
|
|
60
|
+
```
|
|
61
|
+
|
|
71
62
|
### CLI Commands
|
|
72
63
|
|
|
73
64
|
| Command | Description |
|
|
74
65
|
| :-------------------------- | :---------------------------------------------------------------- |
|
|
75
|
-
| `lux fmt <preset>` | Initialize
|
|
76
|
-
| `lux fmt list` | List available
|
|
77
|
-
| `lux vscode <preset>` |
|
|
66
|
+
| `lux fmt <preset>` | Initialize lint configs |
|
|
67
|
+
| `lux fmt list` | List available lint presets |
|
|
68
|
+
| `lux vscode <preset>` | Configure VSCode settings (per-project) |
|
|
78
69
|
| `lux vscode list` | List available VSCode presets |
|
|
79
|
-
| `lux init` | Initialize
|
|
70
|
+
| `lux init` | Initialize skills |
|
|
71
|
+
| `lux init --preset` | Initialize all presets |
|
|
80
72
|
| `lux set <key=value> [...]` | Persist proxy env vars (e.g. `https_proxy=http://127.0.0.1:7890`) |
|
|
81
73
|
| `lux unset` | Clear all stored proxy configuration |
|
|
82
74
|
| `lux show env` | Display stored proxy environment variables |
|
|
@@ -88,19 +80,6 @@ lux vscode list
|
|
|
88
80
|
|
|
89
81
|
<br />
|
|
90
82
|
|
|
91
|
-
### Available Presets
|
|
92
|
-
|
|
93
|
-
| Preset | Fmt | VSCode | Stack |
|
|
94
|
-
| :------------- | :-: | :----: | :------------------------- |
|
|
95
|
-
| `web-vue` | ✅ | ✅ | Vue 3 / Vite / TS / CSS |
|
|
96
|
-
| `web-react` | ✅ | ✅ | React / Vite / TS / CSS |
|
|
97
|
-
| `electron-vue` | ✅ | ✅ | Electron + Vue / Web stack |
|
|
98
|
-
| `node` | ✅ | ✅ | Node.js backend |
|
|
99
|
-
| `nest` | ✅ | ✅ | NestJS backend |
|
|
100
|
-
| `go` | — | ✅ | Go backend |
|
|
101
|
-
|
|
102
|
-
<br />
|
|
103
|
-
|
|
104
83
|
### Options
|
|
105
84
|
|
|
106
85
|
```bash
|
|
@@ -111,6 +90,7 @@ lux fmt <preset> [options]
|
|
|
111
90
|
--dry-run Preview without writing files
|
|
112
91
|
--stylelint Include Stylelint config generation (opt-in)
|
|
113
92
|
--editorconfig Include EditorConfig config generation (opt-in)
|
|
93
|
+
--reset Reset local preset and re-create from built-in defaults
|
|
114
94
|
```
|
|
115
95
|
|
|
116
96
|
<br />
|
|
@@ -124,6 +104,12 @@ lux fmt web-vue
|
|
|
124
104
|
Parse CLI args ──► Resolve preset (fuzzy match on typo)
|
|
125
105
|
│
|
|
126
106
|
▼
|
|
107
|
+
Local preset exists in ~/.lux/preset/?
|
|
108
|
+
│
|
|
109
|
+
├── Yes ──► Copy files from local preset (editable, survives updates)
|
|
110
|
+
└── No ──► Generate from built-in ──► Save to ~/.lux/preset/ for reuse
|
|
111
|
+
│
|
|
112
|
+
▼
|
|
127
113
|
For each config file:
|
|
128
114
|
│
|
|
129
115
|
├── File not found? ──► Create
|
|
@@ -140,37 +126,6 @@ lux fmt web-vue
|
|
|
140
126
|
|
|
141
127
|
<br />
|
|
142
128
|
|
|
143
|
-
### Tech Stack
|
|
144
|
-
|
|
145
|
-
| Category | Technology |
|
|
146
|
-
| :------- | :----------------------------------------- |
|
|
147
|
-
| Language | TypeScript 6.0 (ESM-only) |
|
|
148
|
-
| Runtime | Node.js 18+ |
|
|
149
|
-
| Build | tsup |
|
|
150
|
-
| Test | Vitest (unit + acceptance) |
|
|
151
|
-
| CLI | Commander.js |
|
|
152
|
-
| Output | Chalk |
|
|
153
|
-
| Bundle | Minimal runtime deps (chalk + commander + @clack/prompts) |
|
|
154
|
-
|
|
155
|
-
<br />
|
|
156
|
-
|
|
157
|
-
### Development
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
git clone git@github.com:TTT1231/lux.git
|
|
161
|
-
cd lux
|
|
162
|
-
bun install
|
|
163
|
-
|
|
164
|
-
bun link # Register `lux` globally for testing
|
|
165
|
-
lux fmt web-vue # Test it on any project
|
|
166
|
-
|
|
167
|
-
bun test # Run tests
|
|
168
|
-
bun build # Build to dist/
|
|
169
|
-
bun code:check:all # lint + format + spell check
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
<br />
|
|
173
|
-
|
|
174
129
|
### 🤝 Support
|
|
175
130
|
|
|
176
131
|
If you have any questions or run into issues, feel free to [open an issue](https://github.com/TTT1231/lux/issues) on GitHub.
|