Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Standardize naming

Vasek Mlejnsky6f1ee7ed41b0
diff --git a/packages/cli/src/commands/auth/index.ts b/packages/cli/src/commands/auth/index.ts
index 56a6cca6a..4931dd450 100644
--- a/packages/cli/src/commands/auth/index.ts
+++ b/packages/cli/src/commands/auth/index.ts
@@ -4,7 +4,7 @@ import { logoutCommand } from './logout'
import { infoCommand } from './info'
-export const authCommand = new commander.Command('auth').description('Authentication commands')
+export const authCommand = new commander.Command('auth').description('authentication commands')
.addCommand(loginCommand)
.addCommand(logoutCommand)
.addCommand(infoCommand)
diff --git a/packages/cli/src/commands/auth/info.ts b/packages/cli/src/commands/auth/info.ts
index 0d0593d1d..7aae0d76d 100644
--- a/packages/cli/src/commands/auth/info.ts
+++ b/packages/cli/src/commands/auth/info.ts
@@ -4,7 +4,7 @@ import { getUserConfig } from 'src/user'
import { asBold, asFormattedError } from 'src/utils/format'
export const infoCommand = new commander.Command('info')
- .description('Get information about the current user')
+ .description('get information about the current user')
.action(async () => {
let userConfig
try {
diff --git a/packages/cli/src/commands/auth/login.ts b/packages/cli/src/commands/auth/login.ts
index e02d08766..06e86fe1b 100644
--- a/packages/cli/src/commands/auth/login.ts
+++ b/packages/cli/src/commands/auth/login.ts
@@ -10,7 +10,7 @@ import { DOCS_BASE, getUserConfig, USER_CONFIG_PATH, UserConfig } from 'src/user
import { asBold, asFormattedError } from 'src/utils/format'
export const loginCommand = new commander.Command('login')
- .description('Log in to CLI')
+ .description('log in to CLI')
.action(async () => {
let userConfig
try {
diff --git a/packages/cli/src/commands/auth/logout.ts b/packages/cli/src/commands/auth/logout.ts
index 3861d3ebf..2ac5d41c3 100644
--- a/packages/cli/src/commands/auth/logout.ts
+++ b/packages/cli/src/commands/auth/logout.ts
@@ -4,7 +4,7 @@ import * as fs from 'fs'
import { USER_CONFIG_PATH } from 'src/user'
export const logoutCommand = new commander.Command('logout')
- .description('Log out of CLI')
+ .description('log out of CLI')
.action(() => {
if (fs.existsSync(USER_CONFIG_PATH)) {
fs.unlinkSync(USER_CONFIG_PATH) // Delete user config
diff --git a/packages/cli/src/commands/sandbox/connect.ts b/packages/cli/src/commands/sandbox/connect.ts
index 3fefb51c0..ed7547e46 100644
--- a/packages/cli/src/commands/sandbox/connect.ts
+++ b/packages/cli/src/commands/sandbox/connect.ts
@@ -6,8 +6,8 @@ import { asBold, asPrimary } from 'src/utils/format'
import { ensureAPIKey } from '../../api'
export const connectCommand = new commander.Command('connect')
- .description('Connect terminal to already running sandbox')
- .argument('<sandboxID>', `Connect to sandbox with ${asBold('<sandboxID>')}`)
+ .description('connect terminal to already running sandbox')
+ .argument('<sandboxID>', `connect to sandbox with ${asBold('<sandboxID>')}`)
.alias('cn')
.action(async (sandboxID: string) => {
try {
@@ -15,7 +15,7 @@ export const connectCommand = new commander.Command('connect')
if (!sandboxID) {
console.error(
- `You need to specify sandbox ID`,
+ 'You need to specify sandbox ID',
)
process.exit(1)
}
diff --git a/packages/cli/src/commands/sandbox/index.ts b/packages/cli/src/commands/sandbox/index.ts
index c44b66570..228ea3cf5 100644
--- a/packages/cli/src/commands/sandbox/index.ts
+++ b/packages/cli/src/commands/sandbox/index.ts
@@ -5,7 +5,7 @@ import { listCommand } from './list'
import { killCommand } from './kill'
import { spawnCommand } from './spawn'
-export const sandboxCommand = new commander.Command('sandbox').description('Work with sandboxes')
+export const sandboxCommand = new commander.Command('sandbox').description('work with sandboxes')
.alias('sbx')
.addCommand(connectCommand)
.addCommand(listCommand)
diff --git a/packages/cli/src/commands/sandbox/kill.ts b/packages/cli/src/commands/sandbox/kill.ts
index 473e04556..2a5bbfc0a 100644
--- a/packages/cli/src/commands/sandbox/kill.ts
+++ b/packages/cli/src/commands/sandbox/kill.ts
@@ -9,8 +9,8 @@ const killSandbox = e2b.withAPIKey(
e2b.api.path('/sandboxes/{sandboxID}').method('delete').create(),
)
export const killCommand = new commander.Command('kill')
- .description('Kill sandbox')
- .argument('<sandboxID>', `Kill the sandbox specified by ${asBold('<sandboxID>')}`)
+ .description('kill sandbox')
+ .argument('<sandboxID>', `kill the sandbox specified by ${asBold('<sandboxID>')}`)
.alias('kl')
.action(async (sandboxID: string) => {
try {
@@ -21,7 +21,7 @@ export const killCommand = new commander.Command('kill')
process.exit(1)
}
- await killSandbox( apiKey, { sandboxID } )
+ await killSandbox(apiKey, { sandboxID })
console.log(`Sandbox ${asBold(sandboxID)} has been killed`)
} catch (err: any) {
diff --git a/packages/cli/src/commands/sandbox/list.ts b/packages/cli/src/commands/sandbox/list.ts
index d71fdeb26..153c253b1 100644
--- a/packages/cli/src/commands/sandbox/list.ts
+++ b/packages/cli/src/commands/sandbox/list.ts
@@ -9,7 +9,7 @@ const listRunningSandboxes = e2b.withAPIKey(
)
export const listCommand = new commander.Command('list')
- .description('List all running sandboxes')
+ .description('list all running sandboxes')
.alias('ls')
.action(async () => {
try {
@@ -26,8 +26,8 @@ export const listCommand = new commander.Command('list')
{ name: 'templateID', alignment: 'left', title: 'Template ID' },
{ name: 'alias', alignment: 'left', title: 'Alias' },
{ name: 'startedAt', alignment: 'left', title: 'Started at' },
- { name: 'cpuCount', alignment: 'left', title: 'CPUs'},
- { name: 'memoryMB', alignment: 'left', title: 'RAM MB'},
+ { name: 'cpuCount', alignment: 'left', title: 'CPUs' },
+ { name: 'memoryMB', alignment: 'left', title: 'RAM MB' },
{ name: 'metadata', alignment: 'left', title: 'Metadata' },
],
disabledColumns: ['clientID'],
diff --git a/packages/cli/src/commands/sandbox/spawn.ts b/packages/cli/src/commands/sandbox/spawn.ts
index 13563e76b..35fa899f0 100644
--- a/packages/cli/src/commands/sandbox/spawn.ts
+++ b/packages/cli/src/commands/sandbox/spawn.ts
@@ -11,8 +11,8 @@ import fs from 'fs'
import { pathOption } from '../../options'
export const spawnCommand = new commander.Command('spawn')
- .description('Spawn sandbox and connect terminal to it')
- .argument('[template]', `Spawn and connect to sandbox specified by ${asBold('[template]')}`)
+ .description('spawn sandbox and connect terminal to it')
+ .argument('[template]', `spawn and connect to sandbox specified by ${asBold('[template]')}`)
.addOption(pathOption)
.alias('sp')
.action(async (template: string | undefined, opts: {
@@ -46,7 +46,7 @@ export const spawnCommand = new commander.Command('spawn')
if (!templateID) {
console.error(
- `You need to specify sandbox template ID or path to sandbox template config`,
+ 'You need to specify sandbox template ID or path to sandbox template config',
)
process.exit(1)
}
diff --git a/packages/cli/src/commands/template/build.ts b/packages/cli/src/commands/template/build.ts
index 0e6bf232a..692f3f7fc 100644
--- a/packages/cli/src/commands/template/build.ts
+++ b/packages/cli/src/commands/template/build.ts
@@ -33,44 +33,44 @@ const getTemplate = e2b.withAccessToken(
export const buildCommand = new commander.Command('build')
.description(
- `Build sandbox template defined by ${asLocalRelative(
+ `build sandbox template defined by ${asLocalRelative(
defaultDockerfileName,
)} or ${asLocalRelative(
fallbackDockerfileName,
)} in root directory. By default the root directory is the current working directory. This command also creates ${asLocal(
configName,
- )} config`,
+ )} config.`,
)
.argument(
'[template]',
- `Specify ${asBold(
+ `specify ${asBold(
'[template]',
)} to rebuild it. If you don's specify ${asBold(
'[template]',
- )} and there is no ${asLocal('e2b.toml')} a new sandbox template will be created`,
+ )} and there is no ${asLocal('e2b.toml')} a new sandbox template will be created.`,
)
.addOption(pathOption)
.option(
'-d, --dockerfile <file>',
- `Specify path to Dockerfile. By default E2B tries to find ${asLocal(
+ `specify path to Dockerfile. By default E2B tries to find ${asLocal(
defaultDockerfileName,
- )} or ${asLocal(fallbackDockerfileName)} in root directory`,
+ )} or ${asLocal(fallbackDockerfileName)} in root directory.`,
)
.option(
'-n, --name <template-name>',
- 'Specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores',
+ 'specify sandbox template name. You can use the template name to start the sandbox with SDK. The template name must be lowercase and contain only letters, numbers, dashes and underscores.',
)
.option(
'-c, --cmd <start-command>',
- 'Specify command that will be executed when the sandbox is started',
+ 'specify command that will be executed when the sandbox is started.',
)
.option(
'--cpu-count <cpu-count>',
- 'Specify the number of CPUs that will be used to run the sandbox. The default value is 2.',
+ 'specify the number of CPUs that will be used to run the sandbox. The default value is 2.',
)
.option(
'--memory-mb <memory-mb>',
- 'Specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.',
+ 'specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.',
)
.alias('bd')
.action(
@@ -206,7 +206,7 @@ export const buildCommand = new commander.Command('build')
const estimatedSize = estimateContentLength(body)
if (estimatedSize > maxContentSize) {
console.error(
- `The sandbox template build context is too large ${asLocal(`${Math.round(estimatedSize / 1024 / 1024 * 100) /100} MiB`)}. The maximum size is ${asLocal(
+ `The sandbox template build context is too large ${asLocal(`${Math.round(estimatedSize / 1024 / 1024 * 100) / 100} MiB`)}. The maximum size is ${asLocal(
`${maxContentSize / 1024 / 1024} MiB.`)}\n\nCheck if you are not including unnecessary files in the build context (e.g. node_modules)`,
)
process.exit(1)
diff --git a/packages/cli/src/commands/template/delete.ts b/packages/cli/src/commands/template/delete.ts
index 73bb6cc3e..0097fb21b 100644
--- a/packages/cli/src/commands/template/delete.ts
+++ b/packages/cli/src/commands/template/delete.ts
@@ -24,7 +24,7 @@ const deleteTemplate = e2b.withAccessToken(
)
export const deleteCommand = new commander.Command('delete')
- .description(`Delete sandbox template and ${asLocal(configName)} config`)
+ .description(`delete sandbox template and ${asLocal(configName)} config`)
.argument(
'[template]',
`Specify ${asBold(
diff --git a/packages/cli/src/commands/template/index.ts b/packages/cli/src/commands/template/index.ts
index 1d6db0caf..69252fc12 100644
--- a/packages/cli/src/commands/template/index.ts
+++ b/packages/cli/src/commands/template/index.ts
@@ -5,7 +5,7 @@ import { listCommand } from './list'
import { initCommand } from './init'
import { deleteCommand } from './delete'
-export const templateCommand = new commander.Command('template').description('Manage sandbox templates')
+export const templateCommand = new commander.Command('template').description('manage sandbox templates')
.alias('tpl')
.addCommand(buildCommand)
.addCommand(listCommand)
diff --git a/packages/cli/src/commands/template/init.ts b/packages/cli/src/commands/template/init.ts
index 2f2de2bff..b29c230c2 100644
--- a/packages/cli/src/commands/template/init.ts
+++ b/packages/cli/src/commands/template/init.ts
@@ -10,7 +10,7 @@ import { asLocalRelative, asPrimary } from 'src/utils/format'
export const initCommand = new commander.Command('init')
.description(
- `Create basic E2B Dockerfile (${asLocalRelative('e2b.Dockerfile')}) in root directory. You can then run ${asPrimary('e2b template build')} to build sandbox template from this Dockerfile`,
+ `create basic E2B Dockerfile (${asLocalRelative('e2b.Dockerfile')}) in root directory. You can then run ${asPrimary('e2b template build')} to build sandbox template from this Dockerfile`,
)
.addOption(pathOption)
.alias('it')
diff --git a/packages/cli/src/commands/template/list.ts b/packages/cli/src/commands/template/list.ts
index b8d83f64f..da66bb2b6 100644
--- a/packages/cli/src/commands/template/list.ts
+++ b/packages/cli/src/commands/template/list.ts
@@ -11,7 +11,7 @@ const listTemplates = e2b.withAccessToken(
)
export const listCommand = new commander.Command('list')
- .description('List sandbox templates')
+ .description('list sandbox templates')
.alias('ls')
.action(async () => {
try {
diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts
index ca33ee5b5..b9b591dc2 100644
--- a/packages/cli/src/index.ts
+++ b/packages/cli/src/index.ts
@@ -15,7 +15,7 @@ updateNotifier.default({
}).notify()
program
- .version(packageJSON.version, undefined, 'Display E2B CLI version')
+ .version(packageJSON.version, undefined, 'display E2B CLI version')
.addOption(new Option('-cmd2json').hideHelp()).on('option:-cmd2json', () => {
process.stdout.write(JSON.stringify((program.commands.map((x: any) => ({
command: x.name(),
@@ -25,6 +25,6 @@ program
description: stripAnsi.default(y.description),
defaultValue: y.defaultValue,
})),
- })).sort((row1: any, row2: any) => row1.name().localeCompare(row2.name())))));
- process.exit(0);
- }).parse();
+ })).sort((row1: any, row2: any) => row1.name().localeCompare(row2.name())))))
+ process.exit(0)
+ }).parse()
diff --git a/packages/cli/src/options.ts b/packages/cli/src/options.ts
index bf5c0c724..78965ff65 100644
--- a/packages/cli/src/options.ts
+++ b/packages/cli/src/options.ts
@@ -4,17 +4,17 @@ import { asBold } from './utils/format'
export const pathOption = new commander.Option(
'-p, --path <path>',
- `Change root directory where command is executed to ${asBold(
+ `change root directory where command is executed to ${asBold(
'<path>',
)} directory`,
)
export const selectOption = new commander.Option(
'-s, --select',
- 'Select multiple sandbox templates from interactive list',
+ 'select multiple sandbox templates from interactive list',
)
export const selectMultipleOption = new commander.Option(
'-s, --select',
- 'Select sandbox template from interactive list',
+ 'select sandbox template from interactive list',
)