@finopsbricks/fob-tally
v0.2.1
Published
Tally mirror client + fob-tally CLI (2-in-1): read a company's Tally books (masters, vouchers, reports) from tally.finopsbricks.com or tally-sync's local mirror.
Maintainers
Readme
@finopsbricks/fob-tally
Client library and fob-tally CLI for a Tally mirror: a company's TallyPrime books (groups, ledgers, voucher types, cost centres, vouchers with their entries, the chart and four reports), as tally-sync copies them out of Tally.
Two mirrors serve the same API:
| Mirror | Where | Auth | Company |
|---|---|---|---|
| Cloud | https://tally.finopsbricks.com | the org's API key and secret | the org is its company |
| Local | http://127.0.0.1:7780, on the PC that runs Tally and tally-sync | none | one of the PC's companies, by GUID |
Read-only. Tally is the book of record. Every answer says what it is as of: when the data was read from Tally, and whether that sync's balances matched Tally's own (the tie-out).
Install
Not on npm yet. Install a tagged version from GitHub (needs read access to finopsbricks/fob-tally):
npm install -g github:finopsbricks/fob-tally#v0.2.0
fob-tally --versionAs a library: npm install github:finopsbricks/fob-tally#v0.2.0.
Profiles
A profile is a cloud org or a local mirror's company. They live in ~/.fob/fob-tally/config.yml (mode 0600; FOB_TALLY_CONFIG_DIR moves it). --profile <name> (alias --org) picks one for a command; config use switches the active one.
A cloud org. Create an API key under the org's Settings → API Keys at tally.finopsbricks.com, then:
fob-tally config add acme --api-key fob_tly_xxxx # prompts for the secretA local mirror. On the Tally PC (or over a tunnel to its port 7780), list its companies and add one:
fob-tally companies list --api-url http://127.0.0.1:7780
fob-tally config add acme-local --company 3f2b6c1e-0000-4000-8000-000000000001--api-url defaults to the cloud for a key and to http://127.0.0.1:7780 for --company. config add <name> with neither asks which kind and offers the mirror's companies to pick from.
fob-tally config list # NAME, KIND, API URL, COMPANY
fob-tally config current
fob-tally config use acme
fob-tally config remove acme-localCommands
fob-tally <resource> <action> [target] [options]| Command | What |
|---|---|
| company get | the company, its health and last sync |
| companies list [--api-url] | a local mirror's companies (local only: a cloud org has one) |
| groups list, groups get <guid> | groups; one group with the groups and ledgers under it |
| ledgers list, ledgers get <guid> | ledgers with balances; one ledger with its totals and every entry, oldest first, with a running balance |
| voucher-types list, cost-categories list, cost-centres list | the other masters |
| chart get [--depth n] | the chart of accounts with closing balances |
| vouchers list [--from --to] [--voucher-type] [--ledger] | vouchers by date, with their entries |
| vouchers get <guid> | one voucher, its entries and bill, cost-centre and bank allocations |
| reports trial-balance [--date] (tb) | trial balance, default today |
| reports balance-sheet [--date] (bs) | balance sheet, default today |
| reports profit-loss [--from --to] (pl) | profit and loss, default the financial year to date |
| reports cash-flow [--from --to] (cf) | cash flow, default the financial year to date |
- Lists take
--page,--limit(default 100, at most 500) or--all(every page). - Reports and the chart take
--depth <n>: how many levels of the group tree to show (default 1). --jsonon every read prints the API's answer whole:datawithas_of(andpage_contextfor a page;count,truncated,mixedfor--all).- Human output ends with the freshness line:
As of 2026-11-28T10:19:43.941Z, tie-out ok(ortie-out differs (N ledger(s)), ornot synced yet). - Errors are the API's, as it gave them:
Error [NOT_FOUND]: Voucher not found.503 MIRROR_NOT_READYmeans the mirror has no sync of this company yet: let tally-sync finish one (and upload it, for the cloud). Exit code 1.
Amounts are Tally's: Dr is a debit, Cr a credit. In JSON they are integer paise with Tally's sign, negative = debit.
Examples
fob-tally company get
fob-tally ledgers list --all --json | jq '.data[] | {name, closing_balance_paise}'
fob-tally ledgers get <ledger-guid>
fob-tally vouchers list --from 2026-10-01 --to 2026-10-31 --voucher-type Payment
fob-tally vouchers list --ledger "HDFC CURRENT A/C" --all --json > hdfc.json
fob-tally reports trial-balance --date 2026-09-30 --depth 2
fob-tally --profile acme-local reports pl --from 2026-04-01 --to 2026-09-30Library
import { fobTally } from '@finopsbricks/fob-tally';
// cloud
const tally = fobTally({ api_key, api_secret }); // api_url defaults to https://tally.finopsbricks.com
// local
const { data: companies } = await fobTally({ api_url: 'http://127.0.0.1:7780' }).companies.list();
const local = fobTally({ api_url: 'http://127.0.0.1:7780', company: companies[0].company.guid });
const { data: { company }, as_of } = await tally.company.get();
if (!as_of.tie_out?.matched) throw new Error('The last sync did not tie out with Tally');
const { data: vouchers } = await tally.vouchers.listAll({ date_from: '2026-10-01', date_to: '2026-10-31' });
const { data: tb } = await tally.reports.trialBalance({ date: '2026-09-30' });| Namespace | Methods |
|---|---|
| company | get() → {data: {company, health}, as_of} |
| companies | list(), local only |
| groups, ledgers | list({page, limit}), listAll(), get(guid) |
| voucherTypes, costCategories, costCentres | list({page, limit}), listAll() |
| chart | get() |
| vouchers | list({date_from, date_to, voucher_type, ledger, page, limit}), listAll(filters), get(guid) |
| reports | trialBalance({date}), balanceSheet({date}), profitLoss({date_from, date_to}), cashFlow({date_from, date_to}) |
Answers are the API's envelope, passed through: {data, as_of}, plus page_context on a list page. listAll returns {data, as_of, count, truncated, mixed}; mixed is true when a sync landed between pages, so read again. Errors throw an ApiError with the API's code and status.
