@upgraide/ui-notes-cli 0.1.0 → 0.1.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 +141 -0
- package/api.ts +4 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# @upgraide/ui-notes-cli
|
|
2
|
+
|
|
3
|
+
Command-line tool to manage UI Notes — pull feedback, resolve issues, and manage projects from your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @upgraide/ui-notes-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Requires:** Bun >= 1.0.0
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Authenticate with your API server
|
|
17
|
+
uinotes login
|
|
18
|
+
|
|
19
|
+
# Pull open notes for your project
|
|
20
|
+
uinotes pull --project my-app
|
|
21
|
+
|
|
22
|
+
# Resolve a note
|
|
23
|
+
uinotes resolve 42 "Fixed in latest deploy"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
### `uinotes login`
|
|
29
|
+
|
|
30
|
+
Interactive authentication flow. Prompts for your API URL, email, and password, then generates and saves an API key locally.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uinotes login
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The API key is saved to `~/.uinotes.json` (or `.uinotes.json` in the current directory if one exists).
|
|
37
|
+
|
|
38
|
+
### `uinotes config`
|
|
39
|
+
|
|
40
|
+
View or update configuration.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Show current config
|
|
44
|
+
uinotes config
|
|
45
|
+
|
|
46
|
+
# Set a value
|
|
47
|
+
uinotes config set apiUrl https://my-api.example.com
|
|
48
|
+
uinotes config set defaultProject my-app
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Config keys:** `apiUrl`, `apiKey`, `defaultProject`
|
|
52
|
+
|
|
53
|
+
### `uinotes projects`
|
|
54
|
+
|
|
55
|
+
Manage projects.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# List all projects
|
|
59
|
+
uinotes projects
|
|
60
|
+
|
|
61
|
+
# Include archived projects
|
|
62
|
+
uinotes projects --archived
|
|
63
|
+
|
|
64
|
+
# Create a project with URL patterns
|
|
65
|
+
uinotes projects create my-app "My Application" --url "https://myapp.com/*"
|
|
66
|
+
|
|
67
|
+
# Get project details
|
|
68
|
+
uinotes projects get my-app
|
|
69
|
+
|
|
70
|
+
# Rename a project
|
|
71
|
+
uinotes projects rename my-app "New Name"
|
|
72
|
+
|
|
73
|
+
# Add/remove URL patterns
|
|
74
|
+
uinotes projects add-url my-app "https://staging.myapp.com/*"
|
|
75
|
+
uinotes projects remove-url my-app "https://old.myapp.com/*"
|
|
76
|
+
|
|
77
|
+
# Archive a project
|
|
78
|
+
uinotes projects delete my-app
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `uinotes pull`
|
|
82
|
+
|
|
83
|
+
Fetch notes from the API.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uinotes pull
|
|
87
|
+
uinotes pull --project my-app --status open --type bug --limit 50
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
| Option | Description |
|
|
91
|
+
|--------|-------------|
|
|
92
|
+
| `--project <name>` | Filter by project (overrides default) |
|
|
93
|
+
| `--status <status>` | Filter by status (`open`, `resolved`, `wontfix`) |
|
|
94
|
+
| `--type <type>` | Filter by type (`bug`, `ux`, `feature`, `question`) |
|
|
95
|
+
| `--limit <n>` | Max number of results |
|
|
96
|
+
|
|
97
|
+
### `uinotes resolve`
|
|
98
|
+
|
|
99
|
+
Mark a note as resolved.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
uinotes resolve <id> [message]
|
|
103
|
+
uinotes resolve 42 "Fixed in v2.1" --project my-app
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `uinotes wontfix`
|
|
107
|
+
|
|
108
|
+
Mark a note as won't fix.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
uinotes wontfix <id> [message]
|
|
112
|
+
uinotes wontfix 99 "Out of scope for this release"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Configuration
|
|
116
|
+
|
|
117
|
+
The CLI looks for config in two places (local takes priority):
|
|
118
|
+
|
|
119
|
+
1. **Local:** `.uinotes.json` in the current directory
|
|
120
|
+
2. **Global:** `~/.uinotes.json` in your home directory
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"apiUrl": "http://localhost:3000",
|
|
125
|
+
"apiKey": "your-api-key",
|
|
126
|
+
"defaultProject": "my-app"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
API keys are redacted when displayed with `uinotes config`.
|
|
131
|
+
|
|
132
|
+
## Global Options
|
|
133
|
+
|
|
134
|
+
| Option | Description |
|
|
135
|
+
|--------|-------------|
|
|
136
|
+
| `--project <name>` | Override default project for this command |
|
|
137
|
+
| `--help`, `-h` | Show help |
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|
package/api.ts
CHANGED
|
@@ -20,7 +20,10 @@ export async function apiFetch(
|
|
|
20
20
|
headers['Content-Type'] = 'application/json';
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
// Prefix /api if not already present
|
|
24
|
+
const apiPath = path.startsWith('/api') ? path : `/api${path}`;
|
|
25
|
+
|
|
26
|
+
const res = await fetch(`${config.apiUrl}${apiPath}`, {
|
|
24
27
|
method,
|
|
25
28
|
headers,
|
|
26
29
|
body: body ? (typeof body === 'string' ? body : JSON.stringify(body)) : undefined,
|