Skip to content

Commit e83b44a

Browse files
authored
Merge pull request #1969 from dbcli/RW/prefer-forward-slash-in-readme
Prefer forward-slash `/command` forms in markdown documentation
2 parents be08bce + fe82712 commit e83b44a

3 files changed

Lines changed: 29 additions & 28 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Features
5959
- `SELECT * FROM users WHERE <tab>` will only show column names.
6060
* Support for multiline queries.
6161
* Favorite queries with optional positional parameters. Save a query using
62-
`\fs <alias> <query>` and execute it with `\f <alias>`.
62+
`/fs <alias> <query>` and execute it with `/f <alias>`.
6363
* Timing of sql statements and table rendering.
6464
* Log every query and its results to a file (disabled by default).
6565
* Pretty print tabular data (with colors!).

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Documentation
3131
---------
3232
* Show section when recommending `default_character_set` setting.
3333
* Prefer forward-slash /command forms in TIPS.
34+
* Prefer forward-slash /command forms in markdown documentation.
3435

3536

3637
Internal

doc/llm.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Using the \llm Command (AI-assisted SQL)
1+
# Using the /llm Command (AI-assisted SQL)
22

3-
The `\llm` special command lets you ask natural-language questions and get SQL proposed for you. It uses the open‑source `llm` CLI under the hood and enriches your prompt with database context (schema and one sample row per table) so answers can include runnable SQL.
3+
The `/llm` special command lets you ask natural-language questions and get SQL proposed for you. It uses the open‑source `llm` CLI under the hood and enriches your prompt with database context (schema and one sample row per table) so answers can include runnable SQL.
44

5-
Alias: `\ai` works the same as `\llm`.
5+
Alias: `/ai` works the same as `/llm`.
66

77
---
88

@@ -20,13 +20,13 @@ pip install llm
2020
2) From the mycli prompt, configure your API key (only needed for remote providers like OpenAI):
2121

2222
```text
23-
\llm keys set openai
23+
/llm keys set openai
2424
```
2525

