@youtyan/code-viewer 0.1.53 → 0.2.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 CHANGED
@@ -14,7 +14,7 @@ Requires Node.js 20 or newer when installed from npm. Development uses
14
14
  - Preview Markdown with a table of contents, task lists, Mermaid diagrams, and Shiki code highlighting.
15
15
  - Preview browser-safe media and show metadata for binary files that cannot be rendered.
16
16
  - Switch the viewer UI between English and Japanese from Viewer Settings.
17
- - Browse SQLite, PostgreSQL, and MySQL databases with a built-in database viewer.
17
+ - Browse SQLite, PostgreSQL, MySQL, Redis, and Elasticsearch with a built-in database viewer.
18
18
  - Read the built-in Help page for repository browsing, diffs, annotations, agent skills, and shortcuts.
19
19
  - Open repository folders in the OS file manager from localhost-only actions.
20
20
  - Upload files into worktree folders when upload is explicitly enabled.
@@ -118,14 +118,29 @@ code-viewer auto-discovers databases in your repository and provides a
118
118
  browser-based viewer for exploring their contents.
119
119
 
120
120
  **SQLite** files (`.db`, `.sqlite`, `.sqlite3`, `.s3db`) are detected
121
- automatically by scanning the repository tree. **PostgreSQL** and **MySQL**
122
- databases are detected from `docker-compose.yml` and connected through
123
- Docker.
121
+ automatically by scanning the repository tree. **PostgreSQL**, **MySQL**,
122
+ **Redis**, and **Elasticsearch** services are detected from any
123
+ `docker-compose.yml` (or `compose.yml`) found by the same recursive
124
+ scan — both the repository root and subdirectories are considered, so a
125
+ single `code-viewer --cwd <root>` brings up every DB defined under that
126
+ root. `.git/` and `node_modules/` are skipped. Services whose names
127
+ collide across subdirectories are kept distinct via `docker:<service>@<relDir>`
128
+ ids (cwd-direct compose files keep the historical `docker:<service>` id
129
+ for backward compatibility). Redis support is read-only: browse DB 0–15,
130
+ SCAN keys, and view values per type (string/hash/list as dedicated
131
+ panes, set/zset/stream as raw JSON). Elasticsearch support is read-only
132
+ too: list indices, view mappings, paginate docs with `search_after`, run
133
+ lucene `q=` searches, and take snapshots / diffs over `_search` iteration.
124
134
 
125
135
  ### Browser UI
126
136
 
127
137
  Open the database icon in the sidebar to access:
128
138
 
139
+ - **Multi-DB tabs** — open multiple databases side by side (each tab has
140
+ its own sidebar, panes, and history). `+` adds an empty tab; `×` or
141
+ middle-click closes one (the last tab is reset to empty instead of
142
+ vanishing). Tabs persist in `.code-viewer/tabs.json` and survive
143
+ reloads.
129
144
  - **Table browser** — paginated data grid with column sorting, text
130
145
  filtering, and CSV/JSON export.
131
146
  - **Query editor** — execute read-only SQL with syntax highlighting.
@@ -196,11 +211,26 @@ code-viewer annotate add --file web-src/server/preview.ts --line 2330-2360 \
196
211
  code-viewer annotate add --file web-src/app.ts --line 9650 \
197
212
  --from HEAD~1 --to worktree \
198
213
  --body "After the fix, reloads preserve the scroll position here."
214
+ code-viewer annotate add --after a-previous --file web-src/app.ts --line 9700 \
215
+ --body "This inserted note now appears in the middle of the walkthrough."
216
+ code-viewer annotate move a-late --before a-early
217
+ code-viewer annotate add-db --db app.db --table users --tab schema \
218
+ --body "This table is the identity root for user-facing records."
219
+ code-viewer annotate add-db --db app.db --table orders --tab data \
220
+ --grid-search failed --filter status=failed --sort created_at:desc \
221
+ --body "This restores the filtered failure investigation view."
222
+ code-viewer annotate add-db --db app.db --tab query \
223
+ --sql "select * from orders where status = 'failed'" --run-query \
224
+ --body "This reopens the exact query result being discussed."
199
225
  ```
200
226
 
201
227
  The body is Markdown. Long bodies can be passed with `--body-file <path>` or
202
228
  piped through stdin. `code-viewer annotate --help` shows all commands,
203
- including `list`, `delete <id>`, and `clear`. For AI agents,
229
+ including `move`, `edit`, `list`, `delete <id>`, and `clear`. `add` and
230
+ `add-db` accept `--before <id>`, `--after <id>`, or `--position <n>` when a
231
+ note belongs somewhere other than the end. On the Database screen, the
232
+ annotations panel also has a pin button that captures the current data grid,
233
+ query editor, or global search state as a database annotation. For AI agents,
204
234
  `code-viewer annotate agent-help` prints a skill-style guide covering the
205
235
  workflow, conventions, and pitfalls for writing good walkthroughs.
206
236
 
@@ -225,7 +255,9 @@ than the current directory, or `--server <url>` to target a specific server.
225
255
 
226
256
  `add` appends to the most recent session (creating one when none exists);
227
257
  run `annotate start` again to begin a new session, or pass `--session <id>`
228
- to target a specific one.
258
+ to target a specific one. When `--before` or `--after` is used, the target
259
+ session is inferred from that anchor annotation; a conflicting `--session`
260
+ is rejected.
229
261
 
230
262
  The in-app Help page includes a dedicated annotations guide for AI agents,
231
263
  covering when to start a session, how to choose focused line ranges, how to