atmn 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/readme.md +163 -81
package/dist/cli.js
CHANGED
|
@@ -45438,7 +45438,7 @@ var init_pull = __esm(() => {
|
|
|
45438
45438
|
});
|
|
45439
45439
|
|
|
45440
45440
|
// src/lib/version.ts
|
|
45441
|
-
var APP_VERSION = "1.0.
|
|
45441
|
+
var APP_VERSION = "1.0.4";
|
|
45442
45442
|
|
|
45443
45443
|
// ../node_modules/.pnpm/@tanstack+query-core@5.90.17/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
45444
45444
|
var Subscribable = class {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,104 +1,186 @@
|
|
|
1
|
-
#
|
|
1
|
+
# atmn
|
|
2
2
|
|
|
3
|
-
The CLI
|
|
3
|
+
The CLI for [Autumn](https://useautumn.com) — define your pricing in code, sync it to Autumn, and keep everything in version control.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
Usage: atmn [options] [command]
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g atmn
|
|
9
|
+
```
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
-h, --help display help for command
|
|
11
|
+
Or run directly:
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pull [options] Pull changes from Autumn
|
|
22
|
-
init Initialize an Autumn project.
|
|
23
|
-
auth [options] Authenticate with Autumn
|
|
24
|
-
dashboard Open the Autumn dashboard in your browser
|
|
25
|
-
version Show the version of Autumn
|
|
26
|
-
help [command] display help for command
|
|
13
|
+
```bash
|
|
14
|
+
npx atmn <command>
|
|
27
15
|
```
|
|
28
16
|
|
|
29
|
-
##
|
|
30
|
-
Run `npx atmn init` in your project folder. This will prompt you to authenticate with Autumn and
|
|
31
|
-
downloads your Autumn keys to the root level `.env`.
|
|
17
|
+
## Quick Start
|
|
32
18
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
```bash
|
|
20
|
+
atmn login # Authenticate via OAuth
|
|
21
|
+
atmn init # Scaffold a project from a template
|
|
22
|
+
atmn push # Deploy your config to Autumn
|
|
23
|
+
atmn pull # Pull changes & generate SDK types
|
|
36
24
|
```
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npx atmn pull
|
|
41
|
-
```
|
|
26
|
+
## Templates
|
|
42
27
|
|
|
43
|
-
|
|
44
|
-
production key, and comment out your sandbox key.
|
|
28
|
+
`atmn init` offers starter templates for common pricing models:
|
|
45
29
|
|
|
46
|
-
|
|
30
|
+
- **OpenAI** — Credit system with model tiers
|
|
31
|
+
- **T3 Chat** — Seats + message limits
|
|
32
|
+
- **Railway** — Resource-based usage pricing
|
|
33
|
+
- **Linear** — Feature flags + usage controls
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
import {
|
|
50
|
-
feature,
|
|
51
|
-
plan,
|
|
52
|
-
planFeature,
|
|
53
|
-
} from 'atmn';
|
|
35
|
+
## What It Does
|
|
54
36
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { feature, plan, planFeature } from 'atmn';
|
|
60
41
|
|
|
61
42
|
export const messages = feature({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
43
|
+
id: 'messages',
|
|
44
|
+
name: 'AI Messages',
|
|
45
|
+
type: 'metered',
|
|
46
|
+
consumable: true,
|
|
65
47
|
});
|
|
66
48
|
|
|
67
49
|
export const pro = plan({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// 500 messages per month
|
|
79
|
-
planFeature({
|
|
80
|
-
feature_id: messages.id,
|
|
81
|
-
granted: 500,
|
|
82
|
-
reset: { interval: 'month' },
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
// $10 per seat per month
|
|
86
|
-
planFeature({
|
|
87
|
-
feature_id: seats.id,
|
|
88
|
-
granted: 1,
|
|
89
|
-
price: {
|
|
90
|
-
amount: 10,
|
|
91
|
-
interval: 'month',
|
|
92
|
-
billing_method: 'usage_based',
|
|
93
|
-
billing_units: 1,
|
|
94
|
-
},
|
|
95
|
-
}),
|
|
96
|
-
],
|
|
50
|
+
id: 'pro',
|
|
51
|
+
name: 'Pro',
|
|
52
|
+
price: { amount: 2000, interval: 'month' },
|
|
53
|
+
items: [
|
|
54
|
+
planFeature({
|
|
55
|
+
feature_id: messages.id,
|
|
56
|
+
included: 1000,
|
|
57
|
+
reset: { interval: 'month' },
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
97
60
|
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
|
|
65
|
+
### Authentication
|
|
66
|
+
|
|
67
|
+
| Command | Description |
|
|
68
|
+
|---------|-------------|
|
|
69
|
+
| `atmn login` | Authenticate with Autumn (OAuth 2.0) |
|
|
70
|
+
| `atmn logout` | Remove API keys from `.env` |
|
|
71
|
+
| `atmn env` | Show current org and environment |
|
|
72
|
+
|
|
73
|
+
### Configuration
|
|
74
|
+
|
|
75
|
+
| Command | Description |
|
|
76
|
+
|---------|-------------|
|
|
77
|
+
| `atmn init` | Initialize a project with a starter template |
|
|
78
|
+
| `atmn push` | Push local config to Autumn |
|
|
79
|
+
| `atmn pull` | Pull config from Autumn and generate SDK types |
|
|
80
|
+
| `atmn preview` | Preview plans locally (no API calls) |
|
|
81
|
+
| `atmn config` | View and set global CLI configuration |
|
|
82
|
+
|
|
83
|
+
### Data
|
|
84
|
+
|
|
85
|
+
| Command | Description |
|
|
86
|
+
|---------|-------------|
|
|
87
|
+
| `atmn customers` | Browse and inspect customers |
|
|
88
|
+
| `atmn plans` | Browse and inspect plans (alias: `products`) |
|
|
89
|
+
| `atmn features` | Browse and inspect features |
|
|
90
|
+
| `atmn events` | Browse and analyze usage events |
|
|
91
|
+
|
|
92
|
+
### Utility
|
|
93
|
+
|
|
94
|
+
| Command | Description |
|
|
95
|
+
|---------|-------------|
|
|
96
|
+
| `atmn nuke` | Permanently delete all sandbox data |
|
|
97
|
+
| `atmn version` | Show CLI version |
|
|
98
|
+
|
|
99
|
+
## Global Flags
|
|
100
|
+
|
|
101
|
+
| Flag | Description |
|
|
102
|
+
|------|-------------|
|
|
103
|
+
| `-p, --prod` | Use production environment (default: sandbox) |
|
|
104
|
+
| `-c, --config <path>` | Path to config file (default: `autumn.config.ts`) |
|
|
105
|
+
| `--headless` | Force non-interactive mode (for CI/agents) |
|
|
106
|
+
|
|
107
|
+
Flags combine: `atmn push -p` pushes to production.
|
|
108
|
+
|
|
109
|
+
## Push & Pull
|
|
110
|
+
|
|
111
|
+
**Push** analyzes your local config against remote state, shows you exactly what will change, and syncs it:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
atmn push # Deploy to sandbox
|
|
115
|
+
atmn push --prod # Deploy to production (extra confirmation)
|
|
116
|
+
atmn push --yes # Auto-confirm (for CI/CD)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Pull** fetches your config and generates typed SDK definitions:
|
|
98
120
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
plans: [pro],
|
|
102
|
-
};
|
|
121
|
+
```bash
|
|
122
|
+
atmn pull # Smart in-place update
|
|
103
123
|
```
|
|
104
124
|
|
|
125
|
+
|
|
126
|
+
### Declaration File
|
|
127
|
+
|
|
128
|
+
Pull generates `@useautumn-sdk.d.ts` by default. To skip it:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
atmn pull --no-declaration-file
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Or set it globally:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
atmn config --global noDeclarationFile true
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Data Commands
|
|
141
|
+
|
|
142
|
+
All data commands have an interactive mode (default) and a headless mode for scripting:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
atmn customers # Interactive browser
|
|
146
|
+
atmn customers --headless --format json # JSON output
|
|
147
|
+
atmn customers --headless --format csv # CSV export
|
|
148
|
+
atmn customers --headless --id "cus_123" # Specific customer
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Events support aggregation:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
atmn events --mode aggregate --bin day --time 30d
|
|
155
|
+
atmn events --customer "cus_123" --feature "messages" --time 7d
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Global Config
|
|
159
|
+
|
|
160
|
+
Manage persistent CLI settings:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
atmn config # Show config file location and keys
|
|
164
|
+
atmn config --global # Same as above
|
|
165
|
+
atmn config --global noDeclarationFile # Read a key
|
|
166
|
+
atmn config --global noDeclarationFile true # Set a key
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## CI/CD
|
|
170
|
+
|
|
171
|
+
The CLI auto-detects non-TTY environments and switches to headless mode. Set your API keys as environment variables:
|
|
172
|
+
|
|
173
|
+
```yaml
|
|
174
|
+
# GitHub Actions
|
|
175
|
+
- name: Deploy to Autumn
|
|
176
|
+
run: atmn push --prod --yes
|
|
177
|
+
env:
|
|
178
|
+
AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Links
|
|
182
|
+
|
|
183
|
+
- [Documentation](https://docs.useautumn.com)
|
|
184
|
+
- [Dashboard](https://app.useautumn.com)
|
|
185
|
+
- [Main GitHub](https://github.com/useautumn/autumn)
|
|
186
|
+
- [CLI & SDKs GitHub](https://github.com/useautumn/typescript)
|