Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Unify CLI shorthand commands; Make the sandboxID argument in connect required

Tomas Valenta9cbef2190189
diff --git a/packages/cli/src/commands/connect.ts b/packages/cli/src/commands/connect.ts
index af0329e36..742af9d0f 100644
--- a/packages/cli/src/commands/connect.ts
+++ b/packages/cli/src/commands/connect.ts
@@ -7,8 +7,8 @@ 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]')}`)
- .alias('c')
+ .argument('<sandboxID>', `Connect to sandbox with ${asBold('<sandboxID>')}`)
+ .alias('cn')
.action(async (sandboxID: string) => {
try {
const apiKey = ensureAPIKey()
@@ -31,8 +31,8 @@ export const connectCommand = new commander.Command('connect')
})
-async function connectToSandbox({ apiKey, sandboxID} : { apiKey: string, sandboxID: string }) {
- const sandbox = await e2b.Sandbox.reconnect({sandboxID, apiKey})
+async function connectToSandbox({ apiKey, sandboxID }: { apiKey: string, sandboxID: string }) {
+ const sandbox = await e2b.Sandbox.reconnect({ sandboxID, apiKey })
if (sandbox.terminal) {
const { exited } = await spawnConnectedTerminal(
diff --git a/packages/cli/src/commands/sandboxes.ts b/packages/cli/src/commands/sandboxes.ts
index 327be30c1..d6f8ccf83 100644
--- a/packages/cli/src/commands/sandboxes.ts
+++ b/packages/cli/src/commands/sandboxes.ts
@@ -10,7 +10,7 @@ const listRunningSandboxes = e2b.withAPIKey(
export const runningSandboxesCommand = new commander.Command('sandboxes')
.description('List all running sandboxes')
- .alias('sndbx')
+ .alias('sb')
.action(async () => {
try {
const apiKey = ensureAPIKey()