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
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
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 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 with Autumn
|
|
21
|
+
atmn init # Set up your project
|
|
22
|
+
atmn push # Preview your config changes
|
|
23
|
+
atmn push --yes # Apply the changes to Autumn
|
|
24
|
+
atmn pull # Pull remote changes into your config
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## What It Does
|
|
28
|
+
|
|
29
|
+
You define features and plans in an `autumn.config.ts` file. Use `atmn push` to preview changes, `atmn push --yes` to apply them, and `atmn pull` to fetch updates from your Autumn account.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { atmn, feature, plan } from "atmn";
|
|
33
|
+
|
|
34
|
+
export default atmn({
|
|
35
|
+
features: [
|
|
36
|
+
feature({
|
|
37
|
+
featureId: "messages",
|
|
38
|
+
name: "AI Messages",
|
|
39
|
+
type: "metered",
|
|
40
|
+
consumable: true,
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
plans: [
|
|
44
|
+
plan({
|
|
45
|
+
planId: "pro",
|
|
46
|
+
versionSlug: "v1",
|
|
47
|
+
active: true,
|
|
48
|
+
name: "Pro",
|
|
49
|
+
price: { amount: 20, interval: "month" },
|
|
50
|
+
items: [
|
|
51
|
+
{
|
|
52
|
+
featureId: "messages",
|
|
53
|
+
included: 1000,
|
|
54
|
+
reset: { interval: "month" },
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
Run `atmn --help` or `atmn <command> --help` for the current options.
|
|
65
|
+
|
|
66
|
+
| Command | Description |
|
|
67
|
+
|---------|-------------|
|
|
68
|
+
| `atmn login` | Authenticate with Autumn |
|
|
69
|
+
| `atmn env` | Show the current organization and environment |
|
|
70
|
+
| `atmn init` | Set up a project |
|
|
71
|
+
| `atmn push` | Preview local configuration changes; add `--yes` to apply them |
|
|
72
|
+
| `atmn pull` | Pull remote configuration into local files |
|
|
73
|
+
| `atmn sandbox` | Manage sandboxes |
|
|
74
|
+
| `atmn reset` | Reset sandbox data |
|
|
75
|
+
| `atmn skills` | Manage bundled agent skills |
|
|
76
|
+
| `atmn api` | Call Autumn's public API |
|
|
77
|
+
|
|
78
|
+
## Global Flags
|
|
79
|
+
|
|
80
|
+
| Flag | Description |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `-p, --prod` | Use production instead of sandbox |
|
|
83
|
+
| `--sandbox <sandboxId>` | Target a specific sandbox |
|
|
84
|
+
| `-c, --config <path>` | Config file or folder |
|
|
85
|
+
| `--headless` | Never prompt (the default outside a TTY) |
|
|
86
|
+
|
|
87
|
+
## Push & Pull
|
|
88
|
+
|
|
89
|
+
Push only previews changes unless you pass `--yes`, including in an interactive terminal:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
atmn push # Preview sandbox changes
|
|
93
|
+
atmn push --prod # Preview production changes
|
|
94
|
+
atmn push --yes # Apply sandbox changes
|
|
95
|
+
atmn push --prod --yes # Apply production changes
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Pull updates configuration in place:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
atmn pull
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## CI/CD
|
|
105
|
+
|
|
106
|
+
Set your API key as an environment variable:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
- name: Deploy to Autumn
|
|
110
|
+
run: npx atmn push --prod --yes
|
|
111
|
+
env:
|
|
112
|
+
AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Links
|
|
116
|
+
|
|
117
|
+
- [Documentation](https://docs.useautumn.com)
|
|
118
|
+
- [Dashboard](https://app.useautumn.com)
|
|
119
|
+
- [Main GitHub](https://github.com/useautumn/autumn)
|
|
120
|
+
- [CLI & SDKs GitHub](https://github.com/useautumn/typescript)
|