id = "stripe" name = "Stripe CLI" homepage = "https://docs.stripe.com/stripe-cli" description = "A command-line tool for Stripe." icon = "SimpleIcons:stripe" executables = ["stripe"] [dotfiles] # pkg/config/config.go, getConfigFolder(): $XDG_CONFIG_HOME, else the user's # home joined with ".config", then "stripe" joined onto that — the XDG # location, [configHome], on macOS as well as Linux. InitConfig() joins # "config.toml" onto the folder and writes it 0600. paths = ["[configHome]/stripe/config.toml"] exclude = [] # pkg/config/config.go, CredentialsFilePath(): credentials.json in the same # folder is "the plain-text credentials file used by the file fallback store # when the OS keyring is unavailable" — the whole file is the credential. secret = ["[configHome]/stripe/credentials.json"] # The field names come from pkg/config/profile.go. TestModeAPIKeyName and # LiveModeAPIKeyName are the restricted/secret keys `stripe login` stores, and # authFieldNames also lists "secret_key" and "api_key" under "legacy field # names from older config formats", so both are named here. # # Both layouts are covered too: in a v1 file every profile is a top-level # table, and in ConfigVersionV2 "every profile moved under the reserved # ProfilesTableName table", so a rule that knew only one shape would resolve # to nothing on the other and sync a live key in the clear. # # The publishable keys (test_mode_pub_key / live_mode_pub_key) are # deliberately absent: they are public by definition. [[dotfiles.secret_paths]] file = "[configHome]/stripe/config.toml" match = { key_path = [ "*.test_mode_api_key", "*.live_mode_api_key", "*.secret_key", "*.api_key", "profiles.*.test_mode_api_key", "profiles.*.live_mode_api_key", ] } # device_name is the name this machine registers with Stripe, and is what the # Dashboard shows for it — `stripe listen` on a second machine carrying the # synced file would report itself as the first one. Both layouts again. # The name is this device's own, and the user reads it in the Dashboard, so it # is kept for restoring this machine and never applied to another. [[dotfiles.machine_lines]] file = "[configHome]/stripe/config.toml" match = { key_path = ["*.device_name", "profiles.*.device_name"] } scope = "backup" [commands] format = 1 label = "Stripe CLI commands" description = "Forward webhook events to a local server or trigger test events. Other subcommands and global flags are left out." quality = "ai-draft" base = "fig:stripe" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/stripe.ts" license = "MIT" [[commands.subcommand]] path = ["listen"] label = "Listen for webhooks" description = "Receive webhook events from Stripe and forward them locally." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/stripe.ts" license = "MIT" [[commands.subcommand.field]] id = "forward_to" label = "Forward to URL" type = "url" option = ["--forward-to", "-f"] sources = ["fig"] [[commands.subcommand.field]] id = "forward_connect_to" label = "Forward Connect events to" type = "url" option = ["--forward-connect-to", "-c"] sources = ["fig"] [[commands.subcommand.field]] id = "events" label = "Event types" description = "Comma-separated list of event types." type = "string" option = ["--events", "-e"] sources = ["fig"] [[commands.subcommand.field]] id = "latest" label = "Latest API version" type = "boolean" option = ["--latest", "-l"] sources = ["fig"] [[commands.subcommand.field]] id = "live" label = "Live mode" type = "boolean" option = ["--live"] sources = ["fig"] [[commands.subcommand.field]] id = "print_json" label = "Print JSON" type = "boolean" option = ["--print-json", "-j"] sources = ["fig"] [[commands.subcommand.field]] id = "skip_verify" label = "Skip certificate verification" type = "boolean" option = ["--skip-verify"] effect = "exec" sources = ["fig"] [[commands.subcommand.task]] id = "listen" label = "Forward events to localhost" fields = ["forward_to", "events", "print_json"] required = ["forward_to"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["forward_to", "events", "print_json"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["forward_connect_to", "latest", "live", "skip_verify"] [[commands.subcommand]] path = ["trigger"] label = "Trigger a test event" description = "Trigger a webhook event for local testing." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/stripe.ts" license = "MIT" [[commands.subcommand.field]] id = "event" label = "Event" type = "string" position = 0 suggestions = [{ value = "charge.succeeded", label = "charge.succeeded" }, { value = "checkout.session.completed", label = "checkout.session.completed" }, { value = "customer.created", label = "customer.created" }, { value = "invoice.paid", label = "invoice.paid" }, { value = "payment_intent.succeeded", label = "payment_intent.succeeded" }] sources = ["fig"] [[commands.subcommand.task]] id = "trigger" label = "Trigger event" fields = ["event"] required = ["event"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["event"]