@jacebenson/jsn 1.0.7 → 2.0.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.
Files changed (45) hide show
  1. package/README.md +196 -243
  2. package/bin/jsn.js +2 -57
  3. package/package.json +35 -32
  4. package/skills/servicenow/SKILL.md +137 -0
  5. package/src/app.js +194 -0
  6. package/src/auth.js +517 -0
  7. package/src/cli.js +174 -0
  8. package/src/commands/_ticket.js +260 -0
  9. package/src/commands/auth.js +227 -0
  10. package/src/commands/catalog.js +325 -0
  11. package/src/commands/changes.js +7 -0
  12. package/src/commands/dev/_generic.js +342 -0
  13. package/src/commands/dev/_simple.js +89 -0
  14. package/src/commands/dev/eval.js +38 -0
  15. package/src/commands/dev/flows.js +573 -0
  16. package/src/commands/dev/forms.js +313 -0
  17. package/src/commands/dev/lists.js +233 -0
  18. package/src/commands/dev/logs.js +64 -0
  19. package/src/commands/dev/rest.js +64 -0
  20. package/src/commands/dev/scopes.js +156 -0
  21. package/src/commands/dev/updatesets.js +184 -0
  22. package/src/commands/dev.js +53 -0
  23. package/src/commands/groupmembers.js +152 -0
  24. package/src/commands/grouproles.js +152 -0
  25. package/src/commands/groups.js +141 -0
  26. package/src/commands/incidents.js +7 -0
  27. package/src/commands/profiles.js +91 -0
  28. package/src/commands/records.js +171 -0
  29. package/src/commands/requests.js +59 -0
  30. package/src/commands/setup.js +39 -0
  31. package/src/commands/skill.js +144 -0
  32. package/src/commands/tasks.js +7 -0
  33. package/src/commands/tickets.js +121 -0
  34. package/src/commands/users.js +144 -0
  35. package/src/commands/version.js +81 -0
  36. package/src/config.js +154 -0
  37. package/src/context.js +62 -0
  38. package/src/errors.js +101 -0
  39. package/src/help.js +85 -0
  40. package/src/helpers.js +182 -0
  41. package/src/output.js +440 -0
  42. package/src/sdk.js +615 -0
  43. package/scripts/install.sh +0 -227
  44. package/scripts/npm-install.js +0 -235
  45. package/scripts/pre-commit-check.sh +0 -61
package/README.md CHANGED
@@ -4,69 +4,64 @@ A command-line interface for ServiceNow that follows the Unix philosophy: simple
4
4
 
5
5
  ## Installation
6
6
 
7
- ### npm (Cross-platform — recommended for Windows)
7
+ ### npm (recommended — cross-platform)
8
8
 
9
9
  ```bash
10
10
  npm install -g @jacebenson/jsn
11
11
  ```
12
12
 
13
- Works on macOS, Linux, and Windows. The correct binary for your platform is downloaded automatically during install.
13
+ No compilation needed. Works on macOS, Linux, and Windows with Node.js 18+.
14
14
 
15
- ### Download Binary
15
+ > **Note:** As of v0.1.0, the `latest` dist-tag points to the Node.js implementation. This is the version you get with `npm install -g @jacebenson/jsn`.
16
16
 
17
- ```bash
18
- # Download the latest release
19
- curl -L https://github.com/jacebenson/jsn/releases/latest/download/jsn-linux-amd64 -o jsn
20
- chmod +x jsn
21
- sudo mv jsn /usr/local/bin/
22
- ```
23
-
24
- ### Go Install
25
-
26
- ```bash
27
- go install github.com/jacebenson/jsn/cmd/jsn@latest
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ### 1. Setup
33
-
34
- Run the interactive setup to configure your first ServiceNow instance:
17
+ ### Quick Start
35
18
 
36
19
  ```bash
20
+ # Interactive setup
37
21
  jsn setup
38
- ```
39
-
40
- This will:
41
- 1. Ask for your ServiceNow instance URL
42
- 2. Open a browser for OAuth authentication
43
- 3. Set the instance as your default
44
-
45
- ### 2. Verify Authentication
46
22
 
47
- ```bash
23
+ # Check auth status
48
24
  jsn auth status
49
- ```
50
-
51
- ### 3. Start Using
52
25
 
53
- ```bash
54
- # List all incidents
26
+ # List incidents
55
27
  jsn incidents
