Skip to content

Commit 3f96f1d

Browse files
committed
chore: update user agent, use only cmd
1 parent ff440e4 commit 3f96f1d

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

snippets/ai/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ This snippet adds a suite of commands accessible with the `ai` command. This inc
88
| | | |
99
|---------|-------------|---------|
1010
| `ai.ask` | Ask questions about MongoDB | `ai.ask how do I run queries in mongosh?` |
11-
| `ai.data` | Generate data-related mongosh commands | `ai.data insert some sample user info` |
12-
| `ai.query` | Generate a MongoDB query or aggregation | `ai.query find documents where name = "Ada"` |
11+
| `ai.cmd` | Generate general mongosh commands _alias:_ `ai.cmd` | `ai.cmd get sharding info` |
12+
| `ai.find` | Generate queries and aggregations based on natural language | `ai.find users with age > 30` |
1313
| `ai.collection` | Set the active collection | `ai.collection users` |
14-
| `ai.command` | Generate general mongosh commands _alias:_ `ai.cmd` | `ai.command get sharding info` |
1514
| `ai.config` | Configure the AI commands | `ai.config.set("provider", "ollama")` |
1615

1716
This currently supports 5 different AI providers: `docs, openai | mistral | atlas | ollama` and any model they support. For cloud providers, you can specify the API key with `MONGOSH_AI_API_KEY`.

snippets/ai/src/ai.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ module.exports = async (globalThis: CliContext) => {
5151
return ai;
5252
}
5353

54-
@aiCommand()
55-
async command(prompt: string) {
56-
await this.ai.shell(prompt);
57-
}
58-
5954
@aiCommand()
6055
async cmd(prompt: string) {
61-
await this.command(prompt);
56+
await this.ai.shell(prompt);
6257
}
6358

6459
@aiCommand()
@@ -94,9 +89,9 @@ module.exports = async (globalThis: CliContext) => {
9489
example: 'ai.collection users',
9590
},
9691
{
97-
cmd: 'ai.command',
92+
cmd: 'ai.cmd',
9893
desc: `generate mongosh commands`,
99-
example: 'ai.command insert a new sample document | alias: ai.cmd',
94+
example: 'ai.cmd insert a new sample document',
10095
},
10196
{
10297
cmd: 'ai.config',

0 commit comments

Comments
 (0)