UNPKG

browse

Version:

Unified Browserbase CLI for browser automation and cloud APIs.

19 lines (18 loc) 821 B
import { Args } from "@oclif/core"; import { outputJson, requestBrowserbaseJson } from "../../../lib/cloud/api.js"; import { apiCommonFlags, toApiOptions } from "../../../lib/cloud/flags.js"; import { BrowseCommand } from "../../../base.js"; export default class ContextsUpdate extends BrowseCommand { static description = "Refresh the upload URL for a Browserbase context."; static examples = ["browse cloud contexts update <context-id>"]; static args = { id: Args.string({ required: true, description: "Context ID." }), }; static flags = { ...apiCommonFlags }; async run() { const { args, flags } = await this.parse(ContextsUpdate); outputJson(await requestBrowserbaseJson(toApiOptions(flags), `/v1/contexts/${args.id}`, { method: "PUT", })); } }