browse
Version:
Browser automation CLI for AI agents: local Chrome, Browserbase cloud, snapshots, and skills.
26 lines (25 loc) • 1.06 kB
JavaScript
import { Flags } from "@oclif/core";
import { BrowseCommand } from "../base.js";
import { openUrl } from "../lib/open-url.js";
import { DISCORD_INVITE_URL } from "../lib/support-links.js";
export default class Discord extends BrowseCommand {
static description = "Open the Stagehand Discord in your system browser (not a browse session).";
static examples = ["browse discord", "browse discord --no-open"];
static flags = {
"no-open": Flags.boolean({
description: "Print the invite URL without opening a browser.",
}),
};
async run() {
const { flags } = await this.parse(Discord);
const noOpen = flags["no-open"];
const result = openUrl(DISCORD_INVITE_URL, { noOpen });
if (result.attempted && result.success) {
this.log(`Opening ${DISCORD_INVITE_URL}`);
}
else {
this.log(DISCORD_INVITE_URL);
}
this.log("Join our Discord community to contribute to Stagehand and the Browse CLI, request features, and share feedback!");
}
}