Skip to content

Commit c3fbc73

Browse files
committed
Rename spawn to create
1 parent 1734e13 commit c3fbc73

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

packages/cli/src/commands/sandbox/spawn.ts renamed to packages/cli/src/commands/sandbox/create.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ import { getConfigPath, loadConfig } from '../../config'
1010
import fs from 'fs'
1111
import { configOption, pathOption } from '../../options'
1212

13-
export const spawnCommand = new commander.Command('spawn')
14-
.description('spawn sandbox and connect terminal to it')
13+
export const createCommand = new commander.Command('create')
14+
.description('create sandbox and connect terminal to it')
1515
.argument(
1616
'[template]',
17-
`spawn and connect to sandbox specified by ${asBold('[template]')}`,
17+
`create and connect to sandbox specified by ${asBold('[template]')}`
1818
)
1919
.addOption(pathOption)
2020
.addOption(configOption)
21-
.alias('sp')
21+
.alias('cr')
2222
.action(
2323
async (
2424
template: string | undefined,
2525
opts: {
2626
name?: string
2727
path?: string
2828
config?: string
29-
},
29+
}
3030
) => {
3131
try {
3232
const apiKey = ensureAPIKey()
@@ -49,15 +49,15 @@ export const spawnCommand = new commander.Command('spawn')
4949
? [config.template_name]
5050
: undefined,
5151
},
52-
relativeConfigPath,
53-
)}`,
52+
relativeConfigPath
53+
)}`
5454
)
5555
templateID = config.template_id
5656
}
5757

5858
if (!templateID) {
5959
console.error(
60-
'You need to specify sandbox template ID or path to sandbox template config',
60+
'You need to specify sandbox template ID or path to sandbox template config'
6161
)
6262
process.exit(1)
6363
}
@@ -68,7 +68,7 @@ export const spawnCommand = new commander.Command('spawn')
6868
console.error(err)
6969
process.exit(1)
7070
}
71-
},
71+
}
7272
)
7373

7474
export async function connectSandbox({
@@ -87,8 +87,8 @@ export async function connectSandbox({
8787

8888
console.log(
8989
`Terminal connecting to template ${asFormattedSandboxTemplate(
90-
template,
91-
)} with sandbox ID ${asBold(`${sandbox.sandboxId}`)}`,
90+
template
91+
)} with sandbox ID ${asBold(`${sandbox.sandboxId}`)}`
9292
)
9393
try {
9494
await spawnConnectedTerminal(sandbox)
@@ -97,8 +97,8 @@ export async function connectSandbox({
9797
await sandbox.kill()
9898
console.log(
9999
`Closing terminal connection to template ${asFormattedSandboxTemplate(
100-
template,
101-
)} with sandbox ID ${asBold(`${sandbox.sandboxId}`)}`,
100+
template
101+
)} with sandbox ID ${asBold(`${sandbox.sandboxId}`)}`
102102
)
103103
}
104104
}

packages/cli/src/commands/sandbox/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as commander from 'commander'
33
import { connectCommand } from './connect'
44
import { listCommand } from './list'
55
import { killCommand } from './kill'
6-
import { spawnCommand } from './spawn'
6+
import { createCommand } from './create'
77
import { logsCommand } from './logs'
88
import { metricsCommand } from './metrics'
99

@@ -13,6 +13,6 @@ export const sandboxCommand = new commander.Command('sandbox')
1313
.addCommand(connectCommand)
1414
.addCommand(listCommand)
1515
.addCommand(killCommand)
16-
.addCommand(spawnCommand)
16+
.addCommand(createCommand)
1717
.addCommand(logsCommand)
1818
.addCommand(metricsCommand)

0 commit comments

Comments
 (0)