Skip to content

Commit 82710fd

Browse files
committed
Add AI command
1 parent 18ba162 commit 82710fd

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

src/commands/ai/ai.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { OptionValues } from 'commander'
2+
3+
import { chalk, log } from '../../utils/command-helpers.js'
4+
import BaseCommand from '../base-command.js'
5+
6+
export const aiCommand = (_options: OptionValues, _command: BaseCommand) => {
7+
log(`${chalk.greenBright('🤖 Netlify AI Assistant')}
8+
9+
Welcome to the Netlify AI command! This is a foundation for AI-powered development tools.
10+
11+
${chalk.gray('This command is currently in development. More features coming soon!')}
12+
13+
Available options:
14+
${chalk.cyan('--help')} Show this help message
15+
${chalk.cyan('--version')} Show version information
16+
17+
${chalk.gray('Future features will include:')}
18+
• Project analysis and optimization suggestions
19+
• Configuration generation and optimization
20+
• AI-powered development assistance
21+
22+
Use ${chalk.cyan('netlify ai --help')} for more information.`)
23+
}

src/commands/ai/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { OptionValues } from 'commander'
2+
3+
import BaseCommand from '../base-command.js'
4+
5+
export const createAiCommand = (program: BaseCommand) => {
6+
program
7+
.command('ai')
8+
.description('AI-powered development tools')
9+
.option('--json', 'Output information as JSON')
10+
.action(async (options: OptionValues, command: BaseCommand) => {
11+
const { aiCommand } = await import('./ai.js')
12+
aiCommand(options, command)
13+
})
14+
}

src/commands/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import getCLIPackageJson from '../utils/get-cli-package-json.js'
2222
import { didEnableCompileCache } from '../utils/nodejs-compile-cache.js'
2323
import { track, reportError } from '../utils/telemetry/index.js'
2424

25+
import { createAiCommand } from './ai/index.js'
2526
import { createApiCommand } from './api/index.js'
2627
import BaseCommand from './base-command.js'
2728
import { createBlobsCommand } from './blobs/blobs.js'
@@ -214,6 +215,7 @@ export const createMainCommand = (): BaseCommand => {
214215
const program = new BaseCommand('netlify')
215216

216217
// register all the commands
218+
createAiCommand(program)
217219
createApiCommand(program)
218220
createBlobsCommand(program)
219221
createBuildCommand(program)

0 commit comments

Comments
 (0)