56
28
 
57
- # Show a specific incident
58
- jsn incidents INC0010001
59
-
60
- # Create a new incident
61
- jsn incidents create --description "Server down" --priority 1
62
-
63
- # List change requests
64
- jsn changes
65
-
66
- # Query any table
67
- jsn records list --table incident --query "priority=1^active=true"
29
+ # Check for updates
30
+ jsn version --check
68
31
  ```
69
32
 
33
+ ## What's New in v0.1.0
34
+
35
+ Full feature parity — 128 tests, lint clean:
36
+
37
+ | Feature | Status |
38
+ |---------|--------|
39
+ | Incident management (CRUD) | ✅ |
40
+ | Change request management (CRUD) | ✅ |
41
+ | Service catalog requests (with attachments + variables) | ✅ |
42
+ | Catalog tasks, generic tickets | ✅ |
43
+ | User management (CRUD) | ✅ |
44
+ | Group management (CRUD) | ✅ |
45
+ | Group memberships and roles | ✅ |
46
+ | Generic Table API (`jsn records`) | ✅ |
47
+ | OAuth PKCE with keychain (shared auth store) | ✅ |
48
+ | Bot/CI/CD auth flags (`--code`, `--print-url`) | ✅ |
49
+ | Dev commands: flows, actions, includes, rules, ACLs, etc. | ✅ |
50
+ | Script execution (`jsn dev eval`) via OAuth session flow | ✅ |
51
+ | Interactive search-as-you-type pickers | ✅ |
52
+ | Output formats: JSON, styled, markdown, quiet | ✅ |
53
+ | Enriched `requests show` with attachments + variables | ✅ |
54
+ | Categorized help system (CORE, DATA, DEV, CONFIG) | ✅ |
55
+
56
+ ### New Commands
57
+
58
+ - **`jsn version --check`** — Check npm registry for newer versions
59
+ - **`jsn skill`** — Manage the jsn AI agent skill file (for Hermes, Claude Code, etc.)
60
+ - `jsn skill show` — Display the bundled skill
61
+ - `jsn skill fetch` — Download latest skill from GitHub
62
+ - `jsn skill path` — Show skill file locations
63
+ - `jsn skill install` — Download + save to Hermes skills directory
64
+
70
65
  ## Configuration
71
66
 
72
67
  JSN uses a layered configuration system:
@@ -81,8 +76,6 @@ JSN uses a layered configuration system:
81
76
 
82
77
  ### Profiles
83
78
 
84
- Work with multiple ServiceNow instances using profiles:
85
-
86
79
  ```bash
87
80
  # Login to a new instance
88
81
  jsn auth login https://dev12345.service-now.com
@@ -99,7 +92,7 @@ jsn profiles show
99
92
 
100
93
  ## Commands
101
94
 
102
- ### Work Commands (Day-to-day operations)
95
+ ### CORE
103
96
 
104
97
  | Command | Aliases | Description |
105
98
  |---------|---------|-------------|
@@ -107,207 +100,154 @@ jsn profiles show
107
100
  | `changes` | `change`, `chg` | Manage change requests |
108
101
  | `requests` | `request`, `req`, `ritm` | Manage service catalog requests |
109
102
  | `tasks` | `task`, `sctask` | Manage service catalog tasks |
103
+ | `tickets` | `ticket` | Query generic tickets |
104
+
105
+ ### DATA & ADMIN
106
+
107
+ | Command | Aliases | Description |
108
+ |---------|---------|-------------|
109
+ | `records` | - | Generic Table API for any table |
110
110
  | `users` | `user` | Manage users |
111
111
  | `groups` | `group` | Manage user groups |
