Formanator allows you to submit benefit claims to Forma from the command line, either one-by-one or in bulk.
To install Formanator, make sure you have Node.js installed, and then just run:
npm install -g formanator
To get started, you'll need to connect Formanator to your Forma account. Here's how the process works:
- Run
formanator login
. - At the prompt, enter your email address, then hit Enter.
- You'll be sent an email with a magic link. Go to your inbox and copy the link to your clipboard.
- At the prompt, paste your magic link, then hit Enter.
- You'll be logged in 🥳
To remember your login, Formanator stores a .formanator.json
file in your home directory with your access token.
When submitting a claim, you need to specify a benefit and category for your claim. You can either decide that yourself, or you can have OpenAI do it for you, for a cost of about $0.001 (a tenth of a cent! 🪙) per claim ðŸ§
If you want to use OpenAI to infer the benefit and category, you'll need to set it up.
- Set up an OpenAI account and make sure you either (a) have free trial credit available or (b) have set up a payment method. You can check this on the "Usage" page.
- Create an OpenAI API key.
- Set the API key as the
OPENAI_API_KEY
environment variable, or be prepared to pass the--openai-api-key
argument to every command.
- Figure out what you're planning to claim for.
- Make sure you're logged in - for more details, see "Connecting to your Forma account" above.
- If you aren't using OpenAI to infer the benefit and category, you'll need to figure this out yourself. Get a list of your available benefits by running
formanator benefits
. Pick the relevant benefit, and then runformanator categories --benefit <benefit>
to get a list of categories. - Submit your claim by running
formanator submit-claim
. You'll need to pass a bunch of arguments:
formanator submit-claim --amount 2.28 \
--merchant Amazon \
--description "USB cable" \
--purchase-date 2023-01-15 \
# Optionally, you can attach multiple receipts by specifying this argument multiple times
--receipt-path "USB.pdf" \
# If you haven't configured OpenAI, you'll need to specify the benefit and category
--benefit "Remote Life" \
--category "Cables & Cords"
- If you've configured OpenAI, you'll be given the chance to check the benefit and category it has inferred
- If you confirm the benefit and category by hitting Enter, your claim will be submitted.
You can submit multiple claims at once by generating a template CSV, filling it in, then submitting the whole CSV.
- Make sure you're logged in - for more details, see "Connecting to your Forma account" above.
- Run
formanator generate-template-csv
to generate a CSV template. By default, the template will be saved asclaims.csv
. Optionally, you can specify the--output-path
argument to choose where to save the template. - If you aren't using OpenAI to infer the benefit and category for each claim, you'll need to figure this out yourself. Get a list of your available benefits by running
formanator benefits
. Pick the relevant benefit, and then runformanator categories --benefit <benefit>
to get a list of categories. - Update the template, filling in the columns for each of your claims. If you've configured OpenAI, you can leave the
benefit
andcategory
blank. If you want to attach multiple receipts, you can add comma-separated paths to thereceipt_path
column. - Validate the CSV up-front by running
formanator validate-csv --input-path claims.csv
. - Submit your claims by running
formanator submit-claims-from-csv --input-path claims.csv
. - If you've configured OpenAI, you'll be given the chance to check the benefit and category it has inferred for each claim.
- Your claims will be submitted. If there are any validation errors with any of the rows, or if anything goes wrong during submission, an error message will be displayed, but the tool will continue submitting other claims.
Changes to this project are verioned using Semantic Versioning and released to npm
automatically using semantic-release
.
Commit messages must follow Angular Commit Message Conventions so semantic-release
knows when to release new versions and what version number to use.