Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Fix sandbox kill command

Tomas Valenta3b416549000c
diff --git a/.changeset/sweet-masks-suffer.md b/.changeset/sweet-masks-suffer.md
new file mode 100644
index 000000000..459d9ffd5
--- /dev/null
+++ b/.changeset/sweet-masks-suffer.md
@@ -0,0 +1,5 @@
+---
+"@e2b/cli": patch
+---
+
+Fix CLI kill sandbox command
diff --git a/packages/cli/src/commands/sandbox/kill.ts b/packages/cli/src/commands/sandbox/kill.ts
index 2a5bbfc0a..25dfded8f 100644
--- a/packages/cli/src/commands/sandbox/kill.ts
+++ b/packages/cli/src/commands/sandbox/kill.ts
@@ -4,10 +4,6 @@ import { ensureAPIKey } from 'src/api'
import { asBold } from 'src/utils/format'
import * as e2b from 'e2b'
-
-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>')}`)
@@ -21,7 +17,7 @@ export const killCommand = new commander.Command('kill')
process.exit(1)
}
- await killSandbox(apiKey, { sandboxID })
+ await e2b.Sandbox.kill(sandboxID, apiKey)
console.log(`Sandbox ${asBold(sandboxID)} has been killed`)
} catch (err: any) {