112
- | `records` | - | Generic Table API access |
113
-
114
- ### Dev Commands (Development artifacts)
115
-
116
- | Category | Command | Description |
117
- |----------|---------|-------------|
118
- | **Automations** | `dev flows` | Manage Flow Designer flows |
119
- | | `dev actions` | Manage action definitions |
120
- | **Scripts** | `dev includes` | Manage script includes |
121
- | | `dev rules` | Manage business rules |
122
- | | `dev clientscripts` | Manage client scripts |
123
- | | `dev uiactions` | Manage UI actions |
124
- | | `dev uipolicies` | Manage UI policies |
125
- | **Data** | `dev tables` | View table definitions |
126
- | | `dev columns` | Manage column definitions |
127
- | | `dev import` | Manage import sets |
128
- | **Security** | `dev acls` | Manage access controls |
129
- | | `dev roles` | Manage roles |
130
- | **Platform** | `dev updatesets` | Manage update sets |
131
- | | `dev scopes` | Manage application scopes |
132
- | | `dev properties` | Manage system properties |
133
- | | `dev logs` | Query system logs |
134
- | | `dev rest` | Raw REST API calls |
135
- | | `dev eval` | Execute background scripts |
112
+ | `groupmembers` | `gm` | Manage group memberships |
113
+ | `grouproles` | `gr` | Manage group roles |
114
+
115
+ ### DEVELOPMENT
116
+
117
+ | Command | Description |
118
+ |---------|-------------|
119
+ | `dev flows` | Manage Flow Designer flows |
120
+ | `dev actions` | Manage action definitions |
121
+ | `dev includes` | Manage script includes |
122
+ | `dev rules` | Manage business rules |
123
+ | `dev clientscripts` | Manage client scripts |
124
+ | `dev uiactions` | Manage UI actions |
125
+ | `dev uipolicies` | Manage UI policies |
126
+ | `dev tables` | View table definitions |
127
+ | `dev columns` | Manage column definitions |
128
+ | `dev import` | Manage import sets |
129
+ | `dev acls` | Manage access controls |
130
+ | `dev roles` | Manage roles |
131
+ | `dev updatesets` | Manage update sets |
132
+ | `dev scopes` | Manage application scopes |
133
+ | `dev properties` | Manage system properties |
134
+ | `dev logs` | Query system logs |
135
+ | `dev rest` | Raw REST API calls |
136
+ | `dev eval` | Execute background scripts |
137
+
138
+ ### CONFIGURATION
139
+
140
+ | Command | Description |
141
+ |---------|-------------|
142
+ | `setup` | Interactive first-time setup |
143
+ | `auth` | Manage OAuth authentication |
144
+ | `profiles` | Manage instance profiles |
145
+
146
+ ### UTILITY
147
+
148
+ | Command | Description |
149
+ |---------|-------------|
150
+ | `version` | Show version (use `--check` for update check) |
151
+ | `skill` | Manage the jsn AI agent skill file |
136
152
 
137
153
  ## Usage Examples
138
154
 
139
155
  ### Incidents
140
156
 
141
157
  ```bash
142
- # List all incidents
143
- jsn incidents
144
-
145
- # List critical incidents
146
- jsn incidents list --query "priority=1"
147
-
148
- # Show specific incident
149
- jsn incidents INC0010001
150
-
151
- # Create incident
158
+ jsn incidents # List all
159
+ jsn incidents list --query "priority=1" # Critical only
160
+ jsn incidents INC0010001 # Show specific
152
161
  jsn incidents create --description "Server down" --priority 1
153
-
154
- # Update incident
155
162
  jsn incidents update INC0010001 --data '{"state": "6"}'
156
-
157
- # Delete incident
158
- jsn incidents delete INC0010001
159
163
  ```
160
164
 
161
- ### Changes
165
+ ### Requests (with enriched details)
162
166
 
163
167
  ```bash
164
- # List all change requests
165
- jsn changes
166
-
167
- # List high-risk changes
168
- jsn changes list --query "risk=high"
169
-
170
- # Create change request
171
- jsn changes create --description "Deploy feature" --risk medium
172
-
173
- # Update change
174
- jsn changes update CHG0010001 --data '{"state": "3"}'
175
-
176
- # Delete change
177
- jsn changes delete CHG0010001
168
+ jsn requests show RITM0010001
169
+ # Output includes attachments + catalog variables:
170
+ # ─ Attachments ─
171
+ # onboarding_form.pdf (by John Smith, 2026-05-15 14:23:10)
172
+ # ─ Catalog Variables ─
173
+ # Department: Engineering
174
+ # Urgency: High
178
175
  ```
179
176
 
180
- ### Development Artifacts
177
+ ### Development
181
178
 
