Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This project is a command line tool for managing and interacting with Investec banks API services. It provides various commands to perform operations such as getting a list of bank accounts, balances, and transactions.

the service also provides a way to write js snippets that are loaded on to your bank card account and executed when you make a payment. This allows you to automate certain actions or perform custom logic when spending money.

The project uses commanderjs for the command line interface, and it is designed to be run in a Node.js environment. The code is structured to allow for easy addition of new commands and features.

Commands can be found in src/cmds and the entry point is in src/index.ts. The project also includes a configuration file for managing settings and options.

The project is distributed via npm and can be installed globally or used as a local dependency in other projects.

It is compiled using TypeScript, and the source code is organized into modules for better maintainability. The project also includes unit tests to ensure the functionality of the commands and features. this is done via npm run build.
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build --if-present
- run: npm test --if-present
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to npm

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: "https://registry.npmjs.org/"
- run: npm ci
- run: npm run build --if-present
- name: Verify package contents
run: npm pack --dry-run
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data
.DS_Store
executions.json
/main.js
published.js
env.json
gen.js
ai-generated.js
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ This repository is crafted with ❤️ by our talented community members. It's a
- [Fetch Published Code](#fetch-published-code)
- [Publish Code](#publish-code)
- [Simulate Code](#simulate-code)
- [Accounts](#accounts)
- [Balances](#balances)
- [Transfer](#transfer)
- [Pay](#pay)
- [Transactions](#transactions)
- [Beneficiaries](#beneficiaries)
- [Config](#config)
- [Bank](#bank)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -338,6 +346,86 @@ This command is ideal for testing your code in a production-like environment bef

![simulate command](assets/simulate.gif)

### Accounts

Get a list of your accounts:

```sh
ipb accounts
```

This command retrieves all your Investec accounts linked to your credentials.

### Balances

Get balances for a specific account:

```sh
ipb balances <accountId>
```

This command fetches the balance for the given account ID.

### Transfer

Transfer between your accounts:

```sh
ipb transfer <accountId> <beneficiaryAccountId> <amount> <reference>
```

Transfers the specified amount (in rands, e.g. 100.00) from one account to another with a reference.

### Pay

Pay a beneficiary from your account:

```sh
ipb pay <accountId> <beneficiaryId> <amount> <reference>
```

Pays a beneficiary from your account with the specified amount and reference.

### Transactions

Get transactions for a specific account:

```sh
ipb transactions <accountId>
```

Fetches the transaction history for the given account ID.

### Beneficiaries

Get your list of beneficiaries:

```sh
ipb beneficiaries
```

Lists all beneficiaries linked to your Investec profile.

### Config

Set authentication credentials for the CLI:

```sh
ipb config --client-id <client-id> --client-secret <client-secret> --api-key <api-key>
```

You can also set card key, OpenAI key, and sandbox key using additional options.

### Bank

Use the LLM to call your bank with a natural language prompt:

```sh
ipb bank "Show me my last 5 transactions"
```

This command uses AI to interpret your prompt and interact with your bank data.

---

## Development
Expand Down
Binary file added assets/accounts.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/balances.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/beneficiaries.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/cards.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/deploy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/env.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/fetch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/logs.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/new.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pay.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/publish.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/published.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/run.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/simulate.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/toggle.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/transactions.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/transfer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/upload-env.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/upload.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading