Skip to content

Commit f5d2ded

Browse files
committed
refactor: rename 'ai' command to 'ask' for clarity
The command uses pattern matching, not AI, so 'ask' is more accurate
1 parent fa619c0 commit f5d2ded

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

docs/CLAUDE_INSPIRED_FEATURES.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ This document describes the new features added to Socket CLI inspired by modern
44

55
## ✨ New Features
66

7-
### 1. Natural Language Command Interface (`socket ai`)
7+
### 1. Natural Language Command Interface (`socket ask`)
88

9-
Use natural language to describe what you want to do, and the AI will translate it to the appropriate Socket CLI command.
9+
Use natural language to describe what you want to do, and Socket will translate it to the appropriate CLI command.
1010

1111
```bash
1212
# Examples
13-
socket ai "scan this project for vulnerabilities"
14-
socket ai "fix all critical issues"
15-
socket ai "show me production vulnerabilities"
16-
socket ai "is express safe to use"
17-
socket ai "optimize my dependencies"
13+
socket ask "scan this project for vulnerabilities"
14+
socket ask "fix all critical issues"
15+
socket ask "show me production vulnerabilities"
16+
socket ask "is express safe to use"
17+
socket ask "optimize my dependencies"
1818

1919
# Execute directly with -e flag
20-
socket ai "scan for vulnerabilities" -e
20+
socket ask "scan for vulnerabilities" -e
2121
```
2222

23-
The AI understands various intents:
23+
The command understands various intents:
2424
- Scanning and security checks
2525
- Fixing vulnerabilities
2626
- Package optimization
@@ -120,11 +120,11 @@ Features:
120120

121121
```bash
122122
# Ask what you want in plain English
123-
socket ai "check if my production dependencies are safe"
123+
socket ask "check if my production dependencies are safe"
124124
# → Translates to: socket scan create . --prod
125125

126126
# Get help understanding commands
127-
socket ai "what does scan reach do"
127+
socket ask "what does scan reach do"
128128
# → Shows: socket scan reach --help
129129
```
130130

@@ -236,7 +236,7 @@ Potential additions based on this foundation:
236236

237237
## 📝 Notes
238238

239-
- The AI command interface uses pattern matching, not actual AI (for now)
239+
- The ask command uses pattern matching to understand natural language queries
240240
- Cache is stored in `~/.socket/_cacache`
241241
- Progress indicators automatically disable for non-TTY outputs
242242
- All features respect `--json` flag for automation

src/commands.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ import { cmdUv } from './commands/uv/cmd-uv.mts'
3737
import { cmdWhoami } from './commands/whoami/cmd-whoami.mts'
3838
import { cmdWrapper } from './commands/wrapper/cmd-wrapper.mts'
3939
import { cmdYarn } from './commands/yarn/cmd-yarn.mts'
40-
import { cmdAi } from './commands/ai/cmd-ai.mts'
40+
import { cmdAsk } from './commands/ask/cmd-ask.mts'
4141
import { isSeaBinary } from './utils/sea.mts'
4242

4343
export const rootCommands = {
44-
ai: cmdAi,
44+
ask: cmdAsk,
4545
analytics: cmdAnalytics,
4646
'audit-log': cmdAuditLog,
4747
cargo: cmdCargo,
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
CliSubcommand,
1414
} from '../../utils/meow-with-subcommands.mts'
1515

16-
export const CMD_NAME = 'ai'
16+
export const CMD_NAME = 'ask'
1717

1818
const description = 'Natural language interface - describe what you want to do'
1919

@@ -260,7 +260,7 @@ async function suggestAlternatives(input: string): Promise<string[]> {
260260
return suggestions
261261
}
262262

263-
export const cmdAi: CliSubcommand = {
263+
export const cmdAsk: CliSubcommand = {
264264
description,
265265
hidden,
266266
async run(
@@ -301,7 +301,7 @@ export const cmdAi: CliSubcommand = {
301301
302302
Description
303303
Use natural language to describe what you want to do.
304-
The AI will translate your intent into the appropriate Socket CLI command.
304+
Socket will translate your intent into the appropriate CLI command.
305305
306306
Tips
307307
• Be specific about what you want to achieve
@@ -326,9 +326,9 @@ export const cmdAi: CliSubcommand = {
326326
if (!query) {
327327
logger.error('Please provide a natural language query')
328328
logger.log('\nExamples:')
329-
logger.log(' socket ai "scan for vulnerabilities"')
330-
logger.log(' socket ai "fix critical issues"')
331-
logger.log(' socket ai "is express safe"')
329+
logger.log(' socket ask "scan for vulnerabilities"')
330+
logger.log(' socket ask "fix critical issues"')
331+
logger.log(' socket ask "is express safe"')
332332
return
333333
}
334334

@@ -356,7 +356,7 @@ export const cmdAi: CliSubcommand = {
356356
// Display the interpreted command
357357
const commandStr = `socket ${intent.command.join(' ')}`
358358

359-
logger.log(colors.cyan('🤖 AI Translation:'))
359+
logger.log(colors.cyan('🤖 Translation:'))
360360
logger.log(` ${colors.gray('"' + query + '"')}`)
361361
logger.log(` ↓`)
362362
logger.log(` ${colors.bold(commandStr)}`)
@@ -385,7 +385,7 @@ export const cmdAi: CliSubcommand = {
385385
logger.log('\n💡 To execute this command:')
386386
logger.log(` ${colors.bold(commandStr)}`)
387387
logger.log('\n Or run with --execute flag to auto-execute:')
388-
logger.log(` socket ai "${query}" --execute`)
388+
logger.log(` socket ask "${query}" --execute`)
389389
} else {
390390
logger.warn('\n⚠️ Confidence too low for auto-execution')
391391
logger.log(' Please run the command manually:')

0 commit comments

Comments
 (0)