182
179
  ```bash
183
- # AUTOMATIONS
184
- # List Flow Designer flows
185
- jsn dev flows
186
-
187
- # List action definitions
188
- jsn dev actions
189
-
190
- # SCRIPTS
191
- # List script includes
192
- jsn dev includes
193
-
194
- # Get a specific script include
195
- jsn dev includes MyScriptInclude
196
-
197
- # List business rules
198
- jsn dev rules
199
-
200
- # List client scripts
201
- jsn dev clientscripts
202
-
203
- # List UI actions
204
- jsn dev uiactions
205
-
206
- # List UI policies
207
- jsn dev uipolicies
208
-
209
- # DATA
210
- # View table definition
211
- jsn dev tables incident
212
-
213
- # List table columns
214
- jsn dev columns --table incident
215
-
216
- # SECURITY
217
- # List access controls (ACLs)
218
- jsn dev acls
219
-
220
- # List roles
221
- jsn dev roles
222
-
223
- # PLATFORM
224
- # List update sets
225
- jsn dev updatesets
226
-
227
- # Set current update set
228
- jsn dev updatesets set "My Update Set"
229
-
230
- # List application scopes
231
- jsn dev scopes
232
-
233
- # Query system properties
234
- jsn dev properties
235
-
236
- # Query system logs
237
- jsn dev logs --level error
238
- jsn dev logs --source "Business Rule" --level warn
239
-
240
- # Execute background script
241
- jsn dev eval "gs.info('Hello World')"
180
+ jsn dev flows # List flows
181
+ jsn dev includes MyScriptInclude # Show a script include
182
+ jsn dev rules # List business rules
183
+ jsn dev updatesets set "My Update Set" # Set current updateset
184
+ jsn dev eval "gs.info('Hello World')" # Run background script
242
185
  ```
243
186
 
244
187
  ### Generic Table API
245
188
 
246
189
  ```bash
247
- # List any table
248
190
  jsn records list --table incident --limit 10
249
-
250
- # Query with encoded query
251
191
  jsn records list --table incident --query "priority=1^active=true"
252
-
253
- # Show specific columns
254
- jsn records list --table incident --columns "number,short_description,priority"
255
-
256
- # Get a record by sys_id
257
192
  jsn records get --table incident --sys-id abc123
258
-
259
- # Create a record
260
193
  jsn records create --table incident --data '{"short_description": "Test"}'
261
-
262
- # Update a record
263
- jsn records update --table incident --sys-id abc123 --data '{"priority": "1"}'
264
-
265
- # Delete a record
266
- jsn records delete --table incident --sys-id abc123
267
194
  ```
268
195
 
269
196
  ## Output Formats
270
197
 
271
- JSN supports multiple output formats:
272
-
273
198
  | Format | Flag | Description |
274
199
  |--------|------|-------------|
275
200
  | Auto (default) | `--format=auto` | JSON for pipes, styled for TTY |
276
201
  | JSON | `--json` or `--format=json` | Machine-readable JSON |
277
- | Styled | `--styled` | ANSI-styled tables (for humans) |
202
+ | Styled | `--styled` | ANSI-styled tables |
278
203
  | Markdown | `--markdown` | Markdown tables |
279
204
  | Quiet | `--quiet` or `-q` | Data only, no envelope |
280
205
 
281
206
  ```bash
282
- # JSON output
283
- jsn incidents --json
284
-
285
- # Styled table output
207
+ jsn incidents --json | jq '.[].number'
286
208
  jsn incidents --styled
287
-
288
- # Markdown output for documentation
289
- jsn incidents --markdown
290
-
291
- # Quiet mode for piping
292
209
  jsn incidents -q | jq '.[].number'
293
210
  ```
294
211
 
295
212
  ## Authentication
296
213
 
297
- JSN uses OAuth 2.0 with PKCE for secure authentication:
214
+ OAuth 2.0 with PKCE. Credentials stored in `~/.config/servicenow/credentials/`.
298
215
 
299
216
  ```bash
300
- # Login to an instance
301
217
  jsn auth login https://dev12345.service-now.com
302
218
 
303
- # Check authentication status
304
- jsn auth status
219
+ # Bot-friendly: print auth URL instead of opening a browser
220
+ jsn auth login https://dev12345.service-now.com --print-url
221
+
222
+ # Paste code from browser
223
+ jsn auth login https://dev12345.service-now.com --code ABC123
224
+ ```
225
+
226
+ ### CI/CD Integration
305
227
 
306
- # Logout
307
- jsn auth logout
228
+ ```bash
229
+ export SERVICENOW_INSTANCE_URL="https://dev12345.service-now.com"
230
+ export SERVICENOW_OAUTH_TOKEN="***"
231
+ jsn incidents list # No interactive auth needed
308
232
  ```
