KosshiKosshi
AutomationBeta
Contents

This feature is in beta, and command names or results may change. Send feedback via Contact or the Forum.

CLI

Kosshi for macOS bundles a kosshi command-line tool for reading, searching, and editing rows from the terminal or shell scripts.

Its scope is currently focused on row operations; use AppleScript for window/pane control, file attachments, or full backups. Run kosshi help and kosshi help <command> for full command usage, flags, and exit codes.

Setup and help

The CLI lives inside Kosshi.app. Symlink it onto your PATH so you can run kosshi directly (for TestFlight Beta, use Kosshi Beta.app):

mkdir -p ~/.local/bin
ln -s /Applications/Kosshi.app/Contents/Helpers/kosshi ~/.local/bin/kosshi

# List commands, exit codes, and per-command usage
kosshi --version
kosshi help
kosshi help add

If kosshi is not found, add export PATH="$HOME/.local/bin:$PATH" to your shell config. macOS prompts for Automation permission on first use.

Output of kosshi help in Terminal

Output of kosshi help in Terminal

Create and edit a row

Start by adding a single row:

kosshi add "Buy milk"
# {"id":"ROW-ID"}

This adds "Buy milk" at the end of the outline and prints its row ID as one line of JSON.

Extract the returned ID with jq to add a child under a specific parent and update its note, completion status, or tags (jq is built in on macOS 15+; on macOS 14, use plutil -extract id raw -):

# Find or create a parent row, then add a child under it
PARENT_ID=$(kosshi ensure-path "Travel" | jq -r '.id')
ROW_ID=$(kosshi add "Book a hotel" --under "$PARENT_ID" | jq -r '.id')

# Update note, completion status, and tags, then read the row back
kosshi update "$ROW_ID" --note "Confirm check-in time" --completed
kosshi add-tag "$ROW_ID" --tag "@due" --value 2026-12-01
kosshi get "$ROW_ID"

All boolean flags are specified without a value, like --completed / --no-completed. In addition to UUIDs, you can also pass a row URL copied from the app (kosshi://row/...) in place of the row ID. Use --under, --at-beginning, --before, or --after with add to choose where a row is inserted. You can also search with find "hotel" and change structure with move, indent, outdent, or collapse. Every change can be undone with ⌘Z.

Output formats

Structured commands like add, get, find, update, and info return a single line of JSON to standard output. On the other hand, read-outline and export return the text in the specified format directly to standard output (read-outline --format json also returns a single line of JSON, not double-wrapped).

# Extract just the row text
kosshi get "$ROW_ID" | jq -r '.plainText'

# read-outline --format json returns one line of JSON directly
kosshi read-outline "$PARENT_ID" --depth 2 --format json | jq -r '.rows[].text'

On error, it outputs nothing to standard output and returns a single line of JSON containing code, kind, message, and retryable to standard error. You can use --no-interaction (or the environment variable KOSSHI_NO_INTERACTION=1) to skip the permission dialog during automatic execution, or specify --timeout <seconds> to change the response timeout.

See CLI use cases for common shell patterns.