Skip to content

Add stripe climate commitment subcommand#1599

Open
varney-stripe wants to merge 2 commits into
masterfrom
climate-commitments
Open

Add stripe climate commitment subcommand#1599
varney-stripe wants to merge 2 commits into
masterfrom
climate-commitments

Conversation

@varney-stripe
Copy link
Copy Markdown

@varney-stripe varney-stripe commented May 21, 2026

Reviewers

r? @tomer-stripe @mfix-stripe
cc @stripe/developer-products

Summary

This adds a hidden stripe climate commitment command group with three operations for managing a rate-based Climate commitment program:

  • stripe climate commitment enable <rate> enables or updates a commitment at the given percentage of pay-in volume
  • stripe climate commitment show retrieves the current commitment program
  • stripe climate commitment disable removes the commitment program

The commands are hidden pending public launch of the feature.

This subgroup is added in the main repo, not a plugin, in order to live alongside the existing stripe climate commands (orders/products/...) which are autogenerated from the OpenAPI spec.

AddClimateCommitmentsSubCmds follows the same pattern as AddApprovalRequestsSubCmds: it runs during PostProcessResourceCommands, finds the already-registered climate command, and grafts commitments into it as a subcommand. This preserves all existing climate commands and puts commitment where it belongs in the hierarchy.

Sample flow

⎇ stripe-cli ❱ stripe login
Your pairing code is: [redacted]
This pairing code verifies your authentication with Stripe.
To authenticate with Stripe, please go to: https://dashboard.stripe.com/stripecli/confirm_auth?t=[redacted]
> Done! The Stripe CLI is configured for Demo Account with account id [redacted]
Please note: this key will expire after 90 days, at which point you'll need to re-authenticate.


⎇ stripe-cli ❱ stripe climate commitment show
{
  "error": {
    "message": "No active Climate program exists.",
    "type": "invalid_request_error"
  }
}

⎇ stripe-cli ❱ stripe climate commitment enable 10000
{
  "error": {
    "code": "parameter_invalid_integer",
    "doc_url": "[redacted]/docs/error-codes/parameter-invalid-integer",
    "message": "This value must be less than or equal to 90.0 (it currently is '10000.0').",
    "param": "contribution_rate_percent",
    "type": "invalid_request_error"
  }
}


⎇ stripe-cli ❱ stripe climate commitment enable 0.001
{
  "error": {
    "message": "This value must be greater than or equal to 0.01 (it currently is '0.001').",
    "param": "contribution_rate_percent",
    "type": "invalid_request_error"
  }
}


⎇ stripe-cli ❱ stripe climate commitment enable 1.25
{
  "id": "climprog_1TZe9XDJ5fwQRCtHklmggqKa",
  "rate": 1.25,
  "status": "enabled",
  "type": "rate"
}


⎇ stripe-cli ❱ stripe climate commitment enable 4.0
{
  "id": "climprog_1TZeA6DJ5fwQRCtH9D8hfkgL",
  "rate": 4,
  "status": "enabled",
  "type": "rate"
}



⎇ stripe-cli ❱ stripe climate commitment show
{
  "id": "climprog_1TZeA6DJ5fwQRCtH9D8hfkgL",
  "rate": 4,
  "status": "enabled",
  "type": "rate"
}


⎇ stripe-cli ❱ stripe climate commitment disable
{
  "id": "climprog_1TZeA6DJ5fwQRCtH9D8hfkgL",
  "rate": 4,
  "status": "disabled",
  "type": "rate"
}


⎇ stripe-cli ❱ stripe climate commitment --help
Usage:
  stripe climate commitment <operation> [parameters...]

Available Operations:
  disable     Disable the current Climate commitment program
  enable      Enable or update a rate-based Climate commitment
  show        Show the current Climate commitment program

Flags:
  -h, --help   help for commitment

Global Flags:
      --api-key string        Your API key to use for the command
      --color string          turn on/off color output (on, off, auto)
      --config string         config file (default is $HOME/.config/stripe/config.toml)
      --device-name string    device name
      --log-level string      log level (debug, info, trace, warn, error) (default "info")
      --map string[="tree"]   Print a command tree [tree|compact|paths|json]
  -p, --project-name string   the project name to read from for config (default "default")

Use "stripe climate commitment [command] --help" for more information about a command.

@varney-stripe varney-stripe requested a review from a team as a code owner May 21, 2026 21:41
@varney-stripe varney-stripe changed the title Add stripe climate commitments subcommand Add stripe climate commitment subcommand May 21, 2026
@varney-stripe varney-stripe force-pushed the climate-commitments branch from d4f1189 to 5a3307e Compare May 21, 2026 21:57
@varney-stripe varney-stripe force-pushed the climate-commitments branch from 5a3307e to 051e94a Compare May 21, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants