peakurl 0.3.2 → 1.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/man/peakurl.1 ADDED
@@ -0,0 +1,363 @@
1
+ .Dd April 24, 2026
2
+ .Dt PEAKURL 1
3
+ .Os
4
+ .Sh NAME
5
+ .Nm peakurl
6
+ .Nd manage PeakURL short links and site operations from the terminal
7
+ .Sh SYNOPSIS
8
+ .Nm
9
+ .Op Fl h | Fl -help
10
+ .Op Fl V | Fl -version
11
+ .Ar command
12
+ .Op Ar options
13
+ .Pp
14
+ .Nm
15
+ .Cm login
16
+ .Fl -base-url
17
+ .Ar url
18
+ .Fl -api-key
19
+ .Ar token
20
+ .Op Fl -json
21
+ .Op Fl -quiet
22
+ .Pp
23
+ .Nm
24
+ .Cm create
25
+ .Ar url
26
+ .Op Fl -alias Ar alias
27
+ .Op Fl -title Ar title
28
+ .Op Fl -json
29
+ .Op Fl -quiet
30
+ .Pp
31
+ .Nm
32
+ .Cm list
33
+ .Op Fl -page Ar number
34
+ .Op Fl -limit Ar number
35
+ .Op Fl -search Ar query
36
+ .Op Fl -json
37
+ .Op Fl -quiet
38
+ .Pp
39
+ .Nm
40
+ .Cm core download
41
+ .Op Fl -force
42
+ .Op Fl -json
43
+ .Op Fl -quiet
44
+ .Sh DESCRIPTION
45
+ .Nm
46
+ is the official command-line interface for PeakURL.
47
+ It wraps the PeakURL HTTP API for creating, listing, importing, exporting,
48
+ and deleting short links.
49
+ It also supports authenticated account inspection, site system status,
50
+ outbound webhooks, CLI update checks, and public PeakURL core package
51
+ downloads.
52
+ .Pp
53
+ Human-readable tables are printed by default.
54
+ Commands that are useful in automation provide
55
+ .Fl -json
56
+ for machine-readable output and
57
+ .Fl -quiet
58
+ for compact script output.
59
+ .Sh INSTALLATION
60
+ .Nm
61
+ is distributed as the
62
+ .Sy peakurl
63
+ npm package.
64
+ .Bd -literal -offset indent
65
+ npm i -g peakurl
66
+ .Ed
67
+ .Pp
68
+ After installation, the executable is named
69
+ .Nm .
70
+ Package managers that install npm manual entries can expose this page through:
71
+ .Bd -literal -offset indent
72
+ man peakurl
73
+ .Ed
74
+ .Sh AUTHENTICATION
75
+ Most commands require a PeakURL API key.
76
+ Save credentials locally with:
77
+ .Bd -literal -offset indent
78
+ peakurl login --base-url https://example.com/api/v1 --api-key YOUR_API_KEY
79
+ .Ed
80
+ .Pp
81
+ The
82
+ .Fl -base-url
83
+ value must be the explicit PeakURL API base URL and should normally end in
84
+ .Pa /api/v1 .
85
+ .Nm
86
+ verifies credentials with
87
+ .Sy GET /users/me
88
+ before saving them.
89
+ .Pp
90
+ For non-interactive shells and CI jobs, credentials may also be provided
91
+ through environment variables:
92
+ .Bl -tag -width "PEAKURL_BASE_URL"
93
+ .It Ev PEAKURL_BASE_URL
94
+ Explicit API base URL, for example
95
+ .Pa https://example.com/api/v1 .
96
+ .It Ev PEAKURL_API_KEY
97
+ Bearer API key.
98
+ .El
99
+ .Pp
100
+ Environment credentials override saved credentials for the current process.
101
+ .Sh COMMANDS
102
+ .Bl -tag -width "webhook create"
103
+ .It Cm login
104
+ Validate and save PeakURL credentials.
105
+ .Bd -literal -offset indent
106
+ peakurl login --base-url https://example.com/api/v1 --api-key YOUR_API_KEY
107
+ .Ed
108
+ .It Cm whoami
109
+ Show the current authenticated account.
110
+ .Bd -literal -offset indent
111
+ peakurl whoami
112
+ .Ed
113
+ .It Cm logout
114
+ Remove saved local credentials.
115
+ Environment variables, if set, still apply to the current shell.
116
+ .Bd -literal -offset indent
117
+ peakurl logout
118
+ .Ed
119
+ .It Cm status
120
+ Show the current PeakURL system status snapshot.
121
+ This route typically requires admin access on the PeakURL install.
122
+ .Bd -literal -offset indent
123
+ peakurl status
124
+ peakurl status --json
125
+ .Ed
126
+ .It Cm core download
127
+ Download the latest public PeakURL core package from
128
+ .Pa https://peakurl.org/latest.zip ,
129
+ verify the published SHA-256 checksum from the update API, and extract it
130
+ into the current directory.
131
+ .Bd -literal -offset indent
132
+ peakurl core download
133
+ peakurl core download --force
134
+ .Ed
135
+ .It Cm create Ar url
136
+ Create a short link for a destination URL.
137
+ .Bd -literal -offset indent
138
+ peakurl create https://example.com/docs --alias docs
139
+ peakurl create https://example.com/launch --title "Launch Page"
140
+ .Ed
141
+ .It Cm import Ar file
142
+ Import short links from a local CSV, JSON, or XML file.
143
+ .Bd -literal -offset indent
144
+ peakurl import ./links.csv
145
+ peakurl import ./links.xml --json
146
+ .Ed
147
+ .It Cm export
148
+ Export accessible links as CSV, JSON, or XML.
149
+ .Bd -literal -offset indent
150
+ peakurl export --format csv
151
+ peakurl export --format json --stdout
152
+ peakurl export --format xml --output ./backups/links.xml
153
+ .Ed
154
+ .It Cm list
155
+ List short links.
156
+ .Bd -literal -offset indent
157
+ peakurl list
158
+ peakurl list --limit 25 --page 1
159
+ peakurl list --search launch --json
160
+ .Ed
161
+ .It Cm get Ar id-or-alias
162
+ Fetch one short link by ID, alias, or short code.
163
+ .Bd -literal -offset indent
164
+ peakurl get docs
165
+ peakurl get url_123 --json
166
+ .Ed
167
+ .It Cm delete Ar id-or-alias
168
+ Delete one short link by ID, alias, or short code.
169
+ .Bd -literal -offset indent
170
+ peakurl delete docs
171
+ peakurl delete url_123 --quiet
172
+ .Ed
173
+ .It Cm webhook list
174
+ List outbound webhook registrations.
175
+ .Bd -literal -offset indent
176
+ peakurl webhook list
177
+ peakurl webhook list --json
178
+ .Ed
179
+ .It Cm webhook create Ar url
180
+ Create an outbound webhook registration.
181
+ At least one
182
+ .Fl -event
183
+ flag is required.
184
+ .Bd -literal -offset indent
185
+ peakurl webhook create https://example.com/api/webhooks/peakurl --event link.clicked
186
+ peakurl webhook create https://example.com/api/webhooks/peakurl --event link.clicked --event link.created
187
+ .Ed
188
+ .It Cm webhook delete Ar id
189
+ Delete one outbound webhook by ID.
190
+ .Bd -literal -offset indent
191
+ peakurl webhook delete webhook_123
192
+ .Ed
193
+ .It Cm webhook events
194
+ List supported webhook event identifiers.
195
+ .Bd -literal -offset indent
196
+ peakurl webhook events
197
+ .Ed
198
+ .It Cm update
199
+ Check for a newer CLI version and print the npm install command when an
200
+ update is available.
201
+ .Bd -literal -offset indent
202
+ peakurl update
203
+ peakurl update --check
204
+ peakurl update --json
205
+ .Ed
206
+ .El
207
+ .Sh OPTIONS
208
+ .Ss Global Options
209
+ .Bl -tag -width "-V, --version"
210
+ .It Fl h , Fl -help
211
+ Show help.
212
+ .It Fl V , Fl -version
213
+ Show the installed CLI version.
214
+ .El
215
+ .Ss Common Output Options
216
+ .Bl -tag -width "--quiet"
217
+ .It Fl -json
218
+ Print machine-readable JSON where supported.
219
+ .It Fl -quiet
220
+ Print minimal output for scripts or suppress success output for destructive
221
+ commands.
222
+ .El
223
+ .Ss Link Creation Options
224
+ .Bl -tag -width "--utm-campaign"
225
+ .It Fl -alias Ar alias
226
+ Custom alias for the short link.
227
+ .It Fl -title Ar title
228
+ Title stored with the short link.
229
+ .It Fl -password Ar password
230
+ Password-protect the short link.
231
+ .It Fl -status Ar status
232
+ Link status, for example
233
+ .Sy active
234
+ or
235
+ .Sy paused .
236
+ .It Fl -expires-at Ar iso
237
+ Expiration timestamp in ISO-8601 format.
238
+ .It Fl -utm-source Ar value
239
+ UTM source value.
240
+ .It Fl -utm-medium Ar value
241
+ UTM medium value.
242
+ .It Fl -utm-campaign Ar value
243
+ UTM campaign value.
244
+ .It Fl -utm-term Ar value
245
+ UTM term value.
246
+ .It Fl -utm-content Ar value
247
+ UTM content value.
248
+ .El
249
+ .Ss List Options
250
+ .Bl -tag -width "--sort-order"
251
+ .It Fl -page Ar number
252
+ Page number.
253
+ .It Fl -limit Ar number
254
+ Page size.
255
+ .It Fl -search Ar query
256
+ Search term.
257
+ .It Fl -sort-by Ar field
258
+ Sort field.
259
+ .It Fl -sort-order Ar order
260
+ Sort order, for example
261
+ .Sy asc
262
+ or
263
+ .Sy desc .
264
+ .El
265
+ .Ss Import And Export Options
266
+ .Bl -tag -width "--format"
267
+ .It Fl -format Ar format
268
+ File format:
269
+ .Sy csv ,
270
+ .Sy json ,
271
+ or
272
+ .Sy xml .
273
+ .It Fl -output Ar path
274
+ Write exported content to a specific file.
275
+ .It Fl -stdout
276
+ Write raw exported content to standard output.
277
+ .El
278
+ .Ss Core Download Options
279
+ .Bl -tag -width "--force"
280
+ .It Fl -force
281
+ Overwrite existing files when extracting the PeakURL core package.
282
+ .El
283
+ .Ss Webhook Options
284
+ .Bl -tag -width "--event"
285
+ .It Fl -event Ar event
286
+ Webhook event identifier.
287
+ May be passed more than once.
288
+ Run
289
+ .Nm
290
+ .Cm webhook events
291
+ to list supported values.
292
+ .El
293
+ .Sh ENVIRONMENT
294
+ .Bl -tag -width "PEAKURL_DISABLE_UPDATE_CHECK"
295
+ .It Ev PEAKURL_BASE_URL
296
+ Explicit PeakURL API base URL.
297
+ .It Ev PEAKURL_API_KEY
298
+ Bearer API key.
299
+ .It Ev PEAKURL_DISABLE_UPDATE_CHECK
300
+ Disable automatic CLI update notices when set.
301
+ .It Ev PEAKURL_FORCE_UPDATE_NOTICE
302
+ Force an update notice check.
303
+ This is primarily useful for testing.
304
+ .El
305
+ .Sh FILES
306
+ .Bl -tag -width "Windows"
307
+ .It macOS
308
+ .Pa ~/Library/Preferences/peakurl/config.json
309
+ .It Linux and other Unix systems
310
+ .Pa ~/.config/peakurl/config.json
311
+ .It Windows
312
+ .Pa %APPDATA%\epeakurl\eConfig\econfig.json
313
+ .El
314
+ .Pp
315
+ The exact location follows the standard per-user paths resolved by the
316
+ operating system.
317
+ .Sh EXIT STATUS
318
+ .Bl -tag -width "2"
319
+ .It 0
320
+ Command completed successfully.
321
+ .It 1
322
+ Command failed because of validation, network, API, file-system, or package
323
+ verification errors.
324
+ .It 2
325
+ Authentication is missing or rejected.
326
+ .El
327
+ .Sh SECURITY
328
+ .Nm
329
+ does not print API keys, bearer tokens, or raw authorization headers.
330
+ Base URLs and destination URLs reject embedded credentials.
331
+ Core package downloads are verified with the published SHA-256 checksum before
332
+ extraction.
333
+ The ZIP extractor rejects unsafe paths, duplicate entries, symbolic links,
334
+ encrypted entries, and unsupported compression methods.
335
+ .Pp
336
+ Use
337
+ .Nm
338
+ .Cm logout
339
+ to remove saved credentials from the local config store.
340
+ Unset
341
+ .Ev PEAKURL_BASE_URL
342
+ and
343
+ .Ev PEAKURL_API_KEY
344
+ when environment credentials should no longer apply.
345
+ .Sh EXAMPLES
346
+ .Bd -literal -offset indent
347
+ peakurl login --base-url https://example.com/api/v1 --api-key YOUR_API_KEY
348
+ peakurl create https://example.com/docs --alias docs
349
+ peakurl list --limit 10
350
+ peakurl get docs
351
+ peakurl export --format json --stdout
352
+ peakurl webhook create https://example.com/api/webhooks/peakurl --event link.clicked
353
+ peakurl core download
354
+ .Ed
355
+ .Sh SEE ALSO
356
+ .Lk https://peakurl.org/docs/cli "PeakURL CLI documentation"
357
+ .Pp
358
+ .Lk https://peakurl.org/docs/api "PeakURL API documentation"
359
+ .Pp
360
+ .Lk https://www.npmjs.com/package/peakurl "peakurl npm package"
361
+ .Sh BUGS
362
+ Report issues at
363
+ .Lk https://github.com/PeakURL/CLI/issues .
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peakurl",
3
- "version": "0.3.2",
3
+ "version": "1.0.1",
4
4
  "description": "Official CLI for creating, listing, and managing PeakURL short links from the terminal",
