atmn 0.0.2 → 0.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/LICENSE +21 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -2
- package/readme.md +90 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 John Yeo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { DEFAULT_CONFIG } from './constants.js';
|
|
|
13
13
|
const VERSION = '1.0.0b';
|
|
14
14
|
program
|
|
15
15
|
.command('push')
|
|
16
|
-
.description('Push changes to
|
|
16
|
+
.description('Push changes to Autumn')
|
|
17
17
|
.option('-p, --prod', 'Push to production')
|
|
18
18
|
.option('-y, --yes', 'Confirm all deletions')
|
|
19
19
|
.action(async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atmn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": "dist/cli.js",
|
|
6
6
|
"main": "dist/cli.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@inquirer/prompts": "^7.6.0",
|
|
24
|
-
"autumn-js": "
|
|
24
|
+
"autumn-js": "^0.0.102",
|
|
25
25
|
"axios": "^1.10.0",
|
|
26
26
|
"commander": "^14.0.0",
|
|
27
27
|
"dotenv": "^17.2.0",
|
package/readme.md
CHANGED
|
@@ -1,25 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Autumn CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The CLI tool for [Autumn](https://useautumn.com)'s REST API.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
|
+
Features
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
- Create your features in products **in-code**.
|
|
9
|
+
- Authenticate with the CLI tool.
|
|
10
|
+
- Easily push and pull changes to and from Autumn.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
Usage: atmn [options] [command]
|
|
16
|
+
|
|
17
|
+
Options:
|
|
18
|
+
-h, --help display help for command
|
|
19
|
+
|
|
20
|
+
Commands:
|
|
21
|
+
push [options] Push changes to Autumn
|
|
22
|
+
pull [options] Pull changes from Autumn
|
|
23
|
+
init Initialize an Autumn project.
|
|
24
|
+
auth [options] Authenticate with Autumn
|
|
25
|
+
dashboard Open the Autumn dashboard in your browser
|
|
26
|
+
version Show the version of Autumn
|
|
27
|
+
help [command] display help for command
|
|
9
28
|
```
|
|
10
29
|
|
|
11
|
-
##
|
|
30
|
+
## Getting started
|
|
31
|
+
Run `npx atmn init` in your project folder. This will prompt you to authenticate with Autumn and
|
|
32
|
+
downloads your Autumn keys to the root level `.env`.
|
|
12
33
|
|
|
34
|
+
If you make a change locally in your `autumn.config.ts` file and you'd like to push, simply run the `push` command:
|
|
35
|
+
```sh
|
|
36
|
+
npx atmn push
|
|
13
37
|
```
|
|
14
|
-
$ cli --help
|
|
15
38
|
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
Likewise, to pull changes from Autumn, run the `pull` command:
|
|
40
|
+
```sh
|
|
41
|
+
npx atmn pull
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If you'd like to access your production environment, go to your `.env` and uncomment out the
|
|
45
|
+
production key, and comment out your sandbox key.
|
|
46
|
+
|
|
47
|
+
## Example `autumn.config.ts`
|
|
18
48
|
|
|
19
|
-
|
|
20
|
-
|
|
49
|
+
```typescript autumn.config.ts
|
|
50
|
+
import {
|
|
51
|
+
feature,
|
|
52
|
+
product,
|
|
53
|
+
priceItem,
|
|
54
|
+
featureItem,
|
|
55
|
+
pricedFeatureItem,
|
|
56
|
+
} from 'autumn-js/compose';
|
|
21
57
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
58
|
+
const seats = feature({
|
|
59
|
+
id: 'seats',
|
|
60
|
+
name: 'Seats',
|
|
61
|
+
type: 'continuous_use',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const messages = feature({
|
|
65
|
+
id: 'messages',
|
|
66
|
+
name: 'Messages',
|
|
67
|
+
type: 'single_use',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const pro = product({
|
|
71
|
+
id: 'pro',
|
|
72
|
+
name: 'Pro',
|
|
73
|
+
items: [
|
|
74
|
+
// 500 messages per month
|
|
75
|
+
featureItem({
|
|
76
|
+
feature_id: messages.id,
|
|
77
|
+
included_usage: 500,
|
|
78
|
+
interval: 'month',
|
|
79
|
+
}),
|
|
80
|
+
|
|
81
|
+
// $10 per seat per month
|
|
82
|
+
pricedFeatureItem({
|
|
83
|
+
feature_id: seats.id,
|
|
84
|
+
price: 10,
|
|
85
|
+
interval: 'month',
|
|
86
|
+
}),
|
|
87
|
+
|
|
88
|
+
// $50 / month
|
|
89
|
+
priceItem({
|
|
90
|
+
price: 50,
|
|
91
|
+
interval: 'month',
|
|
92
|
+
}),
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export default {
|
|
97
|
+
features: [seats, messages],
|
|
98
|
+
products: [pro],
|
|
99
|
+
};
|
|
25
100
|
```
|
|
101
|
+
|