Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 503e367

Browse files
committed
update(doc)
1 parent edfea8f commit 503e367

2 files changed

Lines changed: 27 additions & 25 deletions

File tree

README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A terminal-based database client written in Go with vim-mode editing, multi-data
66

77
- **Databases**: PostgreSQL, MySQL, SQLite, MSSQL
88
- **Three-panel layout**: Explorer | Query Editor | Results — each pane shows **key hints** on the bottom border (long lines truncate if the pane is narrow)
9-
- **AI assistant** (optional right column): chat with a configured CLI (e.g. `cursor-agent`), per connection/database; transcript with **Normal** mode cursor (reverse-video cell like the query editor) and **Insert** for prompts; `enter` in Normal copies the latest AI SQL from a fenced `sql` code block to the query editor; `@` / `#` insert table/column names from schema
9+
- **AI assistant** (optional right column, **experimental** for now): chat with a configured CLI (e.g. `cursor-agent`), per connection/database; transcript with **Normal** mode cursor (reverse-video cell like the query editor) and **Insert** for prompts; `enter` in Normal copies the latest AI SQL from a fenced `sql` code block to the query editor; `@` / `#` insert table/column names from schema
1010
- **Vim mode**: Normal and Insert mode with motions (h/j/k/l, w/b, gg/G, dd, etc.)
1111
- **Multi-query support**: Separate queries by blank lines; execute the one under the cursor
1212
- **SQL syntax highlighting** via chroma
@@ -96,15 +96,15 @@ Each pane’s **top border** shows its name and focus key: `[e] Explorer`, `[q]
9696
## Keybindings
9797

9898
### Global
99-
| Key | Action |
100-
| -------- | ----------------------------------------------------------------------------------------------- |
101-
| `e` | Focus explorer |
102-
| `q` | Focus editor |
103-
| `r` | Focus results |
99+
| Key | Action |
100+
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101+
| `e` | Focus explorer |
102+
| `q` | Focus editor |
103+
| `r` | Focus results |
104104
| `a` | Show the AI pane if it was hidden, then focus it. If the AI pane already has focus, `a` does **not** hide it — open the palette (**space**) and press **`a`** to **toggle** the AI column on or off. |
105-
| `space` | Open command palette (then press a letter: e.g. **`n`** add connection with explorer focused, **`a`** toggle AI pane from explorer / editor / results / AI) |
106-
| `?` | Toggle help (fixed-size popup; `j`/`k`, `g`/`G`, PgUp/PgDn scroll; `?`/`esc`/`q` close) |
107-
| `ctrl+c` | Quit |
105+
| `space` | Open command palette (then press a letter: e.g. **`n`** add connection with explorer focused, **`a`** toggle AI pane from explorer / editor / results / AI) |
106+
| `?` | Toggle help (fixed-size popup; `j`/`k`, `g`/`G`, PgUp/PgDn scroll; `?`/`esc`/`q` close) |
107+
| `ctrl+c` | Quit |
108108

109109
### Explorer
110110
| Key | Action |
@@ -122,7 +122,7 @@ Each pane’s **top border** shows its name and focus key: `[e] Explorer`, `[q]
122122
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
123123
| `tab` | Next query tab (explorer selection follows) |
124124
| `shift+tab` | Previous query tab |
125-
| `i` / `a` / `o` | Enter insert mode |
125+
| `i` / `o` | Enter insert mode |
126126
| `enter` | Execute query under cursor. If the block is **only** multiple `DELETE` and/or `UPDATE` statements separated by `;`, they run **one after another**; the results grid shows `#` and `rows_affected` per statement. |
127127
| `u` | Undo last edit (per tab; up to 200 steps). One undo step covers a whole insert session (from `i`/`a`/… until `esc`), plus normal-mode edits |
128128
| `ctrl+r` | Redo (normal mode only; see insert mode for run-query) |
@@ -173,30 +173,32 @@ The **active cell** uses a stronger highlight than the rest of the cursor row.
173173

174174
### AI Assistant
175175

