@hideokamoto/fillet
v0.0.1
Published
CLI tools for Stripe
Downloads
3
Readme
Fillet [WIP]
CLI tools for Stripe
Getting Started
$ npm i -g @hideokamoto/fillet
$ fillet init {STRIPE_SK_KEY}
$ fillet COMMAND
Usage
$ npm install -g @hideokamoto/fillet
$ fillet COMMAND
running command...
$ fillet (-v|--version|version)
@hideokamoto/fillet/0.0.0 darwin-x64 node-v10.1.0
$ fillet --help [COMMAND]
USAGE
$ fillet COMMAND
...
Commands
fillet billing TYPE
Stripe Billing
USAGE
$ fillet billing TYPE
ARGUMENTS
TYPE products, subscriptions
OPTIONS
-f, --force Should replace plan or products
-h, --help show CLI help
-n, --fileName=fileName
-o, --output
-v, --verbose debug mode
DESCRIPTION
...
Extra documentation goes here
See code: src/commands/billing.js
fillet help [COMMAND]
display help for fillet
USAGE
$ fillet help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
fillet init STRIPE
Initialize fillet
USAGE
$ fillet init STRIPE
ARGUMENTS
STRIPE Stripe secret key
OPTIONS
-h, --help show CLI help
DESCRIPTION
...
To put Stripe secret key into .fillet/config
The file will be ignored from git.
See code: src/commands/init.js
fillet billing TYPE
Stripe Billing
USAGE
$ fillet billing TYPE
ARGUMENTS
TYPE products, subscriptions
OPTIONS
-f, --force Should replace plan or products
-h, --help show CLI help
-n, --fileName=fileName
-o, --output
-v, --verbose debug mode
DESCRIPTION
...
Extra documentation goes here
See code: src/commands/billing.js
Product / Plan object
You can define your plan as YAML file.
name: example plan
type: service
active: true
statement_descriptor: hello fillet
plans:
- id: my-plan
currency: jpy
interval: month
nickname: My Plan
active: true
amount: 15000
id: prod_XXXXXXXXXXXXX
Create / Update a plan
$ fillet billing import-product -n ./product.yml
Import product:: prod_XXXXXXXXXXXXX
plan created:my-plan
Finished
You can not update price / interval / currency to exists plan.
$ fillet billing import-product -n ./product.yml
Import product:: prod_XXXXXXXXXXXXX
plan: my-plan has been skipped.
If you replace the plan, please run the command with -f / --force option
Finished
Upgrade plan price
You can use -f
option to replace plan price.
-f option will delete / create plan*
$ fillet billing import-product -n ./product.yml -f
Import product:: prod_XXXXXXXXXXXXX
[Replace]: my-plan
[Replace]:starting to delete my-plan
plan deleted:my-plan
[Replace]:starting to create new plan
plan created:my-plan
[Replace]:replace new plan: my-plan
Finished
Check plan diff
You can check your plan diff between Stripe to your local YAML file.
$ fillet billing diff-plans -n ./product.yml
[
{
"active": true,
- "amount": 10000,
+ "amount": 15000,
"currency": "jpy",
"id": "my-plan",
"interval": "month",
- "interval_count": 1,
-
"nickname": "テスト",
- "object": "plan",
-
"product": "prod_XXXXXXXXXXXXX",
}
]
fillet help [COMMAND]
display help for fillet
USAGE
$ fillet help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help