@@ -10,23 +10,23 @@ import { getConfigPath, loadConfig } from '../../config'
1010import fs from 'fs'
1111import { 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
7474export 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}
0 commit comments