@hawkeeman/wsli
v0.2.7
Published
Wealthsimple CLI: GraphQL + Trade REST (accounts, portfolio, buy/sell)
Maintainers
Readme
wsli
wsli is a Node 20+ CLI for Wealthsimple account, portfolio, and trading workflows. It supports read-only GraphQL and Trade REST calls for accounts, positions, portfolio, funding, plus live buy and sell.
Install
npm install -g wsliThen confirm the CLI is on your PATH:
wsli --helpIf your shell cannot find wsli, ensure npm's global bin directory is on your PATH:
npm prefix -gQuick start
Set up a session and confirm the default session path:
wsli setup
wsli session-pathThe default session file is ~/.config/wsli/session.json.
To remove local credentials without signing out of Wealthsimple in the browser:
wsli disconnectUse --dry-run to preview which files would be deleted.
Safety
- Live
buyandsellcommands require explicit flags and should be treated as real brokerage actions. buy,sell,transfer, andtrade-smokerequire--confirmunless using--dry-runwhere supported.
Commands
Use wsli --help and wsli <command> --help for details.
| Area | Commands |
|------|----------|
| Session | setup, import-session, disconnect, config-path, session-path, ping, keepalive |
| Market data | lookup, security |
| Account | accounts, positions, position-for-symbol, portfolio |
| Orders | buy (supports --order market|limit|stop_limit|stop_market, with --stop-price for stop orders), sell (supports --order market|limit|stop_limit|stop_market, with --stop-price for stop orders, --sell-all, --confirm required), transfer (internal account transfer with --from/--to selectors, --confirm required), trade-smoke |
| Aliases | account-alias list, account-alias set, account-alias remove, account-alias-path |
| Diagnostics | logs, history |
For buy --order limit, buy --order stop_limit, and buy --order stop_market, use whole shares with --shares. Stop-limit requires both --stop-price and --limit-price; stop-market requires only --stop-price.
For sell --order stop_limit and sell --order stop_market, use whole shares with --shares (or --sell-all). Stop-limit requires both --stop-price and --limit-price; stop-market requires only --stop-price.
Flags and environment
CLI flags:
--token-file--access-token--refresh-token
Environment variables:
WEALTHSIMPLE_ACCESS_TOKENWEALTHSIMPLE_REFRESH_TOKENWEALTHSIMPLE_OAUTH_JSONWEALTHSIMPLE_OAUTH_CLIENT_IDWSLI_NO_REFRESH=1ortrueto disable OAuth refresh
accounts outputs readable blocks by default. Use positions, position-for-symbol, logs --json, and history --json when you need JSON output.
From source
git clone https://github.com/Hawkeeeman/wsli.git
cd wsli
npm install
npm run buildRun from the repo with either:
./wsli --help
npm run wsli -- --helpThe root wsli launcher rebuilds from src/ when dist/ is missing or stale, then runs the CLI.
Develop
npm run dev -- --help
npm run check