Appearance
Creating Outline Paths
Outline paths are Bike's query language. Use them to match rows and compute values from your outline. They're an advanced feature; you don't need to understand them to use Bike.
Examples:
//pizza
/inbox//task
//task open()
//task @due <[d] today()
//@tags matches "\burgent\b"
//heading union //taskWhat is an outline path?
File paths locate files on your computer. Outline paths locate rows in your outline, and simple ones look just like file paths. Unlike file paths, they often match many rows, and they can work more like database queries.
Outline paths are similar to XPath
If you already know XPath, you're well on your way. Outline paths have a different syntax, but the underlying concepts are very similar.
Where are outline paths used?
- The filter bar uses outline paths to filter your outline.
- Editor styles use relative outline paths to select which rules apply.
- The sidebar index uses outline paths to select which rows it includes.
- The AppleScript
querycommand takes an outline path and returns the result. - The Shortcuts Query Rows action takes an outline path and returns matching rows.
- The extension API's
outline.query()method takes an outline path.
Outline Path Explorer
Use the Outline Path Explorer to try outline paths and learn how they work.
To open the Outline Path Explorer
- Open the outline you want to query.
- Choose Bike > Outline Path Explorer…
Type an outline path in the top field. The result shows beside the field, matching rows are highlighted in green, and matching text runs in darker green. The diagnostics area at the bottom shows how your path was understood.


