@kitschpatrol/snip 0.0.12 → 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 (3) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +3 -3
  3. package/readme.md +166 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/snip",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A CLI tool for snippet management.",
5
5
  "keywords": [
6
6
  "cli",
@@ -43,7 +43,7 @@
43
43
  "execa": "^9.6.1",
44
44
  "fs-extra": "^11.3.4",
45
45
  "ignore-walk": "^8.0.0",
46
- "inquirer": "^13.3.2",
46
+ "inquirer": "^13.4.0",
47
47
  "lognow": "^0.6.1",
48
48
  "untildify": "^6.0.0",
49
49
  "zod": "^4.3.6"
@@ -52,7 +52,7 @@
52
52
  "@kitschpatrol/shared-config": "^7.1.0",
53
53
  "@types/node": "^20.19.39",
54
54
  "bumpp": "^11.0.1",
55
- "mdat-plugin-cli-help": "^2.0.2",
55
+ "mdat-plugin-cli-help": "^2.1.1",
56
56
  "publint": "^0.3.18",
57
57
  "tsdown": "^0.21.7",
58
58
  "tsx": "^4.21.0",
package/readme.md CHANGED
@@ -51,39 +51,180 @@ TK
51
51
 
52
52
  <!-- cli-help -->
53
53
 
54
- ```txt
55
- Usage: snip [options] [command]
54
+ #### Command: `snip`
56
55
 
57
56
  A CLI tool for snippet management.
58
57
 
59
- Options:
60
- -v, --version output the version number
61
- -c, --config <path> path to configuration file (default:
62
- "~/.config/snip/config.json", env:
63
- SNIP_CONFIG_FILE)
64
- -l, --library <path> path to library directory where snippets are
65
- stored (default: "~/.snip", env:
66
- SNIP_LIBRARY_DIR)
67
- -d, --debug extra logging for troubleshooting (default:
68
- false, env: SNIP_DEBUG)
69
- -h, --help display help for command
70
-
71
- Commands:
72
- add [filename] add a snippet
73
- cd launch a shell in the snippets directory
74
- list list all snippets
75
- setup set up snip
76
- sync-to-editors [editors...] sync snippets to editors
77
- sync-from-editors [editors...] sync snippets from editors (not yet
78
- implemented)
79
- 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]
93
+ ```
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...]
80
153
  ```
81
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
+
82
181
  <!-- /cli-help -->
83
182
 
84
- #### Examples
183
+ ### Examples
85
184
 
86
- 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
+ ```
87
228
 
88
229
  ## Background
89
230