309
233
 
310
- Credentials are securely stored in your OS keychain (or file fallback at `~/.config/servicenow/credentials/`).
234
+ ## AI Agent Integration
235
+
236
+ JSN includes a built-in skill file for AI agents:
237
+
238
+ ```bash
239
+ # View the skill file
240
+ jsn skill show
241
+
242
+ # Download the latest skill from GitHub
243
+ jsn skill fetch | head -30
244
+
245
+ # Install to Hermes skills directory
246
+ jsn skill install
247
+
248
+ # Install to a custom location
249
+ jsn skill install /path/to/skills/
250
+ ```
311
251
 
312
252
  ## Environment Variables
313
253
 
@@ -316,83 +256,96 @@ Credentials are securely stored in your OS keychain (or file fallback at `~/.con
316
256
  | `SERVICENOW_INSTANCE_URL` | Default instance URL |
317
257
  | `SERVICENOW_FORMAT` | Default output format |
318
258
  | `SERVICENOW_OAUTH_TOKEN` | OAuth token (for CI/CD) |
259
+ | `JSN_NO_HEADER` | Suppress context header |
319
260
 
320
- ## CI/CD Integration
321
-
322
- For automated environments, use the OAuth token:
261
+ ## Getting Help
323
262
 
324
263
  ```bash
325
- export SERVICENOW_INSTANCE_URL="https://dev12345.service-now.com"
326
- export SERVICENOW_OAUTH_TOKEN="your-oauth-token"
327
-
328
- # Now run commands without interactive auth
329
- jsn incidents list
264
+ jsn # Categorized help with command groups
265
+ jsn incidents --help # Command details
266
+ jsn version # Show version
267
+ jsn version --check # Check for npm updates
330
268
  ```
331
269
 
332
- ## Shell Completion
270
+ ## Development
333
271
 
334
272
  ```bash
335
- # Bash
336
- source <(jsn completion bash)
273
+ git clone https://github.com/jacebenson/jsn.git
274
+ cd jsn
275
+ git checkout nodejs
276
+ npm install
277
+ npm test # 128+ tests
278
+ npm run lint # ESLint
279
+ npm run start # Run CLI locally
280
+ ```
337
281
 
338
- # Zsh
339
- source <(jsn completion zsh)
282
+ ### Project Structure
340
283
 
341
- # Fish
342
- jsn completion fish | source
284
+ ```
285
+ ├── src/
286
+ │ ├── cli.js # Root CLI (yargs setup)
287
+ │ ├── app.js # App context
288
+ │ ├── auth.js # OAuth PKCE manager
289
+ │ ├── sdk.js # ServiceNow REST API client
290
+ │ ├── output.js # Output formatting
291
+ │ ├── config.js # Configuration loader
292
+ │ ├── context.js # Runtime context
293
+ │ ├── errors.js # Structured error types
294
+ │ ├── helpers.js # Shared utilities
295
+ │ ├── help.js # Custom grouped help renderer
296
+ │ └── commands/ # CLI command modules
297
+ ├── skills/
298
+ │ └── servicenow/
299
+ │ └── SKILL.md # AI agent skill file
300
+ ├── test/ # Test suite
301
+ └── package.json
343
302
  ```
344
303
 
345
- ## Getting Help
304
+ ### Releasing
346
305
 
347
306
  ```bash
348
- # General help
349
- jsn --help
350
-
351
- # Command help
352
- jsn incidents --help
353
-
354
- # Subcommand help
355
- jsn incidents create --help
307
+ npm run release -- patch # or minor, major
308
+ # Creates node-v* tag, pushes to GitHub, publishes to npm
356
309
  ```
357
310
 
358
311
  ## Troubleshooting
359
312
 
360
313
  ### Not authenticated
361
314
 
362
- ```bash
315
+ ```
363
316
  ⚠️ Not authenticated to https://dev12345.service-now.com
364
317
 
365
318
  To get started, run:
366
- jsn setup # Interactive setup
367
- jsn auth login # Login to instance
319
+ jsn setup
320
+ jsn auth login
368
321
  ```
369
322
 
370
- **Solution**: Run `jsn setup` or `jsn auth login <instance>`
371
-
372
323
  ### Instance URL required
373
324
 
374
- ```bash
375
- Error (usage): Instance URL required. Set via --instance flag, SERVICENOW_INSTANCE_URL env, or config file.
325
+ ```
326
+ Error (usage): Instance URL required. Set via --instance flag,
327
+ SERVICENOW_INSTANCE_URL env, or config file.
376
328
  ```
377
329
 
378
- **Solution**: Set the instance with one of:
379
- - `jsn setup`
380
- - `jsn auth login <instance>`
381
- - `--instance` flag
382
- - `SERVICENOW_INSTANCE_URL` environment variable
383
-
384
- ## Contributing
330
+ ### Outdated version
385
331
 
386
- 1. Fork the repository
387
- 2. Create a feature branch
388
- 3. Make your changes
389
- 4. Add tests
390
- 5. Submit a pull request
332
+ ```bash
333
+ jsn version --check
334
+ # → jsn 0.0.10 — newer version 0.1.0 available
335
+ npm install -g @jacebenson/jsn
336
+ ```
391
337
 
392
338
  ## License
393
339
 
394
- MIT License - see LICENSE file for details
340
+ MIT License — see LICENSE file for details
395
341
 
396
342
  ## Acknowledgments
397
343
 
398
- This project follows the architectural patterns from [basecamp-cli](https://github.com/basecamp/basecamp-cli).
344
+ This project follows architectural patterns from [basecamp-cli](https://github.com/basecamp/basecamp-cli).
345
+
346
+ | Project | What we learned |
347
+ |---------|----------------|
348
+ | [Abey's `sn` CLI](https://github.com/tehubersheezy/servicenow-cli) (Rust) | Table API patterns, aggregate stats, raw REST passthrough |
349
+ | [ServiceNow `now-sdk`](https://www.npmjs.com/package/@servicenow/sdk) | OAuth session flow for UI pages |
350
+ | [ServiceNow VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ServiceNow.now-vscode) | `sys.scripts.do` CSRF extraction |
351
+ | [Getting Real](https://basecamp.com/gettingreal) by Basecamp | Build less, start with no, embrace constraints |
package/bin/jsn.js CHANGED
@@ -1,60 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * JSN CLI binary wrapper
4
- *
5
- * This script finds the downloaded platform-specific binary and spawns it,
6
- * forwarding all arguments, stdin, stdout, and stderr.
7
- */
8
2
 
9
- const { spawn } = require('child_process');
10
- const path = require('path');
11
- const fs = require('fs');
12
- const os = require('os');
3
+ import { cli } from '../src/cli.js';
13
4
 
14
- function getBinaryPath() {
15
- const binaryDir = path.join(__dirname, '..', 'binary');
16
- const binaryName = os.platform() === 'win32' ? 'jsn.exe' : 'jsn';
17
- const binaryPath = path.join(binaryDir, binaryName);
18
-
19
- if (fs.existsSync(binaryPath)) {
20
- return binaryPath;
21
- }
22
-
23
- // Fallback: check if running from source/build
24
- const devPath = path.join(__dirname, '..', 'jsn');
25
- if (fs.existsSync(devPath)) {
26
- return devPath;
27
- }
28
-
29
- // Another fallback for dev
30
- const devPath2 = path.join(__dirname, '..', 'jsn.exe');
31
- if (fs.existsSync(devPath2)) {
32
- return devPath2;
33
- }
34
-
35
- console.error('Error: JSN binary not found.');
36
- console.error('');
37
- console.error('The binary should have been downloaded during npm install.');
38
- console.error('Try reinstalling the package:');
39
- console.error(' npm uninstall -g @jacebenson/jsn');
40
- console.error(' npm install -g @jacebenson/jsn');
41
- console.error('');
42
- console.error('Or download manually from:');
43
- console.error(' https://github.com/jacebenson/jsn/releases');
44
- process.exit(1);
45
- }
46
-
47
- const binaryPath = getBinaryPath();
48
- const child = spawn(binaryPath, process.argv.slice(2), {
49
- stdio: 'inherit',
50
- windowsHide: true,
51
- });
52
-
53
- child.on('exit', (code) => {
54
- process.exit(code ?? 0);
55
- });
56
-
57
- child.on('error', (err) => {
58
- console.error(`Failed to start JSN: ${err.message}`);
59
- process.exit(1);
60
- });
5
+ cli.parse();