peakurl 0.0.3 → 0.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 +43 -79
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,123 +2,87 @@
|
|
|
2
2
|
|
|
3
3
|
`peakurl` is the official command-line interface for PeakURL.
|
|
4
4
|
|
|
5
|
+
It gives you a fast way to create, inspect, list, and remove short links from the terminal while keeping default output readable for humans and optional `--json` output friendly for scripts.
|
|
6
|
+
|
|
5
7
|
## Install
|
|
6
8
|
|
|
9
|
+
Requirements: Node.js 20 or later.
|
|
10
|
+
|
|
7
11
|
```bash
|
|
8
12
|
npm install -g peakurl
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Authentication
|
|
14
|
-
|
|
15
|
-
The CLI uses a PeakURL API key and validates it with `GET /api/v1/users/me` before storing it.
|
|
16
|
-
PeakURL API keys are opaque 48-character hex bearer tokens, for example `0123456789abcdef0123456789abcdef0123456789abcdef`.
|
|
17
|
-
The CLI accepts either the site root URL such as `https://peakurl.org` or the dashboard-exposed API base URL such as `https://peakurl.org/api/v1`.
|
|
15
|
+
## Quick Start
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
18
|
peakurl login --base-url https://peakurl.org --api-key 0123456789abcdef0123456789abcdef0123456789abcdef
|
|
19
|
+
peakurl create https://example.com/articles/launch --alias launch --title "Launch Post"
|
|
20
|
+
peakurl list
|
|
21
|
+
peakurl whoami
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
## Authentication
|
|
25
|
+
|
|
26
|
+
The CLI uses PeakURL bearer API keys and validates them with `GET /api/v1/users/me` before storing them.
|
|
27
|
+
|
|
28
|
+
- `--base-url` accepts either the site root such as `https://peakurl.org` or the API base URL such as `https://peakurl.org/api/v1`
|
|
29
|
+
- API keys are opaque 48-character hex tokens
|
|
30
|
+
- credentials are stored in the standard per-user config location for `peakurl`
|
|
31
|
+
|
|
32
|
+
For CI and automation, you can also use environment variables:
|
|
24
33
|
|
|
25
34
|
```bash
|
|
26
35
|
export PEAKURL_BASE_URL=https://peakurl.org
|
|
27
36
|
export PEAKURL_API_KEY=0123456789abcdef0123456789abcdef0123456789abcdef
|
|
28
37
|
```
|
|
29
38
|
|
|
30
|
-
Stored credentials live in the OS-standard per-user config directory for `peakurl`.
|
|
31
|
-
|
|
32
39
|
## Commands
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
peakurl
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
| Command | Description |
|
|
42
|
+
| ------------------------------ | ------------------------------------------- |
|
|
43
|
+
| `peakurl login` | Validate and save your PeakURL credentials. |
|
|
44
|
+
| `peakurl whoami` | Show the current authenticated account. |
|
|
45
|
+
| `peakurl create <url>` | Create a new short link. |
|
|
46
|
+
| `peakurl list` | List links in your account. |
|
|
47
|
+
| `peakurl get <id-or-alias>` | Fetch a single link by ID or alias. |
|
|
48
|
+
| `peakurl delete <id-or-alias>` | Delete a link by ID or alias. |
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
peakurl whoami
|
|
44
|
-
peakurl whoami --json
|
|
45
|
-
```
|
|
50
|
+
## Common Flags
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
- `--json` prints machine-readable JSON output
|
|
53
|
+
- `--quiet` minimizes output for scripts
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
peakurl create https://example.com/articles/launch --alias launch --title "Launch Post"
|
|
51
|
-
peakurl create https://example.com --json
|
|
52
|
-
```
|
|
55
|
+
## Examples
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
Create a short link:
|
|
55
58
|
|
|
56
59
|
```bash
|
|
57
|
-
peakurl
|
|
58
|
-
peakurl list --search launch --limit 10 --json
|
|
60
|
+
peakurl create https://example.com --alias example --title "Example"
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
List links as JSON:
|
|
62
64
|
|
|
63
65
|
```bash
|
|
64
|
-
peakurl
|
|
65
|
-
peakurl get 681f3b63e7e44c0a1e83aa11 --json
|
|
66
|
+
peakurl list --limit 10 --json
|
|
66
67
|
```
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
Inspect a link:
|
|
69
70
|
|
|
70
71
|
```bash
|
|
71
|
-
peakurl
|
|
72
|
-
peakurl delete 681f3b63e7e44c0a1e83aa11 --quiet
|
|
72
|
+
peakurl get example
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
stable PeakURL row ID first because the current backend delete route operates on
|
|
77
|
-
IDs.
|
|
78
|
-
|
|
79
|
-
## Flags
|
|
80
|
-
|
|
81
|
-
Common flags:
|
|
82
|
-
|
|
83
|
-
- `--json` prints machine-readable output.
|
|
84
|
-
- `--quiet` prints minimal output for scripts.
|
|
85
|
-
|
|
86
|
-
Create flags:
|
|
87
|
-
|
|
88
|
-
- `--alias`
|
|
89
|
-
- `--title`
|
|
90
|
-
- `--password`
|
|
91
|
-
- `--status`
|
|
92
|
-
- `--expires-at`
|
|
93
|
-
- `--utm-source`
|
|
94
|
-
- `--utm-medium`
|
|
95
|
-
- `--utm-campaign`
|
|
96
|
-
- `--utm-term`
|
|
97
|
-
- `--utm-content`
|
|
98
|
-
|
|
99
|
-
List flags:
|
|
100
|
-
|
|
101
|
-
- `--page`
|
|
102
|
-
- `--limit`
|
|
103
|
-
- `--search`
|
|
104
|
-
- `--sort-by`
|
|
105
|
-
- `--sort-order`
|
|
106
|
-
|
|
107
|
-
## Development
|
|
75
|
+
Delete a link:
|
|
108
76
|
|
|
109
77
|
```bash
|
|
110
|
-
|
|
111
|
-
npm run build
|
|
112
|
-
npm run typecheck
|
|
113
|
-
npm test
|
|
78
|
+
peakurl delete example
|
|
114
79
|
```
|
|
115
80
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## Release
|
|
81
|
+
When `delete` receives an alias or short code, the CLI resolves it to the underlying PeakURL row ID before deleting it.
|
|
119
82
|
|
|
120
|
-
|
|
121
|
-
Release is published.
|
|
83
|
+
## Links
|
|
122
84
|
|
|
123
|
-
|
|
124
|
-
|
|
85
|
+
- Website: https://peakurl.org/
|
|
86
|
+
- API docs: https://peakurl.org/docs/api
|
|
87
|
+
- npm package: https://www.npmjs.com/package/peakurl
|
|
88
|
+
- Issues: https://github.com/PeakURL/PeakURL-CLI/issues
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peakurl",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "PeakURL command-line interface",
|
|
5
|
+
"homepage": "https://peakurl.org/",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/PeakURL/PeakURL-CLI.git"
|
|
8
|
+
"url": "git+https://github.com/PeakURL/PeakURL-CLI.git"
|
|
8
9
|
},
|
|
9
10
|
"type": "module",
|
|
10
11
|
"bin": {
|