Skip to content

Ephigenia/kontist-cli

Repository files navigation

Project is work in progress.

test MIT License NPM Package NPM Downloads Rate on Openbase

Command Line Interface (CLI) Tool for using the Kontist API which under the hood relies on their marvelous GraphQL API Kontist Javascript SDK

Overview

  • login and use multiple account(s)
  • show status & current balance
  • list & filter transaction(s)
  • subscribe to incoming transactions
  • create transfer
  • list, show, block, unblock card(s)

See list of "ideas" for upcoming features …

Install

npm install kontist-cli

NPX

npx kontist-cli

Setup

Obtain valid client id for authentication. Request your client id in the API Client Management on https://kontist.dev/client-management/.

Create Access- & Refresh Token (valid for 1year) and store in system user preferences (using nconf package):

kontist-cli login <oauth-client-id> <username>

You’ll be promted for the password. There’s also the ability to setup multiple accounts.

Examples

The command-line-tool does not include any table formater or filtering mechanism as there are other nice tools for that like table-printer-cli for formatting JSON output to a nice-looking table and jq for transforming and filtering JSON.

Transactions

Both tools in combination can be used to create a nice-looking, customizable list of transactions:

kontist-cli transactions | jq -c 'map({bookingDate,valutaDate,amount,name,iban})' | npx table-printer-cli -s

List transactions between two dates:

kontist-cli transactions --from 2022-02-01 --to 2022-02-28

Transfer

Create a standing order that repeats every month

kontist-cli transfer 3000 GB33BUKB20201555555555 "Hulk Hogan" "Wrestling Club Membership fee" \
    --note "created after entering the wrestling club" \
    --repeat MONTHLY \
    --last 2022-12-31

Wait until you receive the confirmation code and enter it when prompted. You’ll also get a confirmation before the transaction is made.

Locale

Some commands rely on the systems LC_ALL, LC_TIME, or LC_NUMERIC variables to format monetary values or provide additional formatted dates. The balance sub-command:

$ LC_ALL=de-de kontist-cli balance
50,20 €

Output

All comands print out JSON to make it easy to filter and process the output using jq and other tools like [ctp(table-printer-cli)

Ideas

  • balance (kontist-cli balance, returns availableBalance)
    • get current balance
    • different output when availableBalance doesn’t match balance
    • add notification when card fraud is on
  • option to permanently set different LC_ALL
  • status command returns current overall status (kontist-cli account)
  • validate IBAN (checksum)
  • prevent invalid characters in purpose, e2eid
  • add multiple output formats
    • --pretty as table
    • --json as json (default)
    • --plain as tsv (easy for additional processing with xargs)
  • multi-account
    • add account (name defaults to "default")
      kontist-cli account login --account myalias <client-id> <username>
      
    • add account with named alias
      kontist-cli account login --name myAlias <client-id> <username>
      
    • list accounts kontist-cli accounts list
    • remove account with alias kontist-cli account delete <alias>
    • use specific account
      kontist-cli transfer create --account accountName <iban> <recipient> <amount>
      
  • cards
    • list kontist-cli cards list
      • including card settings
      • including card limits
    • get specific card kontist-cli cards <id>
    • block kontist-cli cards block <id> (changeCardStatus)
    • unblock kontist-cli cards unblock <id> (changeCardStatus)
    • replace kontist-cli cards replace <id> (replaceCard)
    • reorder kontist-cli cards reorder <id> (reorderCard)
    • update card settings / limits
  • invoice
    • list
    • update invoice
      • add product
      • remove product
    • create invoice
    • delete invoice
  • money format?
  • currency?
  • transfers
    • make it easier to repeat transactions
      • proposal: re-use transactions by id
      • proposal: auto-completion for kontist-cli transfer arguments
      • proposal: address-book like presets?
    • list
    • cancel (mutation cancelTransfer & confirmCancelTransfer)
      kontist-cli transfer cancel <id>
      
    • create
      • enable IBAN with spacing
      • convert umlauts to eu, ß to ss
      • normal order
        kontist-cli transfer create [amount] [iban] [recipient] [purpose] \     --executeAt <executionDate>
        
      • confirmation mfa
      • timed order
        kontist-cli transfer create [amount] [iban] [recipient] [purpose] \
            --at <executionDate>
        
      • standing order with additional StandingOrderReoccurenceType
        kontist-cli transfer create [amount] [iban] [recipient] [purpose] \
            --executeAt <executionDate>` \
            --last <optionalDate> \
            --repeat <reoccurenceType>;
        
    • update
  • transactions
    • list
      • limit transactions
      • search transactions
      • paginate transactions
      • filter transactions
        • by iban(s)
        • short filter for incoming / outgoing
          kontist-cli transactions list --outgoing
          kontist-cli transactions list --incoming
          
        • by date-range
          kontist-cli transactions list --from 2021-01-01 --to 2021-02-32
          
        • by date-range names
          kontist-cli transactions list this-month;
          kontist-cli transactions list last-month;
          kontist-cli transactions list this-year;
          kontist-cli transactions list today;
          kontist-cli transactions list yesterday;
          
    • listen for new transactions (https://kontist.dev/sdk/#subscribe-to-new-transactions)
  • cli auto-completion
  • cli tui interface
    • list transactions
    • show details of transaction
    • new transaction
  • maintenance tasks
    • publish on NPM
    • use version from package.json
    • setup semantic release
    • setup discussions

Other Projects / Bookmarks