5
5
  "homepage": "https://peakurl.org",
6
6
  "bugs": {
@@ -24,8 +24,12 @@
24
24
  "bin": {
25
25
  "peakurl": "bin/peakurl.js"
26
26
  },
27
+ "man": [
28
+ "man/peakurl.1"
29
+ ],
27
30
  "files": [
28
- "bin"
31
+ "bin",
32
+ "man"
29
33
  ],
30
34
  "engines": {
31
35
  "node": ">=20"
@@ -43,15 +47,15 @@
43
47
  "registry": "https://registry.npmjs.org/"
44
48
  },
45
49
  "dependencies": {
46
- "commander": "^14.0.0",
47
- "env-paths": "^3.0.0"
50
+ "commander": "^15.0.0",
51
+ "env-paths": "^4.0.0"
48
52
  },
49
53
  "devDependencies": {
50
- "@types/node": "^24.0.0",
51
- "prettier": "^3.6.2",
52
- "tsup": "^8.5.0",
53
- "tsx": "^4.20.6",
54
- "typescript": "^5.9.3"
54
+ "@types/node": "^25.9.1",
55
+ "prettier": "^3.8.3",
56
+ "tsup": "^8.5.1",
57
+ "tsx": "^4.22.4",
58
+ "typescript": "^6.0.3"
55
59
  },
56
60
  "license": "MIT"
57
61
  }