browse
Version:
Unified Browserbase CLI for browser automation and cloud APIs.
23 lines (22 loc) • 900 B
JavaScript
import { Args } from "@oclif/core";
import { outputJson, requestBrowserbase } from "../../../lib/cloud/api.js";
import { apiCommonFlags, toApiOptions } from "../../../lib/cloud/flags.js";
import { BrowseCommand } from "../../../base.js";
export default class ContextsDelete extends BrowseCommand {
static description = "Delete a Browserbase context.";
static examples = ["browse cloud contexts delete <context-id>"];
static args = {
id: Args.string({ required: true, description: "Context ID." }),
};
static flags = { ...apiCommonFlags };
async run() {
const { args, flags } = await this.parse(ContextsDelete);
await requestBrowserbase(toApiOptions(flags), `/v1/contexts/${args.id}`, {
method: "DELETE",
headers: {
Accept: "*/*",
},
});
outputJson({ ok: true, id: args.id });
}
}