npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sharesight-cli

v0.2.0

Published

Unofficial CLI client for Sharesight

Readme

sharesight-cli

Unofficial CLI client for Sharesight, designed with AI agent workflows in mind.

Commands

  • sharesight auth login
  • sharesight auth status
  • sharesight auth logout
  • sharesight list portfolios
  • sharesight list holdings [--portfolio <id-or-name>] [--format <json|jsonl>]
  • sharesight list groupings
  • sharesight defaults set [--portfolio <id-or-name>] [--grouping <grouping-or-custom-name-or-id>] [--include-sales|--exclude-sales] [--format <json|jsonl>]
  • sharesight defaults show
  • sharesight 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-cli

Run without installing globally:

npx sharesight-cli --help

Development

For local development:

npm install
npm run build

Run during development:

npm run dev -- --help

Authentication

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:

  1. Recommended for interactive use:
  • sharesight auth login
  • Credentials are stored in OS secure storage when available (secret-tool on Linux, security on macOS).
  • If secure storage is unavailable, the CLI falls back to a local credentials file with restricted permissions and prints a warning.
  1. Recommended for automation/CI:
  • Set SHARESIGHT_CLIENT_ID and SHARESIGHT_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 123
    • sharesight defaults set --grouping "Long Term"
    • sharesight defaults set --include-sales
    • sharesight defaults set --exclude-sales
    • sharesight defaults set --format jsonl

Lists

  • Portfolios:
    • sharesight list portfolios
  • Holdings:
    • sharesight list holdings
    • sharesight 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 --portfolio is omitted, holdings use the default portfolio from defaults set.
  • Consolidated portfolios automatically request consolidated holdings.
  • Holdings output includes top-level portfolio context, metadata, and flattened holding rows.
  • If --format is omitted, list holdings defaults to json.

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 --portfolio is omitted, get performance uses the default portfolio from defaults set.
  • If --grouping is omitted, get performance uses the default grouping from defaults set or otherwise falls back to the Sharesight default.
  • If --include-sales / --exclude-sales is omitted, get performance uses the sales default from defaults set or otherwise falls back to the Sharesight default.
  • If --format is omitted, get performance uses the output format default from defaults set (or json if unset).
  • --grouping accepts:
    • standard grouping names (market, currency, etc.)
    • custom grouping ID (e.g. 123)
    • custom grouping exact name (e.g. "Long Term")

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 --portfolio is omitted, get trades uses the default portfolio from defaults set.
  • If --holding is omitted, trades are returned for the selected portfolio.
  • If --holding is provided, the CLI resolves it against the selected portfolio's holdings and retrieves holding-level trades.
  • --holding accepts 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 --format is omitted, get trades uses the output format default from defaults set (or json if 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 --portfolio is omitted, get payouts uses the default portfolio from defaults set.
  • If --holding is omitted, payouts are returned for the selected portfolio.
  • If --holding is provided, the CLI resolves it against the selected portfolio's holdings and retrieves holding-level payouts.
  • --holding accepts 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-date accepts paid_on or ex_date.
  • If --format is omitted, get payouts uses the output format default from defaults set (or json if unset).

Global options:

  • --base-url (default https://api.sharesight.com)
  • --timeout-ms (default 30000)

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