errorhub-cli 1.0.0 → 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/README.md +111 -0
- package/package.json +1 -1
- package/src/index.ts +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# errorhub-cli
|
|
2
|
+
|
|
3
|
+
Official CLI for [ErrorHub](https://errorhub.vercel.app) — authenticate, manage projects and configure error tracking directly from your terminal.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g errorhub-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or use without installing:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx errorhub-cli <command>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Login to your ErrorHub account
|
|
25
|
+
errorhub login
|
|
26
|
+
|
|
27
|
+
# 2. Link your project using its API key
|
|
28
|
+
errorhub project <your-api-key>
|
|
29
|
+
|
|
30
|
+
# 3. Verify your session
|
|
31
|
+
errorhub whoami
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
### `errorhub login`
|
|
39
|
+
|
|
40
|
+
Opens your browser and walks you through the authentication flow. Your JWT token is saved locally at `~/.token.json` and reused for all subsequent commands.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
errorhub login
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### `errorhub project <apiKey>`
|
|
49
|
+
|
|
50
|
+
Links a project to your local environment using its API key. The project ID is saved to `~/projectId.json` and used by the SDK automatically.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
errorhub project abc123yourkey
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### `errorhub whoami`
|
|
59
|
+
|
|
60
|
+
Displays your currently authenticated account and token details — including expiry, role, and email decoded from the JWT.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
errorhub whoami
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### `errorhub init`
|
|
69
|
+
|
|
70
|
+
Initializes your workspace and launches the auth flow for first-time setup.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
errorhub init
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Getting Your API Key
|
|
79
|
+
|
|
80
|
+
1. Sign in at [errorhub.vercel.app](https://errorhub.vercel.app)
|
|
81
|
+
2. Open or create a project
|
|
82
|
+
3. Copy the API key from the project settings
|
|
83
|
+
4. Run `errorhub project <your-api-key>`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Token Storage
|
|
88
|
+
|
|
89
|
+
| File | Contents |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `~/.token.json` | Your JWT auth token |
|
|
92
|
+
| `~/projectId.json` | Your linked project ID |
|
|
93
|
+
|
|
94
|
+
To log out, simply delete `~/.token.json`:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
rm ~/.token.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Requirements
|
|
103
|
+
|
|
104
|
+
- Node.js `v18` or higher
|
|
105
|
+
- An account at [errorhub.vercel.app](https://errorhub.vercel.app)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT © [ErrorHub](https://errorhub.vercel.app)
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -137,9 +137,9 @@ const section = (title: string) => {
|
|
|
137
137
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
138
138
|
|
|
139
139
|
program
|
|
140
|
-
.name('errorhub')
|
|
140
|
+
.name('errorhub-cli')
|
|
141
141
|
.description('CLI with JWT login')
|
|
142
|
-
.version('1.0.
|
|
142
|
+
.version('1.0.1');
|
|
143
143
|
|
|
144
144
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
145
145
|
// INIT
|
|
@@ -171,9 +171,9 @@ program
|
|
|
171
171
|
|
|
172
172
|
const server = app.listen(port, () => {
|
|
173
173
|
stop();
|
|
174
|
-
badge.ok(`Server listening on ${c.cyan(`http://
|
|
174
|
+
badge.ok(`Server listening on ${c.cyan(`http://{FRONTENDBASE}`)}`);
|
|
175
175
|
|
|
176
|
-
const loginUrl = `${FRONTENDBASE}/login?callback=http://
|
|
176
|
+
const loginUrl = `${FRONTENDBASE}/login?callback=http://{FRONTENDBASE}/callback`;
|
|
177
177
|
|
|
178
178
|
badge.info(`Opening: ${c.cyanDim(loginUrl)}`);
|
|
179
179
|
console.log('');
|
|
@@ -214,7 +214,7 @@ program
|
|
|
214
214
|
|
|
215
215
|
const server = app.listen(port, () => {
|
|
216
216
|
stop();
|
|
217
|
-
const loginUrl = `${FRONTENDBASE}/login?callback=http://
|
|
217
|
+
const loginUrl = `${FRONTENDBASE}/login?callback=http://{FRONTENDBASE}/callback`;
|
|
218
218
|
|
|
219
219
|
badge.ok('Local callback server ready');
|
|
220
220
|
badge.loading('Opening browser for login...');
|