skill-search 0.0.1

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 ADDED
@@ -0,0 +1,381 @@
1
+ # Skill Search
2
+
3
+ > A lightweight Node.js CLI tool for quick retrieval of skill documentation from GitHub repositories 🚀
4
+
5
+ **Skill Search** is a command-line interface tool designed to help developers and users quickly access skill documentation (Markdown format) stored on GitHub, enhancing learning and reference efficiency.
6
+
7
+ ## ✨ Features
8
+
9
+ - 🖥️ **Interactive TUI**: Modern text-based user interface with keyboard navigation
10
+ - 🔍 **Fast Access**: Retrieve skill documentation with a single command, no browser required
11
+ - 💾 **Smart Caching**: Local caching to reduce network requests and support offline access
12
+ - 🎯 **Intelligent Matching**: Supports exact matching, keyword matching, and fuzzy search
13
+ - 🎨 **Beautiful Output**: Terminal-friendly Markdown formatting and display
14
+ - 📋 **Convenient Operations**: Support for copying to clipboard or saving to files
15
+ - 🔧 **Flexible Configuration**: Support for multiple skill directory sources and API configurations
16
+
17
+ ## 📦 Installation & Development
18
+
19
+ ### Multi-Device Development Environment Setup (Recommended)
20
+
21
+ If you sync code across multiple devices using OneDrive/Dropbox, use the following installation method to avoid `node_modules` conflicts between devices:
22
+
23
+ 1. **Run Setup Script** (Windows):
24
+ Double-click to run `scripts/setup-env.bat`
25
+
26
+ Or execute in terminal:
27
+ ```bash
28
+ .\scripts\setup-env.bat
29
+ ```
30
+ *This will create independent dependency directories based on device names in `.local/DEVICE_NAME/node_modules` and link them to the root directory.*
31
+
32
+ 2. **Link Command**:
33
+ ```bash
34
+ npm link
35
+ ```
36
+
37
+ ### Standard Installation
38
+
39
+ ```bash
40
+ # Global installation
41
+ npm install -g skill-search
42
+
43
+ # Local development
44
+ npm install
45
+ npm link
46
+ ```
47
+
48
+ ## 🛠️ Usage Guide
49
+
50
+ ### 0. TUI Interactive Mode (Recommended)
51
+
52
+ Launch the interactive TUI interface by running `skill` without arguments:
53
+
54
+ ```bash
55
+ skill # Launch TUI (default when no arguments provided)
56
+ skill --tui # Explicitly specify TUI mode
57
+ ```
58
+
59
+ **Keyboard Shortcuts**:
60
+ - `↑↓` Navigate up/down | `Tab` Switch panes | `Enter` Select
61
+ - `/` Search | `l` List | `y` Sync | `c` Config | `q` Quit
62
+
63
+ ### 1. Get Skill Documentation
64
+
65
+ Retrieve documentation by skill ID or keyword:
66
+
67
+ ```bash
68
+ skill <keyword> [options]
69
+ ```
70
+
71
+ **Examples**:
72
+ ```bash
73
+ # Get React-related documentation
74
+ skill react
75
+
76
+ # Copy Git workflow documentation to clipboard
77
+ skill git-workflow --copy
78
+
79
+ # Save Docker documentation to local file
80
+ skill docker -o ./docker-guide.md
81
+
82
+ # Force refresh from remote (ignore cache)
83
+ skill typescript --no-cache
84
+ ```
85
+
86
+ **Options**:
87
+ - `-c, --copy`: Copy content to clipboard
88
+ - `-r, --raw`: Output raw Markdown content (no terminal formatting)
89
+ - `-o, --output <file>`: Save content to specified file
90
+ - `--no-cache`: Ignore local cache, force remote fetch
91
+
92
+ ### 2. Search Skills
93
+
94
+ Search for skills locally:
95
+
96
+ ```bash
97
+ skill search <query>
98
+ # Alias
99
+ skill s <query>
100
+ ```
101
+
102
+ **Examples**:
103
+ ```bash
104
+ skill search frontend
105
+ skill s hooks
106
+ ```
107
+
108
+ ### 3. List All Skills
109
+
110
+ Display all locally available skills:
111
+
112
+ ```bash
113
+ skill list
114
+ # Alias
115
+ skill ls
116
+ ```
117
+
118
+ ### 4. Cache Management
119
+
120
+ Manage local cache (stored by default in `~/.skill-search/`):
121
+
122
+ ```bash
123
+ # List cached documentation
124
+ skill cache list
125
+
126
+ # Clear all cache
127
+ skill cache clear
128
+ ```
129
+
130
+ ### 5. Directory Management
131
+
132
+ #### Add Custom Skill Paths
133
+
134
+ Add custom skill directory paths beyond the default locations:
135
+
136
+ ```bash
137
+ skill add <path>
138
+ ```
139
+
140
+ **Example**:
141
+ ```bash
142
+ skill add /path/to/my/custom/skills
143
+ ```
144
+
145
+ #### Remove Custom Skill Paths
146
+
147
+ Remove a custom skill directory path:
148
+
149
+ ```bash
150
+ skill remove <path>
151
+ # Alias
152
+ skill rm <path>
153
+ ```
154
+
155
+ #### Set Primary Directory
156
+
157
+ Configure the primary skill directory:
158
+
159
+ ```bash
160
+ skill primary [directory]
161
+ ```
162
+
163
+ Available directories:
164
+ - `.skill-search` - Default Skill Search directory
165
+ - `.claude` - Claude AI directory
166
+ - `.codex` - OpenAI Codex directory
167
+ - `.gemini` - Google Gemini directory
168
+ - `.copilot` - GitHub Copilot directory
169
+
170
+ **Example**:
171
+ ```bash
172
+ skill primary claude
173
+ ```
174
+
175
+ ### 6. Theme Management
176
+
177
+ Switch between dark and light themes in TUI mode:
178
+
179
+ ```bash
180
+ skill theme [mode]
181
+ ```
182
+
183
+ **Examples**:
184
+ ```bash
185
+ skill theme dark
186
+ skill theme light
187
+ skill theme # Toggle between themes
188
+ ```
189
+
190
+ ## ⚙️ Configuration
191
+
192
+ Default API configuration is located in `src/config.js`. You can modify this file to point to your own GitHub repository:
193
+
194
+ ```javascript
195
+ module.exports = {
196
+ api: {
197
+ baseUrl: 'https://skillsmp.com/api/v1',
198
+ // API Key should be configured by user
199
+ },
200
+ github: {
201
+ owner: 'your-username', // Your GitHub username
202
+ repo: 'your-skills-repo', // Your repository name
203
+ branch: 'main', // Branch name
204
+ // ...
205
+ }
206
+ };
207
+ ```
208
+
209
+ ### API Configuration
210
+
211
+ Set up API access for remote skill search:
212
+
213
+ ```bash
214
+ skill config --api-key <your-api-key>
215
+ ```
216
+
217
+ ## 📂 Project Structure
218
+
219
+ ```
220
+ skill-search/
221
+ ├── bin/
222
+ │ ├── skill.js # CLI entry point
223
+ │ └── tui.js # TUI entry point
224
+ ├── scripts/
225
+ │ └── setup-env.bat # Multi-device environment setup
226
+ ├── src/
227
+ │ ├── config.js # Configuration management
228
+ │ ├── api.js # SkillsMP API client
229
+ │ ├── store.js # Local data storage
230
+ │ ├── syncer.js # Sync operations
231
+ │ ├── cache.js # Cache management
232
+ │ ├── matcher.js # Skill matching and search (Fuse.js)
233
+ │ ├── localCrawler.js # Local skill directory scanning
234
+ │ ├── interactive.js # Interactive skill selection
235
+ │ ├── actions.js # Action handlers (sync, move, delete)
236
+ │ ├── utils.js # Utility functions (Markdown rendering, clipboard)
237
+ │ ├── theme.js # Theme management
238
+ │ └── tui/ # TUI components
239
+ │ ├── App.js # Main TUI application
240
+ │ ├── SearchView.js # Search interface
241
+ │ ├── SyncView.js # Sync management
242
+ │ ├── ConfigView.js # Configuration interface
243
+ │ ├── ThemeView.js # Theme selection
244
+ │ ├── PrimaryView.js # Primary directory selection
245
+ │ ├── AddDelView.js # Custom path management
246
+ │ ├── ActionModal.js # Action confirmation modal
247
+ │ └── ... # Other UI components
248
+ ├── package.json
249
+ └── README.md
250
+ ```
251
+
252
+ ## 🔄 Sync Operations
253
+
254
+ ### Local Sync
255
+
256
+ Sync locally discovered skills to the primary directory:
257
+
258
+ ```bash
259
+ skill sync --docs
260
+ ```
261
+
262
+ ### Remote Sync
263
+
264
+ Download all remote skills to the primary directory:
265
+
266
+ ```bash
267
+ skill sync --full
268
+ ```
269
+
270
+ ### Sync Specific Skill
271
+
272
+ Sync only a specific skill:
273
+
274
+ ```bash
275
+ skill sync --id <skill-id>
276
+ ```
277
+
278
+ ### Full Sync
279
+
280
+ Sync both local and remote skills:
281
+
282
+ ```bash
283
+ skill sync --force
284
+ ```
285
+
286
+ ### Sync Status
287
+
288
+ Check sync status and history:
289
+
290
+ ```bash
291
+ skill sync --status
292
+ ```
293
+
294
+ ## 🎨 TUI Interface
295
+
296
+ The Text User Interface provides a modern, keyboard-driven experience:
297
+
298
+ - **Dual-Pane Layout**: Local and remote skill results side by side
299
+ - **Keyboard Navigation**: Arrow keys, Tab, and shortcuts for efficient browsing
300
+ - **Real-time Search**: Instant local search as you type
301
+ - **Action Modals**: Context menus for sync, move, delete, and open operations
302
+ - **Theme Support**: Dark and light themes with customizable colors
303
+
304
+ ### TUI Navigation
305
+
306
+ - **Search**: Type to search locally, press Enter for remote search
307
+ - **Navigation**: Tab between local/remote panes, arrows to select items
308
+ - **Actions**: Enter to open action modal, Shift+O to open directly
309
+ - **Pagination**: `[` and `]` for previous/next page
310
+ - **Commands**: `/` to access command palette
311
+
312
+ ## 📋 Dependencies
313
+
314
+ **Runtime Dependencies**:
315
+ - `axios`: HTTP client for API requests
316
+ - `chalk`: Terminal text styling
317
+ - `clipboardy`: Clipboard operations
318
+ - `commander`: CLI argument parsing
319
+ - `fuse.js`: Fuzzy search implementation
320
+ - `ink`: React-based terminal UI framework
321
+ - `inquirer`: Interactive CLI prompts
322
+ - `marked`: Markdown parser
323
+ - `marked-terminal`: Terminal Markdown rendering
324
+ - `ora`: Terminal spinners
325
+ - `react`: UI framework for TUI
326
+
327
+ **Development Dependencies**:
328
+ - `eslint`: Code linting
329
+ - `jest`: Testing framework
330
+ - `pkg`: Binary packaging
331
+ - `prettier`: Code formatting
332
+
333
+ ## 🔧 Development
334
+
335
+ ### Building
336
+
337
+ Create executable binaries for multiple platforms:
338
+
339
+ ```bash
340
+ npm run build
341
+ ```
342
+
343
+ This generates binaries in the `dist/` directory for Linux, macOS, and Windows.
344
+
345
+ ### Testing
346
+
347
+ ```bash
348
+ npm test
349
+ ```
350
+
351
+ ### Code Quality
352
+
353
+ ```bash
354
+ # Lint code
355
+ npx eslint src/
356
+
357
+ # Format code
358
+ npx prettier --write src/
359
+ ```
360
+
361
+ ## 🤝 Contributing
362
+
363
+ 1. Fork the repository
364
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
365
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
366
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
367
+ 5. Open a Pull Request
368
+
369
+ ## 📝 License
370
+
371
+ ISC
372
+
373
+ ## 🙏 Acknowledgments
374
+
375
+ - Built with [Ink](https://github.com/vadimdemedes/ink) for terminal UI
376
+ - Powered by [Fuse.js](https://fusejs.io/) for fuzzy search
377
+ - Markdown rendering with [Marked](https://marked.js.org/)
378
+
379
+ ---
380
+
381
+ **Happy Skill Hunting! 🎯**