@kitschpatrol/snip 0.0.11 → 0.0.13

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.
Files changed (4) hide show
  1. package/dist/cli.js +3 -37807
  2. package/license.txt +1 -1
  3. package/package.json +27 -21
  4. package/readme.md +167 -27
package/license.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-2025 Eric Mika
3
+ Copyright (c) 2023-2026 Eric Mika
4
4
 
5
5
  Based on the MIT-licensed "Snipster" project by Jared Hanstra
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/snip",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "A CLI tool for snippet management.",
5
5
  "keywords": [
6
6
  "cli",
@@ -26,6 +26,7 @@
26
26
  "url": "https://github.com/jhanstra"
27
27
  }
28
28
  ],
29
+ "sideEffects": false,
29
30
  "type": "module",
30
31
  "bin": {
31
32
  "snip": "./dist/cli.js"
@@ -37,42 +38,47 @@
37
38
  "@commander-js/extra-typings": "^14.0.0",
38
39
  "@types/fs-extra": "^11.0.4",
39
40
  "@types/ignore-walk": "^4.0.3",
40
- "@types/inquirer": "^9.0.9",
41
- "commander": "^14.0.2",
41
+ "commander": "^14.0.3",
42
+ "date-fns": "^4.1.0",
42
43
  "execa": "^9.6.1",
43
- "fs-extra": "^11.3.2",
44
+ "fs-extra": "^11.3.4",
44
45
  "ignore-walk": "^8.0.0",
45
- "inquirer": "^12.11.1"
46
+ "inquirer": "^13.4.0",
47
+ "lognow": "^0.6.1",
48
+ "untildify": "^6.0.0",
49
+ "zod": "^4.3.6"
46
50
  },
47
51
  "devDependencies": {
48
- "@kitschpatrol/shared-config": "^5.10.0",
49
- "@types/node": "^20.19.25",
50
- "bumpp": "^10.3.2",
51
- "date-fns": "^4.1.0",
52
- "mdat-plugin-cli-help": "^1.0.4",
53
- "picocolors": "^1.1.1",
54
- "pkgroll": "^2.21.4",
55
- "tslog": "^4.10.2",
52
+ "@kitschpatrol/shared-config": "^7.1.0",
53
+ "@types/node": "^20.19.39",
54
+ "bumpp": "^11.0.1",
55
+ "mdat-plugin-cli-help": "^2.1.1",
56
+ "publint": "^0.3.18",
57
+ "tsdown": "^0.21.7",
56
58
  "tsx": "^4.21.0",
57
59
  "typescript": "~5.9.3",
58
- "untildify": "^6.0.0",
59
- "vitest": "^4.0.15",
60
- "zod": "^3.25.76"
60
+ "vitest": "^4.1.2"
61
61
  },
62
62
  "engines": {
63
- "node": ">=20.9.0"
63
+ "node": ">=20.17.0"
64
+ },
65
+ "devEngines": {
66
+ "runtime": {
67
+ "name": "node",
68
+ "version": ">=22.18.0"
69
+ }
64
70
  },
65
71
  "publishConfig": {
66
72
  "access": "public"
67
73
  },
68
74
  "scripts": {
69
- "build": "pkgroll --clean-dist",
75
+ "build": "tsdown",
70
76
  "clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
71
- "fix": "kpi fix",
72
- "lint": "kpi lint",
77
+ "fix": "ksc fix",
78
+ "lint": "ksc lint",
73
79
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
74
80
  "start": "node ./dist/cli.js",
75
- "test": "vitest",
81
+ "test": "vitest run",
76
82
  "update-language-data": "tsx ./scripts/update-vscode-language-data.ts"
77
83
  }
78
84
  }
package/readme.md CHANGED
@@ -1,5 +1,3 @@
1
- <!--+ Warning: Content inside HTML comment blocks was generated by mdat and may be overwritten. +-->
2
-
3
1
  <!-- title -->
4
2
 
5
3
  # @kitschpatrol/snip
@@ -10,6 +8,7 @@
10
8
 
