# Read many projects

Name your projects in `at.toml`, then see, list and check them all from one `mt @name`.

You keep a backlog in every repo, and `mt` reads the one you’re standing in. That’s fine until you want to know where you left off across them all. Name your projects once, and a leading `@name` reads every one of them.

## Name your projects

`at.toml` sits in your [config directory](https://mlavrinenko.github.io/mindtape/config/index.md), next to `defaults.toml`:

```toml
# examples/across-projects/.config/mindtape/at.toml: a project and a set of projects
# One path: @shop stands for -w ~/projects/shop.
[at.shop]
include = ["~/projects/shop"]

# A glob: @work is a set of every project under ~/projects.
[at.work]
include = ["~/projects/*"]
```

`mt install` writes `at.schema.json` beside it. Start `at.toml` with a `#:schema ./at.schema.json` line, and an editor with tombi or Taplo completes its keys and checks their values as you type.

Each `[at.<name>]` entry takes these keys:

| Key | Default | Purpose |
| --- | --- | --- |
| `board` |  | This entry’s board, over `[board]` key by key. |
| `exclude` | `[]` | The same forms as `include`, whose matches leave the set. |
| `forks` |  | Whether a glob’s linked git worktrees join the set: `false`, the default, keeps them out, `true` lists them beside their main checkouts, and `"only"` lists them alone. |
| `include` | `[]` | Literal paths, one-level `*` globs, or `@name`s. |

A `*` matches inside one directory level, and a glob keeps only the directories that hold `.mindtape/`. An entry whose `include` is one literal path is a project, so `mt @shop ls` is `mt -w ~/projects/shop ls`. Any other entry is a set, even when it matches one project.

`mt at` lists the entries, and `mt at <name>` lists a set’s projects. Each project goes by its directory name:

```
$ mt at
@all → ~/projects/*
@forks → ~/projects/*
@shop → ~/projects/shop
@work → ~/projects/*
$ mt at work
@work holds 2 projects
blog  ~/projects/blog
shop  ~/projects/shop
```

A name with no entry finds the directory of that name in any `include`, so `mt @blog ls` works with no `[at.blog]`. Got two directories called `blog`? Each goes by the shortest path suffix that tells them apart, like `oss/blog`, and `mt @oss/blog ls` works too. A loop of `@name`s that include each other gets refused, and `mt` prints the loop.

## See every project at once

A bare `mt @work` runs [`mt board`](https://mlavrinenko.github.io/mindtape/cli/board/index.md) on the set, one row per project:

```
$ mt @work
PROJECT  OPEN  READY  BLOCKED  NEXT
shop        3      2        1  9n5 Fix the cart total rounding
blog        2      2        0  hp5 Write about the checkout launch

@work · 2 projects
```

Each cell runs under its project’s own config, so shop’s `todo` and blog’s `draft` both count as open. The columns ask `!terminal`, `ready` and `blocked`, never a status name. The [board page](https://mlavrinenko.github.io/mindtape/cli/board/index.md) covers the hidden rows and the `⚠` row of a project whose config won’t load.

Projects with the most ready tasks come first, and a project with nothing open drops off. For other columns or another order, override the board in `at.toml`, as [`mt board`](https://mlavrinenko.github.io/mindtape/cli/board/index.md) shows.

## List tasks across projects

`mt @work ls` and `mt @work find` print one table, with a `PROJECT` column first and the rows grouped by project in set order:

```
$ mt @work ls
PROJECT  SLUG#  STATUS        READY       PRIORITY   TITLE
blog     hp5    📝 draft      ▶ ready                Write about the checkout launch
blog     68e    👀 in-review  ▶ ready                Draft the release notes
shop     9n5    🔨 wip        ▶ ready     🔴 high    Fix the cart total rounding
shop     6f8    📋 todo       🔒 blocked  🔴 high    Send the order confirmation email
shop     4n1    📋 todo       ▶ ready     🟡 normal  Add a wishlist

5 of 7 tasks in 2 projects · default view
$ mt @work ls ready -n 1
PROJECT  SLUG#  STATUS    PRIORITY  TITLE
blog     hp5    📝 draft            Write about the checkout launch
shop     9n5    🔨 wip    🔴 high   Fix the cart total rounding

2 of 7 tasks in 2 projects · your filter
2 more not shown · next page: mt @work ls 'ready' -n 1 --skip 1
$ mt @work find email
PROJECT  SLUG#  STATUS   READY       PRIORITY  TITLE
shop     6f8    📋 todo  🔒 blocked  🔴 high   Send the order confirmation email

1 of 7 tasks in 2 projects · your filter
```

Each project brings its own default listing, sort and columns, and the table shows every column any of them shows. `--sort` sorts inside each project, and `-n` and `--skip` count per project, so `-n 1` gives you each project’s top task. `--format csv` adds a `project` column. A project that fails to list prints its error after the others, and `mt` exits 1. For a script, `--json` wraps the listings under `projects`, each with the [keys a set adds](https://mlavrinenko.github.io/mindtape/schema/index.md#many-projects).

## Check every project

`mt @work check` checks each project under its own rules, prints every problem with the project it belongs to, and ends with one line:

```
$ mt @work check
ok: 2 projects, 7 tasks
```

It exits 1 when any project fails, a config that won’t parse included, so a nightly job can watch all your repos at once. `--json` prints one object per project. `--commit-msg` and `--commits` check one repository’s commits, so they refuse a set.

## Write in one project

Only `ls`, `find`, `check` and `board` run on a set. Every other command, and every write, takes one project and refuses a set with exit code `1`:

```
$ mt @work add fix the coupon field
error: `add` runs on one project, and @work holds 2 projects
hint: name one project, as in mt @blog add
```

## Forks

A fork is a linked git worktree, the kind `git worktree add` makes. It holds a copy of its checkout’s tasks. A set leaves it out unless `forks` says otherwise:

```toml
# examples/across-projects/.config/mindtape/at.toml: forks beside their checkouts, and forks alone
# The same glob, with each checkout's linked git worktrees beside it.
[at.all]
include = ["~/projects/*"]
forks = true

# The linked git worktrees alone.
[at.forks]
include = ["~/projects/*"]
forks = "only"
```

`forks` filters only what a glob matches. A literal path or an `@name` in `include` joins as written. `mt at` marks each fork. A fork that `@work` leaves out still answers to its directory name:

```
$ mt at all
@all holds 3 projects
blog           ~/projects/blog
shop           ~/projects/shop
shop-wishlist  ~/projects/shop-wishlist  (fork)
$ mt at forks
@forks holds 1 project
shop-wishlist  ~/projects/shop-wishlist  (fork)
$ mt @shop-wishlist ls
SLUG#  STATUS   READY       PRIORITY   TITLE
9n5    🔨 wip   ▶ ready     🔴 high    Fix the cart total rounding
6f8    📋 todo  🔒 blocked  🔴 high    Send the order confirmation email
4n1    📋 todo  ▶ ready     🟡 normal  Add a wishlist

3 of 4 tasks · default view (!terminal)
```

`-w <path>` and `MINDTAPE_WORKTREE` always select one project, fork or not.
