peakurl 1.0.2 → 1.1.0
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 +55 -25
- package/bin/peakurl.js +978 -545
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -42,12 +42,12 @@ peakurl logout
|
|
|
42
42
|
|
|
43
43
|
## Authentication
|
|
44
44
|
|
|
45
|
-
The CLI
|
|
45
|
+
The CLI authenticates with PeakURL bearer API keys and verifies credentials with your instance before saving them locally.
|
|
46
46
|
|
|
47
47
|
- `--base-url` expects the explicit API base URL, such as `https://example.com/api/v1`
|
|
48
|
-
- API keys are
|
|
49
|
-
- Credentials are stored in the standard per-user
|
|
50
|
-
- `peakurl logout` removes the saved
|
|
48
|
+
- API keys are 48-character hexadecimal tokens generated from your PeakURL dashboard
|
|
49
|
+
- Credentials are stored in the standard per-user configuration directory for `peakurl`
|
|
50
|
+
- `peakurl logout` removes the saved configuration, while environment variables take precedence when set
|
|
51
51
|
|
|
52
52
|
For CI or automation, you can also authenticate with environment variables:
|
|
53
53
|
|
|
@@ -58,21 +58,22 @@ export PEAKURL_API_KEY=0123456789abcdef0123456789abcdef0123456789abcdef
|
|
|
58
58
|
|
|
59
59
|
## Commands
|
|
60
60
|
|
|
61
|
-
| Command
|
|
62
|
-
|
|
|
63
|
-
| `peakurl login`
|
|
64
|
-
| `peakurl whoami`
|
|
65
|
-
| `peakurl logout`
|
|
66
|
-
| `peakurl status`
|
|
67
|
-
| `peakurl core download`
|
|
68
|
-
| `peakurl create <url>`
|
|
69
|
-
| `peakurl import <file>`
|
|
70
|
-
| `peakurl export`
|
|
71
|
-
| `peakurl list`
|
|
72
|
-
| `peakurl get <id-or-alias>`
|
|
73
|
-
| `peakurl delete
|
|
74
|
-
| `peakurl
|
|
75
|
-
| `peakurl
|
|
61
|
+
| Command | Description |
|
|
62
|
+
| --------------------------------- | ----------------------------------------------------------- |
|
|
63
|
+
| `peakurl login` | Validate and save your PeakURL credentials. |
|
|
64
|
+
| `peakurl whoami` | Show the current authenticated account. |
|
|
65
|
+
| `peakurl logout` | Remove saved local CLI credentials. |
|
|
66
|
+
| `peakurl status` | Show the current system status snapshot for the site. |
|
|
67
|
+
| `peakurl core download` | Download and extract the latest PeakURL core package. |
|
|
68
|
+
| `peakurl create <url>` | Create a new short link. |
|
|
69
|
+
| `peakurl import <file>` | Import links from a local CSV, JSON, or XML file. |
|
|
70
|
+
| `peakurl export` | Export accessible links as CSV, JSON, or XML. |
|
|
71
|
+
| `peakurl list` | List links in your account. |
|
|
72
|
+
| `peakurl get <id-or-alias>` | Fetch a single link by ID or alias. |
|
|
73
|
+
| `peakurl delete [id-or-alias...]` | Delete links by ID or alias, in bulk, or clear all links. |
|
|
74
|
+
| `peakurl activity <subcommand>` | View audit logs, delete activity records, or clear history. |
|
|
75
|
+
| `peakurl webhook <subcommand>` | List, create, delete, and inspect supported webhook events. |
|
|
76
|
+
| `peakurl update` | Show the latest available CLI version and install command. |
|
|
76
77
|
|
|
77
78
|
## Examples
|
|
78
79
|
|
|
@@ -111,11 +112,11 @@ Show the current system status:
|
|
|
111
112
|
peakurl status
|
|
112
113
|
```
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
Displays comprehensive system diagnostics, including health checks, site configuration, server metrics, database information, storage usage, mail settings, location analytics, cache diagnostics, and data counts.
|
|
115
116
|
|
|
116
|
-
This
|
|
117
|
+
This command typically requires an administrator account on the PeakURL instance.
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
To output the complete diagnostics as JSON:
|
|
119
120
|
|
|
120
121
|
```bash
|
|
121
122
|
peakurl status --json
|
|
@@ -135,13 +136,42 @@ Use `--force` only when you intentionally want those files replaced:
|
|
|
135
136
|
peakurl core download --force
|
|
136
137
|
```
|
|
137
138
|
|
|
138
|
-
Delete
|
|
139
|
+
Delete one or more links, or clear all links:
|
|
139
140
|
|
|
140
141
|
```bash
|
|
142
|
+
# Delete a single link
|
|
141
143
|
peakurl delete example
|
|
144
|
+
|
|
145
|
+
# Bulk delete multiple links
|
|
146
|
+
peakurl delete docs pricing blog launch
|
|
147
|
+
|
|
148
|
+
# Bulk delete with comma-separated IDs
|
|
149
|
+
peakurl delete --ids url_1,url_2,url_3
|
|
150
|
+
|
|
151
|
+
# Empty all short links in trash
|
|
152
|
+
peakurl delete --empty-trash
|
|
153
|
+
|
|
154
|
+
# Delete all accessible short links
|
|
155
|
+
peakurl delete --all
|
|
142
156
|
```
|
|
143
157
|
|
|
144
|
-
When `delete` receives
|
|
158
|
+
When `delete` receives aliases or short codes, the CLI resolves them to the underlying PeakURL row IDs before deleting them.
|
|
159
|
+
|
|
160
|
+
List, inspect, and delete audit log activity:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# List recent activity records
|
|
164
|
+
peakurl activity list
|
|
165
|
+
|
|
166
|
+
# Filter and paginate activity logs
|
|
167
|
+
peakurl activity list --search delete --limit 25 --page 1
|
|
168
|
+
|
|
169
|
+
# Delete specific activity log entries
|
|
170
|
+
peakurl activity delete act_123 act_456
|
|
171
|
+
|
|
172
|
+
# Clear all activity log history
|
|
173
|
+
peakurl activity clear
|
|
174
|
+
```
|
|
145
175
|
|
|
146
176
|
Import links from a local file:
|
|
147
177
|
|
|
@@ -149,7 +179,7 @@ Import links from a local file:
|
|
|
149
179
|
peakurl import ./links.csv
|
|
150
180
|
```
|
|
151
181
|
|
|
152
|
-
The import command accepts
|
|
182
|
+
The import command accepts CSV, JSON, and XML files, validates and normalizes the link records locally, and imports them in bulk.
|
|
153
183
|
|
|
154
184
|
Export links as CSV:
|
|
155
185
|
|