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

fiscalfox

v0.1.4

Published

Agent-oriented UK Capital Gains Tax CLI

Downloads

431

Readme

FiscalFox CLI

UK Capital Gains Tax calculator for the command line. Deterministic, HMRC-compliant, agent-friendly.

Built for individual investors filing Self Assessment. Supports direct broker file parsing — no manual data entry needed.

Install

npm install -g fiscalfox

Or run without installing:

npx fiscalfox version

Requires Node.js 20+.

Quick Start

# Validate your broker export
fiscalfox validate trading212.csv --pretty

# Calculate CGT for the 2024/25 tax year
fiscalfox run trading212.csv --tax-year 2024/25 --income 55000 --sa108 --pretty

# Multiple broker files at once
fiscalfox run trading212.csv vanguard.xlsx --tax-year 2024/25 --income 55000 --sa108 --pretty --out ./results

Example Output

Capital Gains Tax Summary — 2024/25
────────────────────────────────────
Total disposals:        12
Disposal proceeds:      £24,350.00
Allowable costs:        £18,200.00
Total gains:            £6,150.00
Total losses:           £0.00
Net gain:               £6,150.00
Annual exemption used:  £3,000.00
Taxable gain:           £3,150.00
Estimated CGT:          £567.00

Supported Brokers

| Broker | Format | Auto-detected | |--------|--------|:---:| | Trading212 | CSV | Yes | | Freetrade | CSV | Yes | | InvestEngine | CSV | Yes | | Hargreaves Lansdown | CSV | Yes | | Vanguard | XLSX | Yes | | Saxo | XLSX | Yes | | eToro | XLSX | Yes |

Files from unsupported brokers can be converted to JSON using the input schema.

Commands

fiscalfox run <file...>

Calculate capital gains tax from one or more transaction files.

| Flag | Description | Required | |------|-------------|:---:| | --tax-year | UK tax year, e.g. 2024/25 | Yes | | --income | Annual income in GBP (for correct CGT rate) | Yes | | --sa108 | Include SA108 Self Assessment box values | No | | --out <dir> | Output directory (default: ./results) | No | | --pretty | Pretty-print JSON output | No | | --json-only | Write JSON artifacts only (skip CSV/TXT/MD) | No | | --no-stock-splits | Disable automatic stock split adjustments | No | | --verbose | Debug logging to stderr | No |

Output artifacts (written to --out directory):

  • cgt-calculation.json — Full structured result
  • normalized-transactions.json — All input transactions after normalization
  • disposals.json / disposals.csv — Individual disposal records with gain/loss
  • section104-pools.json — Remaining holdings with cost basis
  • sa108.json / sa108.csv — Self Assessment box values (when --sa108)
  • report.md / summary.txt — Human-readable summaries

fiscalfox validate <file...>

Validate input files without running a calculation.

| Flag | Description | |------|-------------| | --pretty | Pretty-print output |

fiscalfox schema [input|output|all]

Print the JSON schema for input transactions or calculation output.

| Flag | Description | |------|-------------| | --pretty | Pretty-print output |

fiscalfox version

Print the CLI version.

JSON Input

For unsupported brokers, provide a JSON array of transactions:

[
  {
    "date": "2024-06-15",
    "type": "buy",
    "ticker": "AAPL",
    "units": 10,
    "price": 150.00,
    "total": 1500.00,
    "platform": "AJ Bell"
  }
]

Required fields: date, type (buy/sell), ticker, units, price, total, platform

Optional fields: id, name, fees, fileSource, warning, isFreeshare

Run fiscalfox schema input --pretty for the full schema.

Use with Claude Code

FiscalFox is designed to work as a tool for AI coding agents. The package includes an AGENT.md file with detailed instructions for Claude Code and other LLM agents.

When using Claude Code, the agent can:

  • Parse exports from any broker (not just the 7 built-in ones)
  • Convert unfamiliar file formats to JSON automatically
  • Run calculations and explain results in plain English
  • Answer follow-up questions about your gains, losses, and holdings

See AGENT.md for the full agent instructions.

Stock Splits

The CLI automatically adjusts historical transactions for known stock splits (AMZN, GOOGL, NVDA, AAPL, TSLA, SHOP, PANW, WMT, CMG, FAST, COKE, IBKR, ORLY). Use --no-stock-splits to disable.

Tax Years

| Tax Year | Annual Exemption | CGT Rates (Basic / Higher) | |----------|-----------------|---------------------------| | 2025/26 | £3,000 | 18% / 24% | | 2024/25 | £3,000 | 10%/20% (before 30 Oct) — 18%/24% (from 30 Oct) | | 2023/24 | £6,000 | 10% / 20% | | 2022/23 | £12,300 | 10% / 20% |

Links