atmn 1.1.25 → 2.0.0
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/README.md +120 -0
- package/dist/bin.js +23102 -0
- package/dist/index.js +2906 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -74
- package/src/actions/api/callApi.ts +280 -0
- package/src/actions/api/registerApiCommands.ts +121 -0
- package/src/actions/env/fetchOrgInfo.ts +32 -0
- package/src/actions/env/types/orgInfo.ts +18 -0
- package/src/actions/env.ts +94 -0
- package/src/actions/init/runInit.ts +401 -0
- package/src/actions/login/keyless.ts +135 -0
- package/src/actions/login.ts +144 -0
- package/src/actions/pull/appendPlanVersionFixture.ts +373 -0
- package/src/actions/pull/applyPreview.ts +553 -0
- package/src/actions/pull/applySettingsPreview.ts +114 -0
- package/src/actions/pull/changedFixtureKeys.ts +88 -0
- package/src/actions/pull/listSourceFiles.ts +29 -0
- package/src/actions/pull/locateFixture.ts +78 -0
- package/src/actions/pull/resolveCollectionTarget.ts +198 -0
- package/src/actions/pull/rewriteConfig.ts +57 -0
- package/src/actions/pull/scaffoldConfig.ts +118 -0
- package/src/actions/pull.ts +399 -0
- package/src/actions/push/backfillInternalIds.ts +394 -0
- package/src/actions/push/deprecatedFields.ts +55 -0
- package/src/actions/push.ts +294 -0
- package/src/actions/reset/runReset.ts +58 -0
- package/src/actions/sandbox/createSandbox.ts +83 -0
- package/src/actions/sandbox/deleteSandbox.ts +91 -0
- package/src/actions/sandbox/listSandboxes.ts +28 -0
- package/src/actions/sandbox/types/sandboxClient.ts +16 -0
- package/src/actions/sandbox/useSandbox.ts +157 -0
- package/src/actions/sandbox/withSandboxScopeHint.ts +27 -0
- package/src/actions/skills/skills.ts +246 -0
- package/src/auth/announceAuthorizationUrl.ts +26 -0
- package/src/auth/browser/openSystemBrowser.ts +7 -0
- package/src/auth/browser/tryOpenBrowser.ts +17 -0
- package/src/auth/browser/watchLauncher.ts +46 -0
- package/src/auth/buildAuthorizationUrl.ts +36 -0
- package/src/auth/callbackPages.ts +126 -0
- package/src/auth/createOrgApiKeys.ts +46 -0
- package/src/auth/keyless.ts +119 -0
- package/src/auth/oauthConfig.ts +63 -0
- package/src/auth/runOAuthFlow.ts +230 -0
- package/src/auth/types/browserOpener.ts +5 -0
- package/src/auth/types/impersonationTokens.ts +23 -0
- package/src/auth/types/oauthTokens.ts +13 -0
- package/src/auth/types/orgApiKeys.ts +6 -0
- package/src/bin.ts +9 -0
- package/src/cli.ts +648 -0
- package/src/config/configPackageName.ts +9 -0
- package/src/config/legacyConfig.ts +25 -0
- package/src/config/loadConfig.ts +231 -0
- package/src/env/assertSandboxTarget.ts +20 -0
- package/src/env/loadEnv.ts +184 -0
- package/src/env/resolveTarget.ts +134 -0
- package/src/env/sandboxKeyName.ts +18 -0
- package/src/generated/apiRoutes.ts +3787 -0
- package/src/generated/client.ts +51564 -0
- package/src/generated/emit.ts +1163 -0
- package/src/generated/emitRuntime.ts +522 -0
- package/src/generated/features.ts +146 -0
- package/src/generated/labels.ts +29 -0
- package/src/generated/licenses.ts +287 -0
- package/src/generated/lintRules.ts +2207 -0
- package/src/generated/lintRuntime.ts +865 -0
- package/src/generated/plans.ts +1628 -0
- package/src/generated/referralPrograms.ts +22 -0
- package/src/generated/rewards.ts +58 -0
- package/src/generated/settings.ts +21 -0
- package/src/generated/skills.ts +305 -0
- package/src/generated/variants.ts +934 -0
- package/src/generated/wire.ts +334 -0
- package/src/http/autumnFetch.ts +30 -0
- package/src/index.ts +20 -0
- package/src/project/chooseConfigDir.ts +41 -0
- package/src/project/resolveProject.ts +115 -0
- package/src/project/rootMarker.ts +40 -0
- package/src/prompt/prompt.ts +186 -0
- package/src/prompt/select.ts +162 -0
- package/src/render/renderEnv.ts +77 -0
- package/src/render/renderPreview.ts +945 -0
- package/src/render/renderSandboxes.ts +92 -0
- package/src/render/stripTerminalControls.ts +19 -0
- package/src/repo/findRepoRoot.ts +79 -0
- package/src/surgery/appendPropertyEdit.ts +67 -0
- package/src/surgery/appendToArray.ts +87 -0
- package/src/surgery/appendToBinding.ts +19 -0
- package/src/surgery/appendToCollection.ts +40 -0
- package/src/surgery/appendToFixtureArray.ts +71 -0
- package/src/surgery/arrayBinding.ts +30 -0
- package/src/surgery/deleteFixtureLiteral.ts +81 -0
- package/src/surgery/deleteReference.ts +48 -0
- package/src/surgery/ensureBuilderImport.ts +65 -0
- package/src/surgery/findFixture.ts +238 -0
- package/src/surgery/fixtureEdit.ts +156 -0
- package/src/surgery/fixtureLocation.ts +32 -0
- package/src/surgery/insertCollection.ts +86 -0
- package/src/surgery/insertFirstProperty.ts +73 -0
- package/src/surgery/patchFixtureProperty.ts +152 -0
- package/src/surgery/patchSingletonProperty.ts +221 -0
- package/src/surgery/replaceFixture.ts +28 -0
- package/src/surgery/setFixtureProperty.ts +55 -0
- package/src/surgery/staticFixtureRule.ts +48 -0
- package/src/version.ts +5 -0
- package/dist/cli.js +0 -146296
- package/dist/compose/index.js +0 -122
- package/dist/src/compose/builders/builderFunctions.d.ts +0 -84
- package/dist/src/compose/builders/rewardFunctions.d.ts +0 -5
- package/dist/src/compose/builders/variantFunctions.d.ts +0 -2
- package/dist/src/compose/index.d.ts +0 -19
- package/dist/src/compose/models/featureModels.d.ts +0 -262
- package/dist/src/compose/models/index.d.ts +0 -3
- package/dist/src/compose/models/planModels.d.ts +0 -562
- package/dist/src/compose/models/rewardModels.d.ts +0 -52
- package/dist/src/compose/models/variantModels.d.ts +0 -34
- package/readme.md +0 -186
package/readme.md
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
# atmn
|
|
2
|
-
|
|
3
|
-
The CLI for [Autumn](https://useautumn.com) — define your pricing in code, sync it to Autumn, and keep everything in version control.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g atmn
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or run directly:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx atmn <command>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
18
|
-
|
|
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
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Templates
|
|
27
|
-
|
|
28
|
-
`atmn init` offers starter templates for common pricing models:
|
|
29
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
## What It Does
|
|
36
|
-
|
|
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';
|
|
41
|
-
|
|
42
|
-
export const messages = feature({
|
|
43
|
-
id: 'messages',
|
|
44
|
-
name: 'AI Messages',
|
|
45
|
-
type: 'metered',
|
|
46
|
-
consumable: true,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const pro = plan({
|
|
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
|
-
],
|
|
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:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
atmn pull # Smart in-place update
|
|
123
|
-
```
|
|
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)
|