176+
This pane is **experimental**: behavior, CLI integration, and UX may change or break as it is tried out; it is not treated as a stable product surface yet.
177+
176178
Shown as a **right column** when visible; width is `layout.ai_pane_width_pct` in `config.json`. Chats are **per** `connection:database` (same key as query tabs). The bottom **status row** in the pane summarizes mode, scroll %, and optional history size warning.
177179

178-
| Mode / keys | Action |
179-
| ----------- | ------ |
180+
| Mode / keys | Action |
181+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
180182
| **Normal** (default) | Transcript area: **block cursor** (reversed cell) on the current line/column — move with `h`/`j`/`k`/`l` or arrows; page keys (`f`/`b`, PgUp/PgDn, `d`/`u`, space) and the **mouse wheel** scroll the view and keep the cursor oriented. Long lines scroll horizontally with the cursor. |
181-
| `J` / `K` | Jump to the **next** / **previous** fenced `sql` block (same idea as **J**/**K** between query blocks in the editor). |
182-
| `i` | **Insert** — type in the prompt area; `enter` sends (when not loading). |
183-
| `esc` | Insert → Normal (blur prompt). |
184-
| `enter` (Normal) | Copy the fenced `sql` block **on the cursor line** (or the nearest block) to the **query editor**. |
185-
| `@` (Insert) | Open table picker (schema tables; filter by typing). |
186-
| `#` (Insert) | Open column picker for the current database. |
183+
| `J` / `K` | Jump to the **next** / **previous** fenced `sql` block (same idea as **J**/**K** between query blocks in the editor). |
184+
| `i` | **Insert** — type in the prompt area; `enter` sends (when not loading). |
185+
| `esc` | Insert → Normal (blur prompt). |
186+
| `enter` (Normal) | Copy the fenced `sql` block **on the cursor line** (or the nearest block) to the **query editor**. |
187+
| `@` (Insert) | Open table picker (schema tables; filter by typing). |
188+
| `#` (Insert) | Open column picker for the current database. |
187189

188190
While the prompt field is active (Insert or an `@`/`#` menu), global `e`/`q`/`r`/`a` shortcuts are suppressed until you `esc` the overlay or leave Insert.
189191

190192
### Command Palette (space)
191193

192194
Press **space** to open the palette, then the **second** key (e.g. **space** then **a** toggles the AI pane from explorer, editor, results, or AI). **Add connection** is **`n`** (explorer palette only), not `a`.
193195

194-
| Panel | Commands |
195-
| -------- | ------------------------------------------------------------------------------------------------- |
196-
| Explorer | `n` add connection, `e` edit, `d` delete, `R` refresh, `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
197-
| Editor | `x` execute, `c` clear, `D` close tab (confirm), `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
196+
| Panel | Commands |
197+
| -------- | --------------------------------------------------------------------------------------------------------------------- |
198+
| Explorer | `n` add connection, `e` edit, `d` delete, `R` refresh, `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
199+
| Editor | `x` execute, `c` clear, `D` close tab (confirm), `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
198200
| Results | `y` copy cell, `Y` copy row, `e` export CSV, `j` export JSON, `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
199-
| AI | `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
201+
| AI | `t` toggle explorer, `a` toggle AI pane, `f` fullscreen |
200202

201203
## History
202204

internal/app/app.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ const helpScreenText = `
15641564
EDITOR (Normal mode)
15651565
tab Next query tab
15661566
shift+tab Previous query tab
1567-
i/a/o Enter insert mode
1567+
i/o Enter insert mode
15681568
enter Execute query under cursor (batch: only DELETE/UPDATE split by ; → run in order)
15691569
u Undo edit (whole insert session until esc; normal edits undo separately)
15701570
ctrl+r Redo edit
@@ -1604,7 +1604,7 @@ const helpScreenText = `
16041604
16051605
AI ASSISTANT (Normal mode — transcript)
16061606
i Insert mode (prompt field)
1607-
hjkl / arrows Move block cursor; mouse wheel scrolls
1607+
hjkl/arrows Move block cursor; mouse wheel scrolls
16081608
J/K Jump to next / previous fenced sql code block (same idea as editor J/K query jumps)
16091609
enter Copy SQL from the block under the cursor to the query editor
16101610

0 commit comments

Comments
 (0)