Skip to content

extension/src/set-up-webhooks.tsx

29 lines · 1.0 KB · TypeScript
Raw
import { Action, ActionPanel, Detail, Icon, open, openExtensionPreferences } from "@raycast/api";
import { CONFIG_PATH } from "./kody-client";

const PACKAGE_URL = "https://kody.codes/@kody/raycast";

export default function Command() {
  return (
    <Detail
      markdown={[
        "# Set up Kody launcher",
        "Preferred: `~/.config/kody/raycast.json` with `listCommandsWebhookUrl` + `runWebhookUrl` (agent writes these via webhook apply).",
        "Config path: `" + CONFIG_PATH + "`",
        "Fallback: the same webhook URL fields in extension preferences.",
        "Then open **Kody Commands** and refresh.",
      ].join("\n\n")}
      actions={
        <ActionPanel>
          <Action title="Open Raycast Package on Kody" icon={Icon.Globe} onAction={() => void open(PACKAGE_URL)} />
          <Action
            title="Open Extension Preferences"
            icon={Icon.Gear}
            shortcut={{ modifiers: ["cmd"], key: "," }}
            onAction={() => void openExtensionPreferences()}
          />
        </ActionPanel>
      }
    />
  );
}