2626
3) Ask a question. The response’s SQL (inside a ```sql fenced block) is extracted and pre-filled at the prompt:
2727

2828
```text
29-
World> \llm "Capital of India?"
29+
World> /llm "Capital of India?"
3030
-- Answer text from the model...
3131
-- ```sql
3232
-- SELECT ...;
@@ -40,7 +40,7 @@ You can now hit Enter to run, or edit the query first.
4040

4141
## What Context Is Sent
4242

43-
When you ask a plain question via `\llm "..."`, mycli:
43+
When you ask a plain question via `/llm "..."`, mycli:
4444
- Sends your question.
4545
- Adds your current database schema: table names with column types.
4646
- Adds one sample row (if available) from each table.
@@ -53,27 +53,27 @@ Note: Context is gathered from the current connection. If you are not connected,
5353

5454
## Using `llm` Subcommands from mycli
5555

56-
You can run any `llm` CLI subcommand by prefixing it with `\llm` inside mycli. Examples:
56+
You can run any `llm` CLI subcommand by prefixing it with `/llm` inside mycli. Examples:
5757

5858
- List models:
5959
```text
60-
\llm models
60+
/llm models
6161
```
6262
- Set the default model:
6363
```text
64-
\llm models default gpt-5
64+
/llm models default gpt-5
6565
```
6666
- Set provider API key:
6767
```text
68-
\llm keys set openai
68+
/llm keys set openai
6969
```
7070
- Install a plugin (e.g., local models via Ollama):
7171
```text
72-
\llm install llm-ollama
72+
/llm install llm-ollama
7373
```
7474
After installing or uninstalling plugins, mycli will restart to pick up new commands.
7575

76-
Tab completion works for `\llm` subcommands, and even for model IDs under `models default`.
76+
Tab completion works for `/llm` subcommands, and even for model IDs under `models default`.
7777

7878
Aside: <https://ollama.com/> for using local models.
7979

@@ -84,7 +84,7 @@ Aside: <https://ollama.com/> for using local models.
8484
Ask your question in quotes. mycli sends database context and extracts a SQL block if present.
8585

8686
```text
87-
World> \llm "Most visited urls?"
87+
World> /llm "Most visited urls?"
8888
```
8989

9090
Behavior:
@@ -98,9 +98,9 @@ Behavior:
9898
Use `-c` to ask a follow‑up that continues the previous conversation with the model. This does not re-send the DB context; it relies on the ongoing thread.
9999

100100
```text
101-
World> \llm "Top 10 customers by spend"
101+
World> /llm "Top 10 customers by spend"
102102
-- model returns analysis and a ```sql block; SQL is prefilled
103-
World> \llm -c "Now include each customer's email and order count"
103+
World> /llm -c "Now include each customer's email and order count"
104104
```
105105

106106
Behavior:
@@ -115,29 +115,29 @@ Behavior:
115115

116116
- List available models:
117117
```text
118-
World> \llm models
118+
World> /llm models
119119
```
120120

121121
- Change default model:
122122
```text
123-
World> \llm models default llama3
123+
World> /llm models default llama3
124124
```
125125

126126
- Set API key (for providers that require it):
127127
```text
128-
World> \llm keys set openai
128+
World> /llm keys set openai
129129
```
130130

131131
- Ask a question with context:
132132
```text
133-
World> \llm "Capital of India?"
133+
World> /llm "Capital of India?"
134134
```
135135

136136
- Use a local model (after installing a plugin such as `llm-ollama`):
137137
```text
138-
World> \llm install llm-ollama
139-
World> \llm models default llama3
140-
World> \llm "Top 10 customers by spend"
138+
World> /llm install llm-ollama
139+
World> /llm models default llama3
140+
World> /llm "Top 10 customers by spend"
141141
```
142142

143143
See: <https://ollama.com/> for details.
@@ -149,13 +149,13 @@ See: <https://ollama.com/> for details.
149149
mycli uses a saved `llm` template named `mycli-llm-template` for contextual questions. You can view or edit it:
150150

151151
```text
152-
World> \llm templates edit mycli-llm-template
152+
World> /llm templates edit mycli-llm-template
153153
```
154154

155155
Tip: After first use, mycli ensures this template exists. To just view it without editing, use:
156156

157157
```text
158-
World> \llm templates show mycli-llm-template
158+
World> /llm templates show mycli-llm-template
159159
```
160160

161161
---
@@ -164,15 +164,15 @@ World> \llm templates show mycli-llm-template
164164

165165
- No SQL pre-fill: Ensure the model’s response includes a ```sql fenced block. The built‑in prompt encourages this, but some models may omit it; try asking the model to include SQL in a ```sql block.
166166
- Not connected to a database: Contextual questions require a live connection. Connect first. Follow‑ups with `-c` only help after a successful contextual call.
167-
- Plugin changes not recognized: After `\llm install` or `\llm uninstall`, mycli restarts automatically to load new commands.
168-
- Provider/API issues: Use `\llm keys list` and `\llm keys set <provider>` to check credentials. Use `\llm models` to confirm available models.
167+
- Plugin changes not recognized: After `/llm install` or `/llm uninstall`, mycli restarts automatically to load new commands.
168+
- Provider/API issues: Use `/llm keys list` and `/llm keys set <provider>` to check credentials. Use `/llm models` to confirm available models.
169169

170170
---
171171

172172
## Notes and Safety
173173

174174
- Data sent: Contextual questions send schema (table/column names and types) and a single sample row per table. Review your data sensitivity policies before using remote models; prefer local models (such as ollama) if needed.
175-
- Help: Running `\llm` with no arguments shows a short usage message.
175+
- Help: Running `/llm` with no arguments shows a short usage message.
176176

177177
## Turning Off LLM Support
178178

0 commit comments

Comments
 (0)