Files
cfw-autumn/packages/atmn
mintlify[bot] 9bd20cb2e9 Add changelog entry for checkout_session_params deep-merge fix (#999)
* docs improvements

* many changes

* prompt changes

* add refetch comment

* fix: checkout subscription data

* cus eligibility fixes

* rm cursor thing

---------

Co-authored-by: Ayush Rodrigues <joesj2905@gmail.com>
Co-authored-by: John Yeo <johnyeocx@gmail.com>
Co-authored-by: John Yeo <51376134+johnyeocx@users.noreply.github.com>
Co-authored-by: Ayush <74830628+ay-rod@users.noreply.github.com>
2026-03-17 17:33:52 +00:00
..
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-16 12:34:33 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-16 12:34:33 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00
2026-03-13 18:02:25 +00:00

atmn

The CLI for Autumn — define your pricing in code, sync it to Autumn, and keep everything in version control.

Install

npm install -g atmn

Or run directly:

npx atmn <command>

Quick Start

atmn login          # Authenticate via OAuth
atmn init           # Scaffold a project from a template
atmn push           # Deploy your config to Autumn
atmn pull           # Pull changes & generate SDK types

Templates

atmn init offers starter templates for common pricing models:

  • OpenAI — Credit system with model tiers
  • T3 Chat — Seats + message limits
  • Railway — Resource-based usage pricing
  • Linear — Feature flags + usage controls

What It Does

You define features and plans in an autumn.config.ts file. The CLI syncs that config with your Autumn account — push to deploy, pull to fetch updates. It also generates TypeScript definitions so your SDK calls are type-safe.

import { feature, plan, planFeature } from 'atmn';

export const messages = feature({
  id: 'messages',
  name: 'AI Messages',
  type: 'metered',
  consumable: true,
});

export const pro = plan({
  id: 'pro',
  name: 'Pro',
  price: { amount: 2000, interval: 'month' },
  items: [
    planFeature({
      feature_id: messages.id,
      included: 1000,
      reset: { interval: 'month' },
    }),
  ],
});

Commands

Authentication

Command Description
atmn login Authenticate with Autumn (OAuth 2.0)
atmn logout Remove API keys from .env
atmn env Show current org and environment

Configuration

Command Description
atmn init Initialize a project with a starter template
atmn push Push local config to Autumn
atmn pull Pull config from Autumn and generate SDK types
atmn preview Preview plans locally (no API calls)
atmn config View and set global CLI configuration

Data

Command Description
atmn customers Browse and inspect customers
atmn plans Browse and inspect plans (alias: products)
atmn features Browse and inspect features
atmn events Browse and analyze usage events

Utility

Command Description
atmn nuke Permanently delete all sandbox data
atmn version Show CLI version

Global Flags

Flag Description
-p, --prod Use production environment (default: sandbox)
-c, --config <path> Path to config file (default: autumn.config.ts)
--headless Force non-interactive mode (for CI/agents)

Flags combine: atmn push -p pushes to production.

Push & Pull

Push analyzes your local config against remote state, shows you exactly what will change, and syncs it:

atmn push           # Deploy to sandbox
atmn push --prod    # Deploy to production (extra confirmation)
atmn push --yes     # Auto-confirm (for CI/CD)

Pull fetches your config and generates typed SDK definitions:

atmn pull           # Smart in-place update

Declaration File

Pull generates @useautumn-sdk.d.ts by default. To skip it:

atmn pull --no-declaration-file

Or set it globally:

atmn config --global noDeclarationFile true

Data Commands

All data commands have an interactive mode (default) and a headless mode for scripting:

atmn customers                              # Interactive browser
atmn customers --headless --format json     # JSON output
atmn customers --headless --format csv      # CSV export
atmn customers --headless --id "cus_123"    # Specific customer

Events support aggregation:

atmn events --mode aggregate --bin day --time 30d
atmn events --customer "cus_123" --feature "messages" --time 7d

Global Config

Manage persistent CLI settings:

atmn config                              # Show config file location and keys
atmn config --global                     # Same as above
atmn config --global noDeclarationFile   # Read a key
atmn config --global noDeclarationFile true   # Set a key

CI/CD

The CLI auto-detects non-TTY environments and switches to headless mode. Set your API keys as environment variables:

# GitHub Actions
- name: Deploy to Autumn
  run: atmn push --prod --yes
  env:
    AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}