Skip to content
flow

Configuration.flowspace.json

.flowspace.json

Every key a .flowspace.json file supports (workspace profiles, run commands, docs, providers, reviewers, quick links, code search, settings) with examples.

View as Markdown
On this page

A .flowspace.json file describes how Flow works in a repository: saved layouts for new sessions, commands and docs for the New tab launcher, reviewers and quick links for pull requests, external code search, and per-repository setting values. Every key is optional. Check the file into a repository to share it with your team, or keep your own copy outside the repository.

Where the file can live

Flow reads every flowspace file that applies to a session's directory, in this order:

OrderFileScope
1DIR/.flowspace.json, when the session is in a subdirectory of its checkoutDirectory
2~/.flow/repo_config/REPO/flowspace.json (your own file for this repository, shared by its worktrees)User repo
3WORKTREE_TOP/.flowspace.jsonRepo
4PRIMARY_CHECKOUT/.flowspace.json, when it differs from the worktree topRepo
5~/.flow/flowspace.json (your global file)User

List keys merge across the files: entries add up and, when two files use the same name or label, the earlier file in this order wins. A file that lists a key in its top-level "!important" array moves to the front for that key. See Settings scopes for the full rules.

A missing or corrupt file, or a malformed entry, is skipped; it never stops Flow. Flow still reads a .pwrspace.json (the file's old name) when no .flowspace.json sits beside it, but always writes the new name.

Keys at a glance

KeyTypeUsed by
profilesarray of profilesthe New session flow's Layout step; Save as workspace
runarray of {label, command, cwd?, detail?}the New tab launcher's Run column
docsarray of {label, url}the New tab launcher's Web column
run_providersarray of {name, command}more Run entries, printed by a command
reviewersobject {groups, starred, ignored}a PR review tab's reviewer picker
quick_linksobject {links, patterns}a PR review tab's Quick links
code_searchobject {url, by_lang, docs}go to definition when nothing is found on disk
settingsobject of setting key → valueper-repository setting values
!importantarray of key namesraises this file's value for those keys

Any other top-level key is kept as it is when Flow saves a profile into the file.

A complete example

json
{
  "profiles": [
    {
      "name": "dev",
      "description": "Agent on the left, server and tests on the right",
      "layout": {
        "split": "row",
        "ratio": 0.6,
        "a": { "tabs": [{ "command": "claude" }] },
        "b": {
          "split": "column",
          "ratio": 0.5,
          "a": { "tabs": [{ "command": "npm run dev" }] },
          "b": { "tabs": [{}, { "command": "npm test -- --watch" }], "active": 1 }
        }
      }
    }
  ],
  "run": [
    { "label": "Dev server", "command": "npm run dev", "cwd": "web", "detail": "port 3000" },
    { "label": "Tests", "command": "cargo test" }
  ],
  "docs": [{ "label": "API docs", "url": "https://docs.example.com" }],
  "run_providers": [{ "name": "just", "command": "~/bin/just-flow" }],
  "reviewers": {
    "groups": [{ "name": "backend", "members": ["alice", "org/backend/{robin:1}"], "auto_merge": true }],
    "starred": ["alice"],
    "ignored": ["dependabot"]
  },
  "quick_links": {
    "links": [{ "label": "Deploy", "url": "https://deploy.example.com/{owner}/{repo}/{branch}" }],
    "patterns": [{ "label": "Ticket {1}", "match": "\\b(ABC-\\d+)\\b", "url": "https://jira.example.com/browse/{1}" }]
  },
  "code_search": {
    "url": "https://sourcegraph.example.com/search?q={symbol}",
    "by_lang": { "java": "https://opengrok.example.com/source/search?defs={symbol}" }
  },
  "settings": { "git.merge_method": "squash" },
  "!important": ["run"]
}

profiles

A profile is a saved group layout: a split tree of tiles, each tile's tabs, and what each tab runs. Profiles are offered when you start a new session (the New session flow's Layout step, ⇧⌘N), and flow-cli new-session DIR --layout NAME opens one by name.

FieldTypeMeaning
namestring, requiredThe profile's name. Saving a profile with an existing name replaces it. When two files define the same name, the earlier file wins.
descriptionstringShown in the picker.
layoutnode, requiredThe root of the layout tree.

A node is either a split or a leaf:

NodeFields
Splitsplit: "row" (children side by side, a on the left) or "column" (stacked, a on top); ratio: the share of space given to a, 0.0–1.0; a and b: child nodes
Leaftabs: an array of tabs; active: the index of the active tab (default 0)

A tab is an object:

FieldMeaning
(none){} is a plain terminal running your shell.
commandA command to run in the terminal tab.
kind"terminal" (the default) or "webview".
urlThe page a webview tab loads.
url_commandA shell command run at launch in the session's directory; the first non-empty line it prints becomes the webview's URL. url is the fallback, and the page shown while the command runs.

