sharesight-cli
v0.2.0
Published
Unofficial CLI client for Sharesight
Maintainers
Readme
sharesight-cli
Unofficial CLI client for Sharesight, designed with AI agent workflows in mind.
Commands
sharesight auth loginsharesight auth statussharesight auth logoutsharesight list portfoliossharesight list holdings [--portfolio <id-or-name>] [--format <json|jsonl>]sharesight list groupingssharesight defaults set [--portfolio <id-or-name>] [--grouping <grouping-or-custom-name-or-id>] [--include-sales|--exclude-sales] [--format <json|jsonl>]sharesight defaults showsharesight get performance [--portfolio <id-or-name>] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--include-sales|--exclude-sales] [--grouping <grouping-or-custom-name-or-id>] [--format <json|jsonl>]sharesight get trades [--portfolio <id-or-name>] [--holding <symbol[.market]>] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--unique-identifier <id>] [--format <json|jsonl>]sharesight get payouts [--portfolio <id-or-name>] [--holding <symbol[.market]>] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--use-date <paid_on|ex_date>] [--format <json|jsonl>]
Installation
Install globally (recommended for regular use):
npm install -g sharesight-cliRun without installing globally:
npx sharesight-cli --helpDevelopment
For local development:
npm install
npm run buildRun during development:
npm run dev -- --helpAuthentication
Each user uses their own Sharesight OAuth client_id and client_secret.
Paying Sharesight subscribers can contact Sharesight support and ask them to provision an API account for personal use.
You can provide credentials in two ways:
- Recommended for interactive use:
sharesight auth login- Credentials are stored in OS secure storage when available (
secret-toolon Linux,securityon macOS). - If secure storage is unavailable, the CLI falls back to a local credentials file with restricted permissions and prints a warning.
- Recommended for automation/CI:
- Set
SHARESIGHT_CLIENT_IDandSHARESIGHT_CLIENT_SECRET.
Use sharesight auth status to see which credential backend is currently active.
Defaults
Set defaults once, then run report commands without repeating flags.
- Show current defaults:
sharesight defaults show
- Set default portfolio and grouping together:
sharesight defaults set --portfolio "Main Portfolio" --grouping market
- Set only one default:
sharesight defaults set --portfolio 123sharesight defaults set --grouping "Long Term"sharesight defaults set --include-salessharesight defaults set --exclude-salessharesight defaults set --format jsonl
Lists
- Portfolios:
sharesight list portfolios
- Holdings:
sharesight list holdingssharesight list holdings --portfolio 123
- Groupings (built-in + custom):
sharesight list groupings
List holdings
sharesight list holdings --format json
sharesight list holdings --portfolio 123 --format jsonl
sharesight list holdings --portfolio "Main Portfolio"- If
--portfoliois omitted, holdings use the default portfolio fromdefaults set. - Consolidated portfolios automatically request consolidated holdings.
- Holdings output includes top-level portfolio context, metadata, and flattened holding rows.
- If
--formatis omitted,list holdingsdefaults tojson.
Get performance
sharesight get performance --format json
sharesight get performance --portfolio 123 --format json
sharesight get performance --start-date 2024-01-01 --end-date 2024-12-31 --include-sales
sharesight get performance --exclude-sales
sharesight get performance --grouping market
sharesight get performance --grouping 123
sharesight get performance --grouping "Long Term"- If
--portfoliois omitted,get performanceuses the default portfolio fromdefaults set. - If
--groupingis omitted,get performanceuses the default grouping fromdefaults setor otherwise falls back to the Sharesight default. - If
--include-sales/--exclude-salesis omitted,get performanceuses the sales default fromdefaults setor otherwise falls back to the Sharesight default. - If
--formatis omitted,get performanceuses the output format default fromdefaults set(orjsonif unset). --groupingaccepts:- standard grouping names (
market,currency, etc.) - custom grouping ID (e.g.
123) - custom grouping exact name (e.g.
"Long Term")
- standard grouping names (
Get trades
sharesight get trades --format json
sharesight get trades --portfolio 123 --start-date 2024-01-01 --end-date 2024-12-31
sharesight get trades --holding AAPL
sharesight get trades --holding AAPL.NASDAQ
sharesight get trades --unique-identifier broker-confirmation-123- If
--portfoliois omitted,get tradesuses the default portfolio fromdefaults set. - If
--holdingis omitted, trades are returned for the selected portfolio. - If
--holdingis provided, the CLI resolves it against the selected portfolio's holdings and retrieves holding-level trades. --holdingaccepts an unqualified symbol (e.g.AAPL) only when it uniquely identifies a holding in the selected portfolio.- Use
symbol.market(e.g.AAPL.NASDAQ) when a symbol is listed in more than one market. - If
--formatis omitted,get tradesuses the output format default fromdefaults set(orjsonif unset).
Get payouts
sharesight get payouts --format json
sharesight get payouts --portfolio 123 --start-date 2024-01-01 --end-date 2024-12-31
sharesight get payouts --holding VAS.ASX
sharesight get payouts --use-date ex_date- If
--portfoliois omitted,get payoutsuses the default portfolio fromdefaults set. - If
--holdingis omitted, payouts are returned for the selected portfolio. - If
--holdingis provided, the CLI resolves it against the selected portfolio's holdings and retrieves holding-level payouts. --holdingaccepts an unqualified symbol (e.g.VAS) only when it uniquely identifies a holding in the selected portfolio.- Use
symbol.market(e.g.VAS.ASX) when a symbol is listed in more than one market. --use-dateacceptspaid_onorex_date.- If
--formatis omitted,get payoutsuses the output format default fromdefaults set(orjsonif unset).
Global options:
--base-url(defaulthttps://api.sharesight.com)--timeout-ms(default30000)
Output formats
json(default): pretty JSON output (recommended for AI agents)jsonl: one JSON record per line (best for pipelines)
Development checks
npm run check