> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trilo.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands Reference

> Complete reference for all Trilo CLI commands including tasks, pages, projects, events, messages, and workflows

## Global Flags

These flags work with any command:

| Flag               | Description                                          |
| ------------------ | ---------------------------------------------------- |
| `--json`           | Force JSON output (auto-enabled when piped)          |
| `--verbose`        | Print HTTP method, URL, status, and timing to stderr |
| `--workspace <id>` | Override default workspace for this command          |
| `--help`           | Show help for any command                            |
| `--version`        | Show CLI version                                     |

## Tasks

```bash theme={null}
# List tasks (with optional filters)
trilo tasks list [--project-id <id>] [--status <status>] [--assignee <id>] [--limit <n>]

# Get a specific task
trilo tasks get --id <task-id>

# Create a task
trilo tasks create --title "Bug: login fails on Safari" --project-id <id> \
  [--description "..."] [--status todo] [--priority high] [--assignee <member-id>]

# Update a task
trilo tasks update --id <task-id> [--title "..."] [--status done] [--priority low]
```

## Pages

```bash theme={null}
# List pages
trilo pages list [--project-id <id>]

# Get a specific page
trilo pages get --id <page-id>

# Create a page
trilo pages create --title "Sprint Retro Notes" --project-id <id>
```

## Projects

```bash theme={null}
# List all projects
trilo projects list

# Get a specific project
trilo projects get --id <project-id>
```

## Events

```bash theme={null}
# List events (with optional date range)
trilo events list [--start 2025-01-01T00:00:00Z] [--end 2025-01-31T23:59:59Z]

# Create an event
trilo events create --title "Team standup" \
  --start 2025-01-15T09:00:00Z --end 2025-01-15T09:30:00Z [--all-day]
```

## Members

```bash theme={null}
# List workspace members
trilo members list
```

## Messages

```bash theme={null}
# List messages in a project channel
trilo messages list --project-id <id> [--limit 20]

# Send a message to a project channel
trilo messages send --content "Deploy is live!" \
  --project-id <id> --sender-id <your-member-id>

# Send a direct message
trilo messages send-direct --content "Quick question..." \
  --conversation-id <id> --sender-id <your-member-id>
```

<Note>
  `--sender-id` is your workspace member ID. You can find it with `trilo members list`.
</Note>

## Workflows

```bash theme={null}
# Run a workflow
trilo workflows run --page-id <workflow-page-id>

# Check workflow run status
trilo workflows status --page-id <workflow-page-id>

# Continue a paused workflow (approve a review gate)
trilo workflows continue --page-id <id> --run-id <run-id>
```

## Shell Completions

Tab completion for all commands and flags:

```bash theme={null}
# Auto-detect your shell and install
trilo completions install

# Or output the script to stdout
trilo completions zsh
trilo completions bash
trilo completions fish
```

After installing, restart your shell or run `source ~/.zshrc` (for zsh).

## Scripting Examples

The CLI outputs JSON when piped, making it composable with `jq` and other tools:

```bash theme={null}
# Count tasks in a project
trilo tasks list --project-id <id> --json | jq '.data | length'

# Get titles of blocked tasks
trilo tasks list --status blocked --json | jq -r '.data[].title'

# Export projects as CSV
trilo projects list --json | jq -r '.data[] | [.name, .id] | @csv'

# Create a task and capture its ID
TASK_ID=$(trilo tasks create --title "From script" --project-id <id> \
  --json | jq -r '.data.id')
echo "Created task: $TASK_ID"
```