11
9
  [![NPM Package @kitschpatrol/snip](https://img.shields.io/npm/v/@kitschpatrol/snip.svg)](https://npmjs.com/package/@kitschpatrol/snip)
12
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+ [![CI](https://github.com/kitschpatrol/snip/actions/workflows/ci.yml/badge.svg)](https://github.com/kitschpatrol/snip/actions/workflows/ci.yml)
13
12
 
14
13
  <!-- /badges -->
15
14
 
@@ -52,39 +51,180 @@ TK
52
51
 
53
52
  <!-- cli-help -->
54
53
 
55
- ```txt
56
- Usage: snip [options] [command]
54
+ #### Command: `snip`
57
55
 
58
56
  A CLI tool for snippet management.
59
57
 
60
- Options:
61
- -v, --version output the version number
62
- -c, --config <path> path to configuration file (default:
63
- "~/.config/snip/config.json", env:
64
- SNIP_CONFIG_FILE)
65
- -l, --library <path> path to library directory where snippets are
66
- stored (default: "~/.snip", env:
67
- SNIP_LIBRARY_DIR)
68
- -d, --debug extra logging for troubleshooting (default:
69
- false, env: SNIP_DEBUG)
70
- -h, --help display help for command
71
-
72
- Commands:
73
- add [filename] add a snippet
74
- cd launch a shell in the snippets directory
75
- list list all snippets
76
- setup set up snip
77
- sync-to-editors [editors...] sync snippets to editors
78
- sync-from-editors [editors...] sync snippets from editors (not yet
79
- implemented)
80
- help [command] display help for command
58
+ This section lists top-level commands for `snip`.
59
+
60
+ Usage:
61
+
62
+ ```txt
63
+ snip [options] [command]
64
+ ```
65
+
66
+ | Command | Argument | Description |
67
+ | ------------------- | -------------- | ------------------------------------------------ |
68
+ | `add` | `[filename]` | add a snippet |
69
+ | `cd` | | launch a shell in the snippets directory |
70
+ | `list` | | list all snippets |
71
+ | `setup` | | set up snip |
72
+ | `sync-to-editors` | `[editors...]` | sync snippets to editors |
73
+ | `sync-from-editors` | `[editors...]` | sync snippets from editors (not yet implemented) |
74
+
75
+ | Option | Argument | Description | Default |
76
+ | ------------------- | -------- | --------------------------------------------------- | ---------------------------- |
77
+ | `--version`<br>`-v` | | output the version number | |
78
+ | `--config`<br>`-c` | `<path>` | path to configuration file | `~/.config/snip/config.json` |
79
+ | `--library`<br>`-l` | `<path>` | path to library directory where snippets are stored | `~/.snip` |
80
+ | `--debug`<br>`-d` | | extra logging for troubleshooting | `false` |
81
+ | `--help`<br>`-h` | | display help for command | |
82
+
83
+ _See the sections below for more information on each subcommand._
84
+
85
+ #### Subcommand: `snip add`
86
+
87
+ add a snippet
88
+
89
+ Usage:
90
+
91
+ ```txt
92
+ snip add [options] [filename]
81
93
  ```
82
94
 
95
+ | Positional Argument | Description |
96
+ | ------------------- | --------------- |
97
+ | `filename` | name of snippet |
98
+
99
+ | Option | Description |
100
+ | ---------------- | ------------------------ |
101
+ | `--help`<br>`-h` | display help for command |
102
+
103
+ #### Subcommand: `snip cd`
104
+
105
+ launch a shell in the snippets directory
106
+
107
+ Usage:
108
+
109
+ ```txt
110
+ snip cd [options]
111
+ ```
112
+
113
+ | Option | Description |
114
+ | ---------------- | ------------------------ |
115
+ | `--help`<br>`-h` | display help for command |
116
+
117
+ #### Subcommand: `snip list`
118
+
119
+ list all snippets
120
+
121
+ Usage:
122
+
123
+ ```txt
124
+ snip list [options]
125
+ ```
126
+
127
+ | Option | Description |
128
+ | ---------------- | ------------------------ |
129
+ | `--help`<br>`-h` | display help for command |
130
+
131
+ #### Subcommand: `snip setup`
132
+
133
+ set up snip
134
+
135
+ Usage:
136
+
137
+ ```txt
138
+ snip setup [options]
139
+ ```
140
+
141
+ | Option | Description |
142
+ | ---------------- | ------------------------ |
143
+ | `--help`<br>`-h` | display help for command |
144
+
145
+ #### Subcommand: `snip sync-to-editors`
146
+
147
+ sync snippets to editors
148
+
149
+ Usage:
150
+
151
+ ```txt
152
+ snip sync-to-editors [options] [editors...]
153
+ ```
154
+
155
+ | Positional Argument | Description | Default |
156
+ | ------------------- | ------------------ | ------------ |
157
+ | `editors` | editors to sync to | `["vscode"]` |
158
+
159
+ | Option | Description |
160
+ | ---------------- | ------------------------ |
161
+ | `--help`<br>`-h` | display help for command |
162
+
163
+ #### Subcommand: `snip sync-from-editors`
164
+
165
+ sync snippets from editors (not yet implemented)
166
+
167
+ Usage:
168
+
169
+ ```txt
170
+ snip sync-from-editors [options] [editors...]
171
+ ```
172
+
173
+ | Positional Argument | Description | Default |
174
+ | ------------------- | ------------------ | ------------ |
175
+ | `editors` | editors to sync to | `["vscode"]` |
176
+
177
+ | Option | Description |
178
+ | ---------------- | ------------------------ |
179
+ | `--help`<br>`-h` | display help for command |
180
+
83
181
  <!-- /cli-help -->
84
182
 
85
- #### Examples
183
+ ### Examples
86
184
 
87
- TK
185
+ Set up snip for the first time:
186
+
187
+ ```sh
188
+ snip setup
189
+ # Enter a pathname for your snippets library (~/.snip):
190
+ ```
191
+
192
+ Add a new snippet interactively — snip prompts for a prefix, description, and language, then opens your `$EDITOR`:
193
+
194
+ ```sh
195
+ snip add
196
+ # Prefix (the trigger keyword for your snippet): cl
197
+ # A quick description of your snippet (optional): Print value to console
198
+ # Language (...): js+ts+jsx+tsx
199
+ # Opens your editor to write the snippet body...
200
+ ```
201
+
202
+ Or pass a filename directly:
203
+
204
+ ```sh
205
+ snip add "cl--Print value to console.js+ts+jsx+tsx"
206
+ ```
207
+
208
+ List all snippets in your library:
209
+
210
+ ```sh
211
+ snip list
212
+ # cl--Print value to console.js+ts+jsx+tsx
213
+ # html--HTML 5 boilerplate.html
214
+ # li--Lorem Ipsum.all
215
+ ```
216
+
217
+ Sync your snippet library to VS Code:
218
+
219
+ ```sh
220
+ snip sync-to-editors vscode
221
+ ```
222
+
223
+ Jump into your snippets directory to edit files directly:
224
+
225
+ ```sh
226
+ snip cd
227
+ ```
88
228
 
89
229
  ## Background
90
230