UNPKG

browse

Version:

Unified Browserbase CLI for browser automation and cloud APIs.

28 lines (27 loc) • 1.2 kB
import { Args } from "@oclif/core"; import { BrowseCommand } from "../../../base.js"; import { apiCommonFlags, toApiOptions } from "../../../lib/cloud/flags.js"; import { attachFunctionSecret } from "../../../lib/secrets/api.js"; export default class FunctionSecretsAttach extends BrowseCommand { static description = "Attach an existing project secret to a function."; static examples = [ "browse functions secrets attach <functionId> <secretId>", "browse functions secrets attach 7b6e1c42-8d93-4a15-b2f0-9c6d3e8a5041 d2c4f48f-38e9-4b82-a36a-2b373fd14a65", ]; static args = { functionId: Args.string({ description: "Function ID (e.g. 7b6e1c42-8d93-4a15-b2f0-9c6d3e8a5041).", required: true, }), secretId: Args.string({ description: "Project secret ID (e.g. d2c4f48f-38e9-4b82-a36a-2b373fd14a65).", required: true, }), }; static flags = { ...apiCommonFlags }; async run() { const { args, flags } = await this.parse(FunctionSecretsAttach); const options = toApiOptions(flags); await attachFunctionSecret(options, args.functionId, args.secretId); } }