The explorer shows each row's text and attributes. Above each row you'll see @id (when the row has a persistent id) and @type, plus any other attributes, such as @status on a checked off task. These are the attributes you can use in your outline paths.
Include View Attributes also shows the text attributes the editor adds for display, such as filter matches, so you can match them in editor styles.
Basic Paths
Unlike file paths, the default test is "contains text" instead of "equals file name".
/aSelect top level rows containing "a"
/a/bSelect "b" children of top level "a" rows
.aA relative path that selects the current row if it contains "a". You won't usually need relative paths, but paths must start with
/or.to match rows. Otherwise see "Value Expressions".
Path Expressions
Use union, except, and intersect to combine the results of multiple outline paths.
/a union /bTop level rows that contain "a" or "b"
/a except /bTop level "a" rows removing "b" rows
/a intersect /bTop level rows that contain "a" and "b"
(/a union /b) except /cTop level rows that contain "a" or "b", but not "c"
Path Steps
Paths are divided into steps. For example the path /a/b has two steps. Each step contains filtering logic, and you don't have to include every option in each step. These steps all behave the same:
/aSimple top level contains "a"
/* aMakes the row type test explicit.
*matches any row type./* @text contains "a"Also makes the predicate test explicit. See "Step Predicate" below.
Step Axes
By default each step passes the children of the matched rows to the next step, because "child" is the default axis. Other axes are also possible.
Say you want to search your entire outline for "pizza". With only the child axis, you'd need a longer path for each level of the outline:
/pizza/*/pizza/*/*/pizza
Instead, use the // descendant axis. It selects all descendants of the rows passed into the step:
//pizzaSelects all descendants of the outline root, then keeps the ones that contain "pizza".
Advanced step axes
Another useful axis is "parent". It uses the same .. syntax that file paths use to go to the parent folder.
//pizza/..boxFirst use the descendant axis to find "pizza". Then use the
..parent axis to select the parents of those rows, and keep the parents that contain "box". You've found the pizza boxes!
The above examples use the shortcut form of the descendant and parent axes. The general form is the axis name followed by ::. Some axes only have the general form:
ancestor::All ancestors of the rows passed into the step
ancestor-or-self::All rows passed into the step and their ancestors
parent::or shortcut..All parents of the rows passed into the step
self::or shortcut.All rows passed into the step
child::All children of the rows passed into the step
run::All text runs of the rows passed into the step. This axis filters text runs and their attributes, not rows. For example,
//*/run::@strongfinds all bold text in your outline.descendant::or shortcut//All descendants of the rows passed into the step
descendant-or-self::All rows passed into the step and their descendants
following-sibling::All siblings after the rows passed into the step
following::All rows (in outline order) after the rows passed into the step
preceding-sibling::All siblings before the rows passed into the step
preceding::All rows (in outline order) before the rows passed into the step
Step Type
Each step can include a row type test at the start.
//taskMatch all rows of type task
/heading//taskMatch all tasks contained by a top level heading.
//"task"Match all rows that contain the text "task". Put text in quotes when it conflicts with outline path syntax.
List of types
rowbodyheadingblockquotecodeblocknoteunorderedorderedtaskloghrrunMatches text runs, with therun::axis*Matches any type
Step Predicate
Each step can include a predicate test. Combine predicates with and, or, and not. Use @ to name the row attribute to test.
//@statusMatches rows that have a @status attribute.
//not @statusMatches rows that do not have a @status attribute.
//@text contains "get rich"Match rows that contain the text "get rich". This example uses the
containsrelation.//task "get rich" and open()Combine predicates. Find all unfinished tasks that will make you rich!
More on row attributes
Each row has attributes that you can test in outline path predicates. Some are built in, others are set by Bike's features, scripts, or extensions. For example, checking off a task sets its @status attribute to done.
The built in attributes are:
@text: the row's text@type: the row's type@id: the row's persistent id, when it has one
For a row's depth, use the level() function.
More on comparison relations
Use these relations in comparison predicates:
beginswithcontainsendswithmatches=!=<<=>>=
Use relation modifiers in brackets after the relation to change how it's evaluated. For example beginswith[s] is case sensitive instead of the default case insensitive. The modifiers are:
iCase insensitive (also ignores diacritics, default)sCase sensitive comparenNumeric compareBoth sides of the compare are converted to numbers before comparing. Shorthand for wrapping both sides in
number(side); see util functions.dDate compareCompares both sides as dates:
@due <[d] "2026-07-01". Shorthand for wrapping both sides indate(side); see date functions.
Match comparisons
The matches relation treats the right side as a regular expression:
//@text matches "\bsum\b": the whole word "sum"//@text matches "^Q[1-4]\b": starts with Q1, Q2, Q3, or Q4//@text matches "cats?": "cat" or "cats"//@tags matches "\burgent\b": matches item in a space-delimited list//@cities matches "(^|,)\s*New York\s*(,|$)": matches item in a comma-delimited list
Regex patterns use backslashes, so in an editor style write them with String.raw. See Paths in editor styles.
Step Slice
Each step produces an ordered list of matches. Use a slice to limit the step results by position. Positions count from 1, and negative positions count from the end.
//a[1]Match the first row that contains "a"
//a[-1]Match the last row that contains "a"
//a[2:]Match rows 2 through last that contain "a".
//a[2:-2]Match rows 2 through second to last that contain "a".
//a[2:4]Match the second, third, and fourth rows that contain "a".
Value Expressions
You have already seen value expressions such as a, "a", and @attribute. They each produce a value that your outline path can use. These are all the value expressions:
hello worldUnquoted text that evaluates to
hello world."hello world"Quoted text evaluating to
hello world. Quote text that would conflict with path syntax. Contents are literal (no backslash escaping), so"\bsum\b"is exactly those characters. A doubled""is one literal"("she said ""hi"""→she said "hi").@attributeThe value of the attribute named "attribute" for the current row (or current run when using the
run::axis). Outside a path step it's alwaysnull.functionName(params?)A function name followed by
()with optional params. See the Functions Reference.1or(1 + 1) / 2Math that evaluates to
1. Math operators (+,-,*,/) need a single space on each side, so/doesn't conflict with the path step separator. Math doesn't work on text:1 + "1"is invalid, and1 + @attributereturnsnanif the attribute isn't a number.true,false, ornullBoolean values, and no value.
If your outline path doesn't start with / or ., it's a value expression. For example, type 1 + 2 in the Outline Path Explorer. No rows match, but the result shows beside the field.
Paths in editor styles
An editor style path is also a JavaScript string, and JavaScript strips backslashes before Bike sees the path, so a plain "\b" becomes a backspace and a pattern like matches "\burgent\b" fails. Use String.raw so the path reads the same as in the filter bar:
js
row(String.raw`.@tags matches "\burgent\b"`, (_, row) => {
row.text.color = Color.systemRed()
})Or double each backslash for JavaScript's sake ("\\burgent\\b"), which collapses to \burgent\b by the time Bike parses it.
Functions Reference
Outline path functions give you:
- Easy and efficient access to outline structure.
- Access to editor state such as selection and folding.
- Date, math, and other utilities.
Outline Functions
These functions give easy and efficient access to outline structure.
You can sometimes get the same result with a more complex outline path. For example, instead of level() you could use count(ancestor::*), but expect level() to be faster.
parent() -> boolean
True if has children
level() -> number
Number of steps to root
leaf() -> boolean
True if has no children
root() -> boolean
True if the element is the outline's root.
first-child() -> boolean
True if is first child of parent
last-child() -> boolean
True if is last child of parent
nth-child(n) -> boolean
True if is the nth child of its parent, counting from 1.
first-of-type() -> boolean
True if is first of type in siblings
last-of-type() -> boolean
True if is last of type in siblings
nth-of-type(n) -> boolean
True if is the nth sibling of its type, counting from 1.
only-child() -> boolean
True if has no siblings
only-of-type() -> boolean
True if is only of type in siblings
open() -> boolean
True if the row's
@statusistodoorstarted, or absent (absent is todo).closed() -> boolean
True if the row's
@statusisdoneorcanceled.Prefer
open()andclosed()to naming the states yourself.not (@status = "done" or @status = "canceled")means the same thing today, but it will miss any states added later.start-of-matches(relative path expression) -> boolean
True if element matches relative path and previous sibling does not. Useful when styling attribute runs and you want to special case the first match in a sequence of matching runs. The preceding-sibling axis can do the same, but this function is shorter and faster.
end-of-matches(relative path expression) -> boolean
True if element matches relative path and next sibling does not. Useful when styling attribute runs and you want to special case the last match in a sequence of matching runs. The following-sibling axis can do the same, but this function is shorter and faster.
Editor Functions
These functions give access to editor state. They only work when your outline path is evaluated in an outline editor, usually in editor styles. For example, use focused-root() to style the focused root row differently from other rows.
focused-root() -> boolean
True if row is the focused root
focused-branch() -> boolean
True if row is in the focused branch
focused-level() -> number
Number of steps to focused root, or max value if not focused
expanded() -> boolean
True if row is expanded
collapsed() -> boolean
True if row is collapsed
filter-match() -> boolean
True if row is matched
filter-match-ancestor() -> boolean
True if row is ancestor of matched row
selection() -> caret|range|block|null
Returns row selection type
selection-ancestor() -> caret|range|block|null
Selection type if this row is ancestor of a selected row
selection-descendant() -> caret|range|block|null
Selection type if this row is descendant of selected row
selection-branch() -> block|null
blockif this unselected row will move with a block selection, because row commands include childrenselection-first() -> boolean
True if row is the first row of a block selection
selection-last() -> boolean
True if row is the last row of a block selection
selected-newline() -> upstream|downstream|null
Which side of a selected newline this row is on
drop-indicator() -> on|above|below|null
Drop indicator state for this row
summary(name) -> value
The named summary's value for this row's branch, such as a count or sum that an extension defines
Context Functions
last() -> number
Size of the evaluation context
position() -> number
Current position in evaluation context
Date Functions
A date is a number, so you compare dates with the normal relations and add or subtract with + and - (which need a single space on each side).
date(value) -> number
Interprets its argument as a date:
date("2026-07-01")for a literal,date(@due)for an attribute. Accepts a year (2026), year-month (2026-07), full date (2026-07-01), or full timestamp (2026-07-01T13:53:00Z). A bare date resolves to midnight in your local time zone; a timestamp keeps its own zone. The[d]modifier is shorthand for wrapping both sides of a compare indate().now() -> number
The current date and time.
today() -> number
The start of today, in local time.
The duration functions return a length of time to add or subtract. They're fixed lengths, so days(1) is always 24 hours, even across a daylight-saving change.
seconds(number) -> number
minutes(number) -> number
hours(number) -> number
days(number) -> number
weeks(number) -> number
duration(text) -> number
An ISO 8601 duration in seconds:
now() + duration("P3D").
The start-of functions return a calendar boundary, offset by a whole number of periods: 0 (the default) is the current period, 1 the next, -1 the previous. They're calendar aware, so start-of-month(1) is always the first of next month. The week starts on your calendar's first day of the week.
- start-of-day(offset?) -> number
- start-of-week(offset?) -> number
- start-of-month(offset?) -> number
- start-of-year(offset?) -> number
The component functions pull a single field out of a date, in local time. weekday is 1 (Sunday) through 7 (Saturday).
- year(date) -> number
- month(date) -> number
- day(date) -> number
- weekday(date) -> number
- hour(date) -> number
- minute(date) -> number
- second(date) -> number
The interval and repeat functions read ISO 8601 intervals (2026-07-01/P3D) and repeating intervals (R5/2026-07-01/P1W). Text that doesn't parse returns nan.
interval-start(text) -> number
interval-end(text) -> number
interval-duration(text) -> number
The interval's length in seconds.
repeat-count(text) -> number
How many times it repeats, or infinity when unbounded.
repeat-interval(text) -> number
The length of each repeat in seconds.
Some examples:
@due <[d] today()Rows due before the start of today.
@due <[d] today() + days(7)Rows due within the next seven days.
@due >=[d] start-of-week(0) and @due <[d] start-of-week(1)Rows due this week.
@due <[d] start-of-month(1)Rows due before next month starts.
@log-date >=[d] start-of-year(0)Log entries recorded this year. See Row Log.
month(@due) = 6Rows due in June, in any year.
weekday(@due) = 1 or weekday(@due) = 7Rows due on a weekend.
date(@due) < now() - weeks(1)Same idea using
date()instead of the[d]shorthand.
Util Functions
floor(number) -> number
ceil(number) -> number
round(number) -> number
count(expression) -> number
boolean(expression) -> boolean
number(value) -> number
Interprets its argument as a number (non-numbers become
nan). This is the function twin of the[n]modifier:x OP[n] yis the same asnumber(x) OP number(y).