# Quickstart

> Install the Trajectonomics CLI and record your first transaction.

`traj` is a command-line tool for your own money. It keeps a double-entry ledger in one file on your
machine and answers questions about balances, net worth and what comes next. It computes; the Agent
that runs it supplies the judgement.

## Install

[Installation](https://docs.trajectonomics.com/cli/installation/) lists the three channels. On Linux or macOS:

```bash
curl -fsSL \
  https://github.com/trajectonomics/trajectonomics/releases/latest/download/install.sh \
  | sh
```

## From an empty machine to a first balance

```bash exec
# create ~/.traj and an empty database
traj init

# an asset account, an expense account, and the equity account an opening balance needs
traj account add Cash --type asset --currency THB
traj account add Food --type expense --currency THB
traj account add Opening --type equity --currency THB

# fund Cash at the start of the record, then spend from it
traj tx add --opening --from Opening --to Cash --amount 1000.00 --date 2026-01-01
traj tx add --from Cash --to Food --amount 120.50 --date 2026-03-01
```

Then read every account's balance and net worth:

```bash exec
traj balance --as-of 2026-03-31
```

```text output
asOf: 2026-03-31
rows:
  - account:
      id: 01a1ff02-9448-70cc-9da9-0ba9dc6e0149
      name: Cash
    type: asset
    amount: 879.50
    currency: THB
  - account:
      id: 01a1ff02-94a2-737d-bee2-c44a350103a9
      name: Food
    type: expense
    amount: 120.50
    currency: THB
  - account:
      id: 01a1ff02-950a-7437-b8f6-07a7233cf17b
      name: Opening
    type: equity
    amount: -1000.00
    currency: THB
netWorth:
  - currency: THB
    amount: 879.50
```

`--type` and `--currency` are required when adding an account, and THB is the only currency this
release supports. `--as-of` is required on `balance`. Every date a command acts on is `YYYY-MM-DD`,
and it is always one you pass.

`traj tx add --opening` is how a ledger gets its first money: `--from` names the equity account the
amount posts against. Net worth is assets minus liabilities, `879.50` THB here; each account's id
is its own and differs on your machine. Without the
opening balance Cash holds `-120.50` THB, and [the Baseline](https://docs.trajectonomics.com/cli/commands/baseline/) refuses
the ledger rather than state a negative asset.

## Where your data lives

`traj init` writes `~/.traj/traj.db`, or `$TRAJ_HOME/traj.db` when `TRAJ_HOME` is set. That one file
is the ledger, and until `traj init` has created it every command that reads or writes it fails
with `ledger_missing`. [Your data](https://docs.trajectonomics.com/cli/data/) says what else is in the directory, what is safe to
delete, and how to back it up.

## What next

- [Installation](https://docs.trajectonomics.com/cli/installation/): the three install channels, the agent skill, release
  pinning and uninstall.
- [Your data](https://docs.trajectonomics.com/cli/data/): the data directory, backups and a clean removal.
- [Agent](https://docs.trajectonomics.com/cli/agent/): what the Agent asks you for, where the tool stops, and what this release
  does.
- [Configuration](https://docs.trajectonomics.com/cli/configuration/): the environment variables the CLI reads.
- [Commands](https://docs.trajectonomics.com/cli/commands/): the command reference.

The source code lives in
[`trajectonomics/trajectonomics/apps/cli`](https://github.com/trajectonomics/trajectonomics/tree/main/apps/cli).

Part of the [Docs index](https://docs.trajectonomics.com/llms.txt).
