whats-up-dug 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 +120 -0
- package/bin/dug.js +2 -0
- package/dist/index.js +52819 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# what's up Dug?
|
|
2
|
+
|
|
3
|
+
> *"I have just met your data and I LOVE it!"*
|
|
4
|
+
|
|
5
|
+
This is Dug. A good boy who sniffs around your [Harper](https://harper.fast/) instances. Full-screen terminal UI for exploring databases, tables, and records — completely read-only, because Dug is a good boy who doesn't chew on things.
|
|
6
|
+
|
|
7
|
+
## What dug does
|
|
8
|
+
|
|
9
|
+
- Sniffs through databases, tables, and individual records
|
|
10
|
+
- Fetches pages of data sized to your terminal (no more, no less)
|
|
11
|
+
- Builds queries with conditions, sorting, and limits
|
|
12
|
+
- Fuzzy-searches and picks columns
|
|
13
|
+
- Shows you schema details, indexes, and relationships
|
|
14
|
+
- Follows foreign keys between records (dug loves to chase things)
|
|
15
|
+
- Remembers where you've connected before
|
|
16
|
+
- Keeps a debug log when asked (via [snooplogg](https://www.npmjs.com/package/snooplogg), naturally)
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install -g whats-up-dug
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or take dug for a walk without installing:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npx whats-up-dug
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
# dug will ask where to sniff
|
|
34
|
+
dug
|
|
35
|
+
|
|
36
|
+
# point dug directly at something
|
|
37
|
+
dug --url http://localhost:9925 --user HDB_ADMIN -p password
|
|
38
|
+
|
|
39
|
+
# or use environment variables
|
|
40
|
+
export HARPER_URL=http://localhost:9925
|
|
41
|
+
export HARPER_USER=HDB_ADMIN
|
|
42
|
+
export HARPER_PASSWORD=password
|
|
43
|
+
dug
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> Prefer environment variables over `-p` for passwords — CLI arguments are visible in process listings.
|
|
47
|
+
|
|
48
|
+
## Controls
|
|
49
|
+
|
|
50
|
+
dug responds to keyboard commands. He's a very trained boy.
|
|
51
|
+
|
|
52
|
+
**Everywhere:** `Esc` goes back, `q` `q` quits (double-tap so you don't leave by accident — dug doesn't want you to go).
|
|
53
|
+
|
|
54
|
+
**Browsing databases & tables**
|
|
55
|
+
|
|
56
|
+
| Key | What happens |
|
|
57
|
+
|-----|-------------|
|
|
58
|
+
| `j` / `k` | Move up/down |
|
|
59
|
+
| `Enter` | Go into it |
|
|
60
|
+
| `/` | Fuzzy filter |
|
|
61
|
+
| `i` | More info |
|
|
62
|
+
| `s` | System info |
|
|
63
|
+
| `r` | Sniff again (refresh) |
|
|
64
|
+
|
|
65
|
+
**Looking at table data**
|
|
66
|
+
|
|
67
|
+
| Key | What happens |
|
|
68
|
+
|-----|-------------|
|
|
69
|
+
| `j` / `k` | Move between rows |
|
|
70
|
+
| `Enter` | Look at this record |
|
|
71
|
+
| `n` / `p` | Next / previous page |
|
|
72
|
+
| `/` | Quick search |
|
|
73
|
+
| `f` | Query builder |
|
|
74
|
+
| `c` | Pick columns |
|
|
75
|
+
| `s` | Sort |
|
|
76
|
+
| `i` | Schema info |
|
|
77
|
+
| `r` | Sniff again |
|
|
78
|
+
|
|
79
|
+
**Inspecting a record**
|
|
80
|
+
|
|
81
|
+
| Key | What happens |
|
|
82
|
+
|-----|-------------|
|
|
83
|
+
| `j` / `k` | Scroll through fields |
|
|
84
|
+
| `Enter` | Follow a foreign key link |
|
|
85
|
+
| `y` | Copy JSON to clipboard |
|
|
86
|
+
| `PgUp` / `PgDn` | Scroll fast |
|
|
87
|
+
|
|
88
|
+
## Where dug keeps things
|
|
89
|
+
|
|
90
|
+
dug stashes a couple of files in `~/.dug/`:
|
|
91
|
+
|
|
92
|
+
- **`connections.json`** — recent connection URLs and usernames. Never passwords. dug can be trusted.
|
|
93
|
+
- **`debug.log`** — only created when you ask for it with `SNOOPLOGG` or `DEBUG` env vars.
|
|
94
|
+
|
|
95
|
+
## Debug logging
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
# dug tells you everything
|
|
99
|
+
SNOOPLOGG='dug:*' dug
|
|
100
|
+
|
|
101
|
+
# dug only talks about API calls
|
|
102
|
+
SNOOPLOGG='dug:api' dug
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Namespaces: `dug:api`, `dug:app`, `dug:nav`, `dug:connect`
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
Requires [Bun](https://bun.sh).
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
bun install
|
|
113
|
+
npm run build # Build to dist/
|
|
114
|
+
npm run dev # Run from source
|
|
115
|
+
npm run compile # Build standalone binary
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
MIT
|
package/bin/dug.js
ADDED