Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Clean up shell command

Jakub Novak4344c612989e
diff --git a/packages/cli/src/commands/template/shell.ts b/packages/cli/src/commands/template/shell.ts
index a3deedf5c..7ff339f90 100644
--- a/packages/cli/src/commands/template/shell.ts
+++ b/packages/cli/src/commands/template/shell.ts
@@ -3,7 +3,7 @@ import * as commander from 'commander'
import { ensureAPIKey } from 'src/api'
import { spawnConnectedTerminal } from 'src/terminal'
-import { asBold, asFormattedSandboxTemplate, asPrimary } from 'src/utils/format'
+import { asBold, asFormattedSandboxTemplate } from 'src/utils/format'
import { getRoot } from '../../utils/filesystem'
import { getConfigPath, loadConfig } from '../../config'
import fs from 'fs'
@@ -11,12 +11,8 @@ import { pathOption } from '../../options'
import path from 'path'
export const shellCommand = new commander.Command('shell')
- .description('Connect to the terminal in the sandbox')
- .argument('<id>', `Connect to sandbox specified by ${asPrimary('template id')}`)
- .option(
- '-n, --name <name>',
- 'Specify name of sandbox template. You can use the name to start the sandbox in the SDK.',
- )
+ .description('Connect terminal to sandbox')
+ .argument('[id]', `Connect to sandbox specified by ${asBold('[id]')}`)
.addOption(pathOption)
.alias('sh')
.action(async (id: string | undefined, opts: {
@@ -36,7 +32,7 @@ export const shellCommand = new commander.Command('shell')
: undefined
const relativeConfigPath = path.relative(root, configPath)
- if (config) {
+ if (!envID && config) {
console.log(
`Found sandbox template ${asFormattedSandboxTemplate(
{