# Importing into Yoshi

Yoshi takes a journal as up to four CSV files: to-dos, food, training and
notes. Turn your old logs (Notion, Apple Notes, a spreadsheet, another app's
export) into these files any way you like, often by asking an AI agent to,
then load them:

```sh
yoshi login
yoshi import todos.csv food.csv --dry-run   # checks them, changes nothing
yoshi import todos.csv food.csv
```

The kind of each file comes from its name (`todos`, `food`, `training`,
`notes` somewhere in it) or `--kind`. Settings → Data → Import CSV in the
app takes the same files.

## The rules for every file

- UTF-8, comma separated, a header row first, quotes as in RFC 4180 (a field
  with a comma, quote or line break is in double quotes; a quote in it is
  doubled).
- Columns can come in any order. Unknown columns are ignored, so you can
  leave extra ones in. Only `date` (or `week`) is required.
- `date` is `YYYY-MM-DD`.
- Rows of the same day keep the order they have in the file, and come after
  what that day already has.
- **Importing twice doesn't duplicate.** A row with an `id` (any text, such
  as the id it had in the old app) replaces what was imported with that id
  before. A row without one is known by its date, its place among that
  day's rows in the file, and its content, so the same file imported again
  changes nothing.
- A dry run reports how many rows of each kind would be added or replaced,
  and every problem with its line number, such as `food.csv:14: kcal "abc"
  is not a number`. Nothing is written when there is any problem.

## todos.csv

| column | |
|---|---|
| `date` | the day |
| `text` | the to-do or bullet |
| `depth` | how deep it's nested: 0 (the default) for a topic, 1 under the row above it with depth 0, and so on |
| `done` | `1`, `true`, `x` or `yes` when checked; empty or `0` otherwise |
| `note` | `1` for a bullet with no box to check |
| `id` | optional |

```csv
date,depth,text,done,note
2026-10-13,0,Moshi,0,0
2026-10-13,1,支持购买更多的slot → open to 5?,1,0
2026-10-13,1,"sales are down, why",0,0
2026-10-13,0,BTC still ok?,0,0
2026-10-13,1,a bullet with nothing to check off,0,1
```

## food.csv

An item eaten a row. Rows of the same day and `meal` are one meal.

| column | |
|---|---|
| `date` | the day |
| `meal` | `breakfast`, `lunch`, `dinner` or `snack` (or their names in Chinese, such as 早餐, 午饭, 晚餐, 加餐), or empty for food under no meal. Any other name is an error |
| `name` | what it was, such as `牛肉面` or `chicken breast` |
| `qty` | how much, written as you'd say it: `1碗`, `150g`, `2`, `1 cup` |
| `kcal` | calories, a whole number |
| `protein`, `carbs`, `fat`, `fiber` | grams |
| `id` | optional |

```csv
date,meal,qty,name,kcal,protein,carbs,fat,fiber
2026-10-13,breakfast,2,eggs,145,12,1,10,
2026-10-13,breakfast,1,latte,190,10,17,9,
2026-10-13,lunch,1碗,牛肉面,450,16,79,8,5
```

## training.csv

A row a line of the day's training. Either write the line the way Yoshi
reads it in `text`, or give its parts.

| column | |
|---|---|
| `date` | the day |
| `text` | a line as Yoshi reads it (below) |
| `exercise`, `kg`, `reps` | when there is no `text`: the exercise, the weight, and the reps of each set separated by spaces (`10 8 6 5`) |
| `minutes` | when there is no `text`: how long the session took |
| `id` | optional |

How Yoshi reads a line: the exercise's name and the reps of each set
(`引体向上 10 8 6 5`); a weight first (`3头 31.5 12x4`, four sets of 12 at
31.5 kg); a new weight where it changes (`28kg 15 15 32kg 12 12`); reps at a
weight (`20@40`). A line of numbers alone is more rounds of the exercise
above. `42m` is how long it took, and `rest` or `休息` marks a rest day.

```csv
date,text,exercise,kg,reps,minutes
2026-10-13,引体向上 10 8 6 5,,,,
2026-10-13,,triceps pushdown,31.5,12 12 12 12,
2026-10-13,,,,,42
2026-10-14,rest,,,,
```

## notes.csv

| column | |
|---|---|
| `week` | the week, `2026-W42`, or any date in it. Weeks start on Monday and count from the year's first Monday |
| `text` | the week's notes; line breaks are kept |

A week's notes from the import replace what the week had.

## Export

`yoshi export --format csv` writes these four files, with each row's `id`,
so an export can be edited and imported back.
