atmn CLI keeps your pricing in code. You write your features and plans in an autumn.config.ts file, preview what would change, and push it to Autumn with one command.
This page covers
atmn 2. If you have a config from atmn 1.x, see upgrading from 1.x.Set up a project
Runatmn init in the root folder of your project:
init does the whole setup in one go:
- Connects you to Autumn. If you don’t have a key yet, it asks how you want to connect: sign in (opens your browser), or go keyless (creates a sandbox for you right away, no account needed).
- Creates your config folder. By default that’s
autumn/, holdingautumn.config.tsnext tofeatures.ts,plans.tsandrewards.ts. In a monorepo it asks where the folder should go (defaultpackages/autumn) and what to call the package. - Adds
atmnto yourpackage.jsonand installs it, because the config imports from it. It also adds anatmnscript and a small"atmn"field to your rootpackage.json, so every command can find the config from anywhere in your repo. - Pulls what’s already in Autumn into the config files.
- Installs the Autumn skills next to the config, so your coding agent knows how to work with the CLI.
.env file at the root of your repo:
.env
You can check your setup at any time with
bunx atmn env. It shows which organization, environment and key your commands will use.Log in on its own
You don’t needinit to connect. atmn login opens your browser, lets you pick an organization, and writes both keys to your .env:
--keyless to create a sandbox without an account instead.
Push and pull
Once you have a config, sync it with Autumn:push reads your config, compares it with what’s in Autumn, and shows what would be created, updated or deleted. Nothing changes until you add --yes. If a change affects a plan that already has customers, Autumn drafts a migration for you and push prints the link to run it.
After a push, the CLI writes an internalId into each feature and plan in your config. Leave it there. It’s how the CLI knows to rename something instead of deleting and recreating it.
pull fetches your features, plans and rewards from Autumn and writes them into features.ts, plans.ts and rewards.ts, keeping your formatting where it can. If you don’t have a config yet, it asks where to create one.
Environments
All commands use your sandbox by default. Add-p to target production:
Upgrading from 1.x
atmn 2 uses a new config format. If you run a 1.x config, the CLI stops and tells you so instead of guessing. To move over:
- Note any changes you made to your config that aren’t in Autumn yet.
-
Rebuild the config from your organization. This rewrites
autumn.config.tsand thefeatures.ts,plans.tsandrewards.tsbeside it. Other files are left alone. -
Re-apply your pending changes in the new format, then
bunx atmn push.
Next: Configuration reference
Learn how to define features, plans and pricing in your
autumn.config.ts.
Configuration reference
Every builder and field available in autumn.config.ts