Webview tabs need the Web tabs experiment (features.web_tabs). While it is off, a profile's webview tabs are skipped; a webview tab with neither a usable url nor a url_command opens as a terminal.

To save the current session's layout, run Save as workspace (⇧⌘S): give the profile a name and an optional description, then pick which flowspace file to save it to.

run, docs and run_providers

These three keys fill the New tab launcher, which opens on a tile strip's "+" or ⌘T while Settings › General › Tabs › New tab is Ask.

KeyEntry fieldsMeaning
runlabel, command, optional cwd, optional detailA command that opens in a new terminal tab titled by its label. A relative cwd is relative to the directory of the file that names it (for your repo_config file: the worktree top); a leading ~/ is your home directory; absent means the session's directory. detail is shown instead of the command.
docslabel, urlA page in the launcher's Web column. The Web column only appears while the Web tabs experiment is on.
run_providersname, commandA command that prints more Run entries as JSON each time the launcher opens.

⌥1–⌥9 launch the first nine visible Run rows. Run providers have their own contract: see Run providers.

reviewers

Reviewer groups and preferences for the PR review tab's Request picker.

FieldTypeMeaning
groupsarray of {name, members, auto_merge?}Named reviewer groups. "auto_merge": true also enables auto-merge on the PR when you request that group.
starredarray of loginsShown in their own section of the picker.
ignoredarray of logins or teamsNever suggested or requested.

A member is one of:

MemberMeans
loginthat user (a leading @ is dropped)
org/teamthe team itself
org/team/*each member of the team
org/team/{random:N}N members, picked at random
org/team/{robin:N}the N members requested least recently in this repository

Groups from several files merge by name (compared case-insensitively), the earliest file winning; starred and ignored are the union of every file. The picker's Save as group… writes a group into a flowspace file.

Links shown in a PR review tab's meta column.

FieldEntry fields
linkslabel, url, optional repos
patternslabel, match (a regular expression), optional url (default {0}), optional in (["body"] by default; add "comments" for comments and reviews), optional repos

A pattern turns every match in the PR's text into a link (at most a fixed number per pattern). repos limits an entry to repositories matching owner/name globs (* matches any run of characters).

Tokens you can use in a label or URL:

TokenValue
{host}, {owner}, {repo}, {slug}the PR's host, owner, repository name and owner/name
{number}, {branch}, {base}, {author}, {sha}, {title}the PR's number, head branch, base branch, author login, head commit and title
{codeowners}the owners of the changed files, from .github/CODEOWNERS, CODEOWNERS or docs/CODEOWNERS
{0}, {1}, …a pattern's whole match and its capture groups

In a URL each token is percent-encoded. A link whose URL uses a token that resolves to nothing, or that is not http:// or https://, is dropped. Links from every file are concatenated, then deduplicated by URL.

Where go to definition and find references search when a symbol is not found on disk.

FieldTypeMeaning
urlstringA search URL template for every language without its own.
by_langobjectPer-language search templates. Keys: rust, python, java, jsts, shell, c, cpp.
docsobjectPer-language docs templates, same keys, with {symbol} and {version}.

Templates take {symbol}, {text}, {lang}, {module}, {package}, {path}, {repo} and {query}. The earliest file wins url and each per-language key; Settings › Code fills in what the files leave out. See Code navigation for what each placeholder holds.

settings

A settings object holds setting values for this repository, using the same keys as ~/.flow/settings.json. Only keys with a scope rule are read, and each only in the scopes its rule honours:

  • In a checked-in .flowspace.json (Repo scope), Flow reads git.merge_method (squash, merge or rebase) and pr.diff_groups (the PR review tab's diff groups). Every other key there is ignored, so a team file can't pick your agent or run commands in your sessions.
  • In your own ~/.flow/repo_config/REPO/flowspace.json (User repo scope), every key in the scoped settings table is read, including session.primary_command, tabs.new_tab and the snooze.* keys.

!important

"!important": ["run", "worktreeDir"] lifts this file's value for the listed keys above every non-important value, whatever the order. A mark in a scope the key does not honour is ignored. See Settings scopes.

Limits

  • Sessions on remote hosts read only ~/.flow/flowspace.json and run no providers.
  • A session on a paired device lists only the run entries of that device's checkout (at most 64), plus your own ~/.flow/flowspace.json; it never reads that device's docs or run_providers.
  • Flow re-reads the files when it needs them (opening a launcher, fetching a PR), so an edit applies the next time, without a restart.
Sources

Written from these files in the Flow app repo

  • src/flowspace.rs
  • src/workspace.rs
  • src/run_config.rs
  • src/new_tab.rs
  • src/reviewers.rs
  • src/pr_links.rs
  • src/pr_diff_groups.rs
  • src/repo_config.rs
  • src/scope.rs
  • src/save_ui.rs
  • docs/run-providers.md
  • docs/code-navigation.md
  • docs/settings-scopes.md