Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Facets-cloud/flow
/ functions
Functions
972 in github.com/Facets-cloud/flow
⨍
Functions
972
◇
Types & classes
69
↓ 186 callers
Function
setupFlowRoot
setupFlowRoot sets up a tempdir FLOW_ROOT and runs cmdInit to create the DB + tree. Returns the root path. Uses the init-test helper `initTempFlowRoot
internal/app/add_test.go:15
↓ 147 callers
Function
openFlowDB
(t *testing.T)
internal/app/add_test.go:24
↓ 102 callers
Function
NowISO
---------- lifecycle ---------- NowISO returns the current time formatted as RFC3339.
internal/flowdb/db.go:213
↓ 89 callers
Method
Error
()
internal/app/owner_tick_test.go:823
↓ 79 callers
Function
captureStdout
captureStdout redirects os.Stdout and os.Stderr during f and returns combined output.
internal/app/show_test.go:50
↓ 76 callers
Function
insertTask
(t *testing.T, db *sql.DB, slug, name, status, priority, wd string, project any)
internal/app/testhelpers_test.go:33
↓ 76 callers
Function
seedTask
seedTask creates a minimal task row (floating, workspace work_dir).
internal/app/do_test.go:79
↓ 75 callers
Function
cmdAdd
cmdAdd dispatches `flow add project|task|playbook ...`.
internal/app/add.go:28
↓ 72 callers
Function
GetTask
(db *sql.DB, slug string)
internal/flowdb/db.go:747
↓ 68 callers
Method
String
()
internal/app/update.go:321
↓ 62 callers
Function
showListEditDB
showListEditDB is the test harness used by cmd_show, cmd_list, and cmd_edit tests. It sets FLOW_ROOT, creates projects/ and tasks/ subtrees, opens flo
internal/app/show_test.go:32
↓ 58 callers
Function
cmdList
cmdList dispatches `flow list tasks|projects|playbooks|runs|tags|owners`.
internal/app/list.go:59
↓ 56 callers
Function
cmdDo
cmdDo flips a task to in-progress, bootstraps a Claude session if needed (race-free via atomic UPDATE ... WHERE session_id IS ?), and spawns an iTerm
internal/app/do.go:96
↓ 55 callers
Function
OpenDB
OpenDB opens (or creates) the SQLite database at path, ensures the schema is present, and runs idempotent migrations. The connection is opened with b
internal/flowdb/db.go:234
↓ 50 callers
Function
CreateOwner
CreateOwner inserts a new owner. Status defaults to 'active' and timestamps are stamped if unset. NextWakeAt is left as-is (NULL until the owner is st
internal/flowdb/owners.go:63
↓ 48 callers
Function
stubITerm
stubITerm replaces iterm.Runner with a counter + captured-script recorder. Returns the counter pointer and a function that reads the most recent Apple
internal/app/do_test.go:48
↓ 44 callers
Function
cmdUpdate
cmdUpdate dispatches `flow update task|project`. The command is the canonical lane for in-place field edits — including legacy field setters (priority
internal/app/update.go:17
↓ 38 callers
Function
GetOwner
(db *sql.DB, slug string)
internal/flowdb/owners.go:85
↓ 37 callers
Function
flagSet
flagSet creates a named flag.FlagSet that prints errors instead of exiting.
internal/app/helpers.go:12
↓ 35 callers
Function
cmdOwner
cmdOwner dispatches `flow owner list|show|start|pause`.
internal/app/owner.go:30
↓ 35 callers
Function
cmdShow
cmdShow dispatches `flow show task|project|playbook|owner`. Per spec §5.4.
internal/app/show.go:16
↓ 35 callers
Function
flowDBPath
flowDBPath returns the absolute path to flow.db under the flow root. Returns a clear error if the data directory hasn't been initialized.
internal/app/init.go:27
↓ 28 callers
Method
Name
Identity --------------------------------------------------------- Name returns the canonical short id (stored on tasks.harness).
internal/harness/harness.go:122
↓ 24 callers
Function
flowRoot
flowRoot returns the root directory for flow state. Honors $FLOW_ROOT if set, otherwise falls back to ~/.flow. The returned path is not guaranteed to
internal/app/init.go:14
↓ 23 callers
Function
New
New returns a fresh claude harness. The struct is stateless; we expose it through the harness.Harness interface.
internal/harness/claude/claude.go:47
↓ 23 callers
Method
Wrap
Wrap returns text decorated with the given ANSI code. When color is disabled or code is empty, the input is returned unchanged.
internal/listfmt/listfmt.go:112
↓ 23 callers
Function
cmdSkill
cmdSkill dispatches `flow skill install|uninstall|update`.
internal/app/skill.go:97
↓ 20 callers
Function
insertProject
(t *testing.T, db *sql.DB, slug, name, wd, priority string)
internal/app/testhelpers_test.go:23
↓ 19 callers
Function
openTempDB
(t *testing.T)
internal/flowdb/db_test.go:10
↓ 18 callers
Function
UpsertPlaybook
UpsertPlaybook inserts a new playbook or updates an existing row by slug. Updates touch name, project_slug, work_dir, updated_at; archived_at is not t
internal/flowdb/db.go:1083
↓ 16 callers
Function
cmdRun
cmdRun handles `flow run <subcommand>`. Currently only `run playbook <slug>` is supported.
internal/app/run.go:16
↓ 16 callers
Function
setupArchiveTestEnv
setupArchiveTestEnv creates a tempdir, sets FLOW_ROOT, initializes flow.db, and returns the opened handle. The db handle is closed on cleanup. We inte
internal/app/archive_test.go:16
↓ 16 callers
Function
withTempHome
withTempHome redirects $HOME to a tempdir for the duration of the test.
internal/app/skill_test.go:62
↓ 15 callers
Function
cmdInit
cmdInit creates ~/.flow/ (or $FLOW_ROOT), initializes flow.db, installs the skill. Idempotent — re-running is safe.
internal/app/init.go:41
↓ 15 callers
Function
columnExists
(db *sql.DB, table, column string)
internal/flowdb/db.go:657
↓ 15 callers
Function
stubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/kitty/kitty_test.go:155
↓ 14 callers
Function
captureShowStdout
(t *testing.T, fn func())
internal/app/show_test.go:662
↓ 14 callers
Function
cmdWorkdir
cmdWorkdir dispatches `flow workdir list|add|remove|scan`.
internal/app/workdir.go:18
↓ 13 callers
Function
GetProject
(db *sql.DB, slug string)
internal/flowdb/db.go:691
↓ 13 callers
Function
cmdDone
cmdDone marks a task done. Per spec §5.3 this is a single UPDATE that does NOT touch the iTerm tab, kill the Claude session, or clear session_id — the
internal/app/done.go:28
↓ 13 callers
Function
fakeSessionID
fakeSessionID makes a deterministic v4-shaped UUID derived from slug. Used by insertTask to satisfy the session-id invariant on non-backlog rows witho
internal/app/testhelpers_test.go:59
↓ 12 callers
Function
SpawnTab
SpawnTab opens a new Warp tab in cwd via the warp:// URI, then injects `command` (with envVars set, title set, and cwd entered) by keystroking the pat
internal/warp/warp.go:99
↓ 12 callers
Function
cmdArchive
cmdArchive sets archived_at = now() on the matching row.
internal/app/archive.go:10
↓ 11 callers
Function
FocusSession
FocusSession tries to focus the kitty window currently running `binary` with the given session UUID. The `binary` arg is the harness's executable name
internal/kitty/kitty.go:124
↓ 11 callers
Method
SessionIDEnvVar
SessionIDEnvVar returns the env var the harness exports inside each running session so flow can reverse-lookup the bound task (e.g. "CLAUDE_CODE_SESSI
internal/harness/harness.go:133
↓ 11 callers
Function
cmdEdit
cmdEdit opens a brief.md in $EDITOR for either a task or a project. Per spec §5.5. Bumps updated_at after a clean editor exit.
internal/app/edit.go:15
↓ 11 callers
Function
hexColor
hexColor parses "#RRGGBB" into an opaque color.
internal/app/card_png.go:280
↓ 11 callers
Function
newWarpStubs
(t *testing.T)
internal/warp/warp_test.go:25
↓ 11 callers
Function
reopenArchiveTestDB
(t *testing.T, root string)
internal/app/archive_test.go:32
↓ 10 callers
Function
EncodeCwd
---------- transcript ---------- RenderTranscript and the jsonl decoder it uses live in transcript.go in this package. EncodeCwd encodes an absolute
internal/harness/claude/claude.go:265
↓ 10 callers
Function
FocusSession
FocusSession tries to focus the zellij pane currently running `binary` with the given session UUID. The `binary` arg is the harness's executable name
internal/zellij/zellij.go:104
↓ 10 callers
Function
FocusSession
FocusSession tries to focus the iTerm2 session whose underlying process is `binary` running with `--session-id <sessionID>` or `--resume <sessionID>`
internal/iterm/iterm.go:100
↓ 10 callers
Function
GetWorkdir
(db *sql.DB, path string)
internal/flowdb/db.go:845
↓ 10 callers
Function
mustWriteAux
(t *testing.T, path, content string)
internal/app/aux_test.go:69
↓ 9 callers
Function
AddTaskTag
AddTaskTag attaches a tag to a task. Idempotent: re-adding an existing (task_slug, tag) pair is a no-op via INSERT OR IGNORE.
internal/flowdb/db.go:964
↓ 9 callers
Function
DefaultConstants
DefaultConstants are the shipped defaults.
internal/stats/model.go:18
↓ 9 callers
Function
Detect
Detect returns the backend that SpawnTab will use for the current process environment. Exposed so callers (and tests) can inspect the choice without s
internal/spawner/spawner.go:73
↓ 9 callers
Function
ListTasks
(db *sql.DB, filter TaskFilter)
internal/flowdb/db.go:765
↓ 9 callers
Function
allHarnesses
allHarnesses returns every implemented harness adapter. The slice is the registry that ambient-harness detection and harnessByName consult. Adding cod
internal/app/harness.go:17
↓ 9 callers
Function
bgAgentsJSON
bgAgentsJSON builds a `claude agents --json` array of LIVE entries (pid set) — one per session id (short id = first 8 chars).
internal/app/background_test.go:46
↓ 8 callers
Function
ResolvePlaybook
ResolvePlaybook resolves a ref to exactly one playbook by slug. includeArchived controls whether archived rows are eligible.
internal/app/resolve.go:58
↓ 8 callers
Function
Slugify
Slugify converts a free-form name into a URL-safe slug. It lowercases, replaces runs of non-alphanumeric chars with dashes, strips leading/trailing da
internal/app/slug.go:20
↓ 8 callers
Function
SpawnTab
SpawnTab opens a tab in the auto-detected backend. The contract matches every backend's SpawnTab.
internal/spawner/spawner.go:106
↓ 8 callers
Method
Total
Total is all tokens flow-managed sessions actually processed.
internal/stats/scan.go:39
↓ 8 callers
Function
UpsertWorkdir
(db *sql.DB, path, name, description, gitRemote string)
internal/flowdb/db.go:868
↓ 8 callers
Function
contains
---- tiny helpers ----
internal/harness/claude/background_test.go:270
↓ 8 callers
Function
initTempFlowRoot
initTempFlowRoot points FLOW_ROOT at a tempdir AND redirects $HOME so skill install lands inside the tempdir as well. Isolates every init test from th
internal/app/init_test.go:15
↓ 8 callers
Function
stubClaudeRunner
(t *testing.T, retErr error)
internal/app/done_test.go:19
↓ 8 callers
Function
stubPS
(t *testing.T, out string, retErr error)
internal/iterm/iterm_test.go:202
↓ 8 callers
Function
stubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/zellij/zellij_test.go:312
↓ 8 callers
Function
withFakeHTTP
withFakeHTTP swaps httpGetForVersion for the duration of the test.
internal/app/release_test.go:24
↓ 7 callers
Function
ColorEnabled
ColorEnabled reports whether ANSI color codes should be emitted to w. Color is disabled when forceOff is true, when the NO_COLOR env var is set (per h
internal/listfmt/listfmt.go:91
↓ 7 callers
Function
DueOwners
DueOwners returns active, non-archived owners whose next_wake_at is set and at or before nowISO — i.e. the owners the scheduler should tick now. Pause
internal/flowdb/owners.go:232
↓ 7 callers
Function
FocusSession
FocusSession tries to focus the Terminal.app tab whose underlying process is `binary` running with `--session-id <sessionID>` or `--resume <sessionID>
internal/terminal/terminal.go:181
↓ 7 callers
Function
GetPlaybook
(db *sql.DB, slug string)
internal/flowdb/db.go:917
↓ 7 callers
Function
GetTaskTags
GetTaskTags returns the tags on a single task, sorted alphabetically.
internal/flowdb/db.go:1003
↓ 7 callers
Function
LoadCache
LoadCache reads a cache file. A missing or corrupt file yields an empty (usable) cache — never an error. Stats must never fail on a bad cache.
internal/stats/cache.go:22
↓ 7 callers
Method
Render
Render writes the table to w. Trailing whitespace is trimmed from every emitted line so an empty last cell doesn't litter output with spaces.
internal/listfmt/listfmt.go:132
↓ 7 callers
Function
RenderTSV
RenderTSV emits a tab-separated values stream with a header row.
internal/listfmt/listfmt.go:194
↓ 7 callers
Function
ResolveTask
---------- exact-match resolvers ---------- All ref resolution is exact match on slug (case-insensitive). ResolveTask resolves a ref to exactly one t
internal/app/resolve.go:17
↓ 7 callers
Function
cmdDoHere
cmdDoHere is the `--here` branch of `flow do`. Instead of spawning a new tab with a fresh Claude session, it binds the CURRENT Claude session (discove
internal/app/do.go:870
↓ 7 callers
Function
cmdOwnerTick
cmdOwnerTick is the hidden `flow __owner-tick <slug>` supervisor that runs inside the detached process: build the tick prompt, run the owner's harness
internal/app/owner_tick.go:281
↓ 7 callers
Function
defaultHarness
defaultHarness returns the adapter for code paths that have no task context (e.g. `flow init`, `flow skill install`, the SessionStart hook handler bef
internal/app/harness.go:130
↓ 7 callers
Function
harnessForTask
harnessForTask returns the adapter for the task's stored harness. NULL/empty harness column → claude+nil (back-compat). Unknown non-empty name → nil+e
internal/app/harness.go:70
↓ 7 callers
Function
humanCompact
humanCompact formats large numbers with B/M/K suffix for compact display. ≥1B → "X.XXB"; ≥1M → "X.XXM"; ≥1K → "XK" or "X.XK"; else plain integer.
internal/app/stats.go:187
↓ 7 callers
Function
newFace
(f *truetype.Font, size float64)
internal/app/card_png.go:85
↓ 7 callers
Function
seedTaskAtCwd
seedTaskAtCwd creates a task with work_dir set to the test process's current cwd. Used by --here tests that want to satisfy the cwd-mismatch invariant
internal/app/do_test.go:89
↓ 7 callers
Function
stubBG
stubBG installs a BGCommandRunner that dispatches on args[0]: spawn / resume calls get the banner (and are recorded), `agents` calls get the JSON. Ret
internal/harness/claude/background_test.go:119
↓ 7 callers
Function
stubBGCommand
stubBGCommand swaps claude.BGCommandRunner with a recorder that dispatches on args: `agents` returns *agentsJSON (mutable so a test can change registr
internal/app/background_test.go:103
↓ 7 callers
Function
stubBGMode
stubBGMode forces spawner.IsBackground() true for the test.
internal/app/background_test.go:79
↓ 7 callers
Function
stubClaudeStatOK
stubClaudeStatOK makes claude.ValidateSession succeed for every (workDir, sessionID) pair, for tests that don't materialize fake jsonl files under a t
internal/app/do_test.go:104
↓ 7 callers
Function
stubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/iterm/iterm_test.go:211
↓ 7 callers
Function
withFlowRoot
withFlowRoot points $FLOW_ROOT at a tempdir so version-cache writes don't touch the developer's real ~/.flow.
internal/app/release_test.go:33
↓ 6 callers
Function
IsBackground
IsBackground reports whether flow should spawn this session as a terminal-free background agent ($FLOW_TERM=bg) rather than opening a terminal tab. bg
internal/spawner/spawner.go:63
↓ 6 callers
Function
LatestRelease
LatestRelease returns the latest tagged version of flow on GitHub as a tag string (e.g. "v0.1.0-alpha.3"), or "" if the lookup cannot be completed (of
internal/app/release.go:53
↓ 6 callers
Function
ListOwners
ListOwners returns owners matching filter, sorted by slug. Archived owners are excluded unless IncludeArchived is set.
internal/flowdb/owners.go:275
↓ 6 callers
Method
LiveSessionIDs
Live-session detection ------------------------------------------- LiveSessionIDs returns the count of running processes per session id. Used both for
internal/harness/harness.go:217
↓ 6 callers
Function
NormalizeTag
---------- task tag queries ---------- NormalizeTag canonicalizes a tag for storage and comparison: trim whitespace, lowercase. Returns "" for input t
internal/flowdb/db.go:958
↓ 6 callers
Function
ParseFormat
ParseFormat converts a user-supplied string into a Format. Empty string and "table" both yield FormatTable; "json" and "tsv" are the other accepted va
internal/listfmt/listfmt.go:63
↓ 6 callers
Function
ResolveProject
ResolveProject resolves a ref to exactly one project by slug.
internal/app/resolve.go:37
next →
1–100 of 972, ranked by callers