---
title: CLI Reference
description: firma is built around Claude, so most people barely touch the CLI after setup. Still, every MCP tool has a matching firma command for scripting, automation, or direct terminal use. Every read command also supports --json.
---

export const setupRows = [
  { cmd: <code>firma config set finnhub-key &lt;key&gt;</code>, desc: 'Set Finnhub API key (free at finnhub.io)' },
  { cmd: <code>firma config set fred-key &lt;key&gt;</code>,    desc: 'Set FRED API key (free at fred.stlouisfed.org)' },
  { cmd: <code>firma config set currency &lt;CODE&gt;</code>,    desc: 'Set home display currency (KRW, USD, JPY, EUR, …)' },
  { cmd: <code>firma config get [key]</code>,                    desc: 'Show config values' },
  { cmd: <code>firma mcp install</code>,                         desc: 'Register the MCP server in Claude Desktop config' },
  { cmd: <code>firma doctor</code>,                              desc: 'Check setup status, including keys, data, and the FX cache. Suggests fixes when something is missing.' },
  { cmd: <code>firma profile</code>,                             desc: 'Set up goals interactively (5 fields, all optional)' },
];

export const portfolioRows = [
  { cmd: <code>firma show portfolio</code>,           desc: 'Holdings with P&L, avg cost, market value' },
  { cmd: <code>firma show txns [ticker]</code>,       desc: 'Transaction history with running average cost' },
  { cmd: <code>firma show dividend</code>,            desc: 'Estimated annual dividend income + per-ticker yield' },
  { cmd: <code>firma show concentration</code>,       desc: 'HHI concentration by ticker, currency, sector, country' },
  { cmd: <code>firma show snapshot [ticker]</code>,   desc: <>Portfolio value history. <code>--from</code>/<code>--to</code> for range</> },
  { cmd: <code>firma show benchmark</code>,           desc: <>Portfolio return vs SPY/QQQ. <code>-b</code> for custom benchmarks</> },
  { cmd: <code>firma show risk</code>,                desc: 'Volatility, drawdown, Sharpe, Sortino, and beta. Requires snapshots' },
  { cmd: <code>firma show profile</code>,             desc: 'Stored goals (birth year, retirement target, target net worth, …)' },
];

export const balanceFlowRows = [
  { cmd: <code>firma add balance [-p YYYY-MM]</code>, desc: 'Monthly asset & liability snapshot wizard' },
  { cmd: <code>firma add flow [-p YYYY-MM]</code>,    desc: 'Monthly income & expense entry wizard' },
  { cmd: <code>firma add monthly [-p YYYY-MM]</code>, desc: 'Record balance and cash flow in one session. Best for month-end' },
  { cmd: <code>firma show balance [-p YYYY-MM]</code>,desc: 'Stored balance entries' },
  { cmd: <code>firma show flow [-p YYYY-MM]</code>,   desc: 'Stored flow entries' },
  { cmd: <code>firma report</code>,                   desc: 'Net worth trend + cash flow charts (combined)' },
  { cmd: <code>firma report balance / flow / settle</code>, desc: <>Targeted views. <code>-c USD</code> to display in any currency</> },
];

export const txnSnapshotRows = [
  { cmd: <code>firma add txn</code>,           desc: 'Record one transaction — a stock in any of 9 markets, or a non-stock asset (crypto, commodity, real estate); type buy, sell, deposit, dividend, or tax' },
  { cmd: <code>firma add price [name] [value]</code>, desc: 'Set the current value of non-stock holdings — they have no price feed, so you keep them current by hand' },
  { cmd: <code>firma edit txn [id]</code>,     desc: 'Edit a transaction (asset type, date, shares, price, reason)' },
  { cmd: <code>firma delete txn [id]</code>,   desc: 'Delete a transaction' },
  { cmd: <code>firma add snapshot</code>,      desc: "Sync prices and record today's portfolio snapshot" },
  { cmd: <code>firma edit snapshot</code>,     desc: 'Edit a snapshot entry (interactive picker)' },
  { cmd: <code>firma delete snapshot [date]</code>, desc: 'Delete all entries for a date' },
];

export const briefSyncRows = [
  { cmd: <code>firma brief</code>,    desc: <>Movers, news, earnings, macro, commodity prices, dividend calendar, world macro, and disaster alerts. Cached daily, and it auto-snaps if today's snapshot is missing. <code>--refresh</code> regenerates it.</> },
  { cmd: <code>firma sync</code>,     desc: 'Fetch latest prices (Finnhub) + FX rate history (FRED)' },
  { cmd: <code>firma sync fx</code>,  desc: 'Refresh FX history only, with incremental backfill' },
];

export const macroRows = [
  { cmd: <code>firma show macro</code>,         desc: '8 FRED indicators + Economic Stress Index + macro regime bias, in one view' },
  { cmd: <code>firma show world-intel</code>,   desc: 'World Bank macro + GDACS disaster alerts. No API key required' },
  { cmd: <code>firma show fx [currency]</code>, desc: <>Cached FX history. <code>--from</code>/<code>--to</code>/<code>--limit</code></> },
];

export const researchRows = [
  { cmd: <code>firma show news &lt;ticker&gt;</code>,       desc: 'Recent company news' },
  { cmd: <code>firma show insider &lt;ticker&gt;</code>,    desc: 'Insider buy/sell transactions' },
  { cmd: <code>firma show financials &lt;ticker&gt;</code>, desc: 'SEC-reported quarterly financials' },
  { cmd: <code>firma show valuation &lt;ticker&gt;</code>,  desc: 'PEG ratio, P/S, FCF yield from 8 quarters of SEC filings' },
  { cmd: <code>firma show earnings [ticker]</code>,         desc: 'Earnings calendar + EPS history' },
];

export const tips = [
  {
    icon: 'json',
    title: <><code>--json</code> on every read command</>,
    desc: 'Pipe firma output into jq, scripts, or other tools. It is the same data Claude sees, with the same field names.',
  },
  {
    icon: 'rm',
    title: <><code>firma rm</code> aliases <code>firma delete</code></>,
    desc: 'Shorter form for the destructive verbs.',
  },
  {
    icon: 'db',
    title: <>Local SQLite at <code>~/.firma/firma.db</code></>,
    desc: 'Everything lives in one file. Back it up, copy it between machines, or open it directly with any SQLite client.',
  },
];

<Section label="Setup">
  <CommandTable rows={setupRows} />
</Section>

<Section label="Portfolio">
  <CommandTable rows={portfolioRows} />
</Section>

<Section label="Net Worth & Cash Flow">
  <CommandTable rows={balanceFlowRows} />
</Section>

<Section label="Transactions & Snapshots">
  <CommandTable rows={txnSnapshotRows} />
</Section>

<Section label="Daily Brief & Sync">
  <CommandTable rows={briefSyncRows} />
</Section>

<Section label="Macro">
  <CommandTable rows={macroRows} />
</Section>

<Section label="Research">
  <CommandTable rows={researchRows} />
</Section>

<Section label="Tips">
  <FeatureList items={tips} />
</Section>
