/** Declarative help for the `assistant oauth` command. */ import type { CliCommandHelp } from "../../lib/cli-command-help.js"; export const oauthHelp: CliCommandHelp = { name: "oauth", description: "Manage the full OAuth lifecycle — registering providers, creating apps, connecting accounts, and making authenticated requests", options: [ { flags: "--json", description: "Machine-readable compact JSON output" }, ], helpText: ` OAuth providers may support up to two modes – "managed" and "your-own". managed: Requires a Vellum Platform account. For providers that support it, managed mode offloads the burden of needing to create and register an oauth app. Vellum Platform manages oauth token management and refresh and proxies requests to the provier. you-own: Provides ultimate control and removes dependency on Vellum Platform, but requires that you set up your own oauth app and register it via \`assistant oauth apps upsert\`. All commands are intended to work regardless of the provider's mode. Check and set the mode for a given provider with \`assistant oauth mode\`. You can define entirely new oauth providers to integrate with even if they do not show up using \`assistant oauth providers list\` using \`assistant oauth providers register\`. Custom-registered providers only support "your-own" mode. Examples: assistant oauth providers list assistant oauth providers get google assistant oauth mode google --set=managed assistant oauth connect google assistant oauth status google assistant oauth ping google assistant oauth request --provider google /gmail/v1/users/me/messages assistant oauth disconnect google`, subcommands: [ { name: "providers", description: "Fetch configured OAuth providers and register custom providers of your own", helpText: ` Providers define the protocol-level configuration for an OAuth integration: authorization URL, token URL, default scopes, and other endpoint details. They are seeded on startup for built-in integrations (e.g. Google, Slack, GitHub) but can also be registered dynamically via the "register" subcommand. Each provider is identified by a provider key (e.g. "google").`, subcommands: [ { name: "list", description: "List all registered OAuth providers", options: [ { flags: "--provider-key ", description: 'Filter by provider key substring (case-insensitive). Comma-separated values are OR\'d (e.g. "google,slack")', }, { flags: "--supports-managed", description: "Only show providers that support managed mode", }, ], helpText: ` Returns registered OAuth providers, including both built-in providers seeded at startup and any dynamically registered via "providers register". When --provider-key is specified, only providers whose key contains the given substring (case-insensitive) are returned. Multiple substrings can be OR'd together using commas (e.g. "google,slack" matches any provider whose key contains "google" OR "slack"). Without the flag, all providers are listed. Each provider row includes its key, auth URL, token URL, default scopes, and configuration timestamps. Examples: $ assistant oauth providers list $ assistant oauth providers list --provider-key google $ assistant oauth providers list --provider-key "google,slack" $ assistant oauth providers list --provider-key notion --json $ assistant oauth providers list --supports-managed $ assistant oauth providers list --supports-managed --json`, }, { name: "get", args: "", description: "Show details of a specific OAuth provider", helpText: ` Arguments: provider-key Provider key (e.g. "google"). Must match the key used during registration or seeding. Returns the full provider configuration including auth URL, token URL, default scopes, available scopes, and extra parameters. Exits with code 1 if the provider key is not found. Examples: $ assistant oauth providers get google $ assistant oauth providers get twitter --json`, }, { name: "register", description: "Register a new OAuth provider configuration", options: [ { flags: "--provider-key ", description: "Unique provider key (e.g. \"custom-service\"). Must not collide with an existing key from 'assistant oauth providers list'.", required: true, }, { flags: "--auth-url ", description: "OAuth authorization endpoint URL (e.g. https://accounts.example.com/o/oauth2/auth)", required: true, }, { flags: "--token-url ", description: "OAuth token endpoint URL (e.g. https://oauth2.example.com/token)", required: true, }, { flags: "--refresh-url ", description: "OAuth token refresh endpoint URL. Defaults to --token-url when omitted.", }, { flags: "--base-url ", description: "API base URL for the service", }, { flags: "--userinfo-url ", description: "OpenID Connect userinfo endpoint URL", }, { flags: "--scopes ", description: 'Comma-separated default scopes (e.g. "read,write,profile")', }, { flags: "--scope-separator ", description: 'Separator used to join scopes in the authorize URL (default: " ").', }, { flags: "--token-auth-method ", description: 'How the client authenticates at the token endpoint: "client_secret_post" or "client_secret_basic"', }, { flags: "--token-exchange-body-format ", description: 'Body encoding for the token exchange request: "form" (default) or "json"', defaultValue: "form", }, { flags: "--ping-url ", description: "Health-check endpoint URL for token validation", }, { flags: "--ping-method ", description: "HTTP method for the ping endpoint: GET (default) or POST", }, { flags: "--ping-headers ", description: "JSON object of extra headers for the ping request", }, { flags: "--ping-body ", description: "JSON body to send with the ping request", }, { flags: "--revoke-url ", description: "OAuth token revocation endpoint URL", }, { flags: "--revoke-body-template ", description: "JSON object body template for the revoke request", }, { flags: "--display-name ", description: "Human-readable display name for the provider", }, { flags: "--description ", description: "Short description of the provider", }, { flags: "--dashboard-url ", description: "URL to the provider's developer console / dashboard", }, { flags: "--logo-url ", description: "URL to the provider's logo image. Mutually exclusive with --logo-simpleicons-slug.", }, { flags: "--logo-simpleicons-slug ", description: 'Simple Icons slug (e.g. "notion"). Mutually exclusive with --logo-url.', }, { flags: "--client-id-placeholder ", description: "Placeholder text shown in the client ID input field", }, { flags: "--no-client-secret", description: "Mark this provider as not requiring a client secret", }, { flags: "--loopback-port ", description: "Fixed port for the local OAuth callback server", }, { flags: "--injection-templates ", description: "JSON array of token injection templates", }, { flags: "--app-type ", description: 'What the provider calls its OAuth apps (e.g. "OAuth App")', }, { flags: "--identity-url ", description: "Identity verification endpoint URL", }, { flags: "--identity-method ", description: "HTTP method for the identity endpoint: GET (default) or POST", }, { flags: "--identity-headers ", description: "JSON object of extra headers for the identity request", }, { flags: "--identity-body ", description: "JSON body to send with the identity request", }, { flags: "--identity-response-paths ", description: "Comma-separated dot-notation paths to extract identity from the response", }, { flags: "--identity-format