things3

package module
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

README

things3

Go CI codecov Go Reference Go Report Card License

Go library and CLI for Things 3 on macOS. Read tasks from the Things 3 SQLite database, create and update items via Things URL Scheme, and query your task list from the terminal.

Features

  • Unified client - Single NewClient() entry point for all operations
  • Database queries - Read-only access to the Things 3 SQLite database with fluent query builder and type-safe filters
  • URL Scheme - Create todos, projects, and batch operations; update existing items with automatic authentication token management
  • CLI - Query tasks, projects, areas, and tags from the terminal with JSON/YAML output
  • Interface-based API - All public methods return interfaces for clean, testable code

CLI

A command-line tool for querying your Things 3 tasks from the terminal.

Installation

Homebrew (recommended):

brew install moond4rk/tap/things3

Go:

go install github.com/moond4rk/things3/cmd/things3@latest

Note: Requires CGO enabled (uses go-sqlite3). macOS only.

Manual: Download pre-built binaries from GitHub Releases. If macOS shows "Apple could not verify", remove the quarantine attribute:

xattr -d com.apple.quarantine /path/to/things3
Commands
things3 list <view>            # List tasks from a view
things3 search <query>         # Search tasks by title
things3 search --uuid <prefix> # Search tasks by UUID prefix
things3 version                # Print version information

Available views: inbox, today, upcoming, anytime, someday, logbook, deadlines, projects, areas, tags

Global Flags
Flag Short Description
--json -j Output as JSON
--yaml -y Output as YAML
--limit -n Max items to display (0 for unlimited)

The logbook view also supports --days (-d) to limit results to recent N days (default: 30, 0 for all).

Examples
things3 list today              # Today's tasks
things3 list inbox --json       # Inbox as JSON
things3 list logbook --days 7   # Recent 7 days
things3 search meeting          # Search by title
things3 search --uuid 4fthuhgF  # Search by UUID prefix
things3 list areas --yaml       # Areas as YAML
things3 list projects -n 5      # First 5 projects
Output Formats

Default (table):

STATUS   UUID      TYPE     TITLE
[x]      4fthuhgF  project  Task title | 2024-01-15 | #tag1 #tag2
[ ]      WZR4hDw5  todo     Another task | due:2024-02-01
[-]      gjUph7Jz  todo     Canceled task | 2024-01-10

Status indicators: [ ] incomplete, [x] completed, [-] canceled.

JSON (--json): Full task objects as a JSON array.

YAML (--yaml): Full task objects in YAML format.

Library

Installation
go get github.com/moond4rk/things3

Note: Requires CGO enabled (uses go-sqlite3). macOS only.

Quick Start
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/moond4rk/things3"
)

func main() {
    client, err := things3.NewClient()
    if err != nil {
        log.Fatal(err)
    }
    defer client.Close()

    ctx := context.Background()

    // Get today's tasks
    today, _ := client.Today(ctx)
    for _, task := range today {
        fmt.Printf("- %s\n", task.Title)
    }

    // Create a new todo
    client.AddTodo().
        Title("Buy groceries").
        Notes("Milk, eggs, bread").
        When(things3.Today()).
        Execute(ctx)
}
API Overview
Query Operations
Convenience Methods
client.Inbox(ctx)                      // Tasks in Inbox
client.Today(ctx)                      // Today's tasks
client.Upcoming(ctx)                   // Scheduled future tasks
client.Anytime(ctx)                    // Anytime tasks
client.Someday(ctx)                    // Someday tasks
client.Logbook(ctx)                    // Completed/canceled tasks
client.Trash(ctx)                      // Trashed tasks
client.Todos(ctx)                      // All incomplete to-dos
client.Projects(ctx)                   // All incomplete projects
client.Deadlines(ctx)                  // Tasks with deadlines
client.Search(ctx, "query")            // Search tasks
client.CreatedWithin(ctx, DaysAgo(7))  // Tasks from last 7 days
Fluent Query Builder
// Type-safe status filtering
tasks, _ := client.Tasks().
    Type().Todo().
    Status().Incomplete().
    All(ctx)

// Date filtering
tasks, _ := client.Tasks().
    StartDate().Future().
    Deadline().OnOrBefore(time.Now().AddDate(0, 0, 7)).
    All(ctx)

// Filter by area, project, or tag
tasks, _ := client.Tasks().
    InArea("area-uuid").
    InTag("work").
    All(ctx)

// Get single task or count
task, _ := client.Tasks().WithUUID("task-uuid").First(ctx)
count, _ := client.Tasks().Status().Completed().Count(ctx)
Areas and Tags
// Get all areas with their tasks
areas, _ := client.Areas().IncludeItems(true).All(ctx)

// Get all tags
tags, _ := client.Tags().All(ctx)
Add Operations
Create Todo
client.AddTodo().
    Title("Task title").
    Notes("Task notes").
    When(things3.Today()).              // today's date
    Deadline(time.Date(2024, 12, 31, 0, 0, 0, 0, time.Local)).
    Tags("work", "urgent").
    ChecklistItems("Step 1", "Step 2").
    List("Project Name").               // or ListID("project-uuid")
    Reveal(true).
    Execute(ctx)
Create Project
client.AddProject().
    Title("New Project").
    Notes("Project description").
    Area("Work").                       // or AreaID("area-uuid")
    Tags("important").
    Deadline(time.Date(2024, 12, 31, 0, 0, 0, 0, time.Local)).
    Todos("Task 1", "Task 2", "Task 3"). // child todos
    Execute(ctx)
Update Operations

Update operations automatically manage authentication tokens.

// Update a todo
client.UpdateTodo("todo-uuid").
    Title("Updated title").
    Completed(true).
    AddTags("done").
    Execute(ctx)

// Update a project
client.UpdateProject("project-uuid").
    Notes("Updated notes").
    Canceled(true).
    Execute(ctx)
Show Operations
client.Show(ctx, "item-uuid")                    // Show specific item
client.ShowList(ctx, things3.ListToday)          // Show Today view
client.ShowSearch(ctx, "urgent tasks")           // Show search results

// Complex navigation
client.ShowBuilder().
    List(things3.ListInbox).
    Filter("work", "urgent").
    Execute(ctx)
Batch Operations
// Create multiple items at once
client.Batch().
    AddTodo(func(t things3.BatchTodoConfigurator) {
        t.Title("Task 1").Tags("work")
    }).
    AddTodo(func(t things3.BatchTodoConfigurator) {
        t.Title("Task 2").When(things3.Today())
    }).
    AddProject(func(p things3.BatchProjectConfigurator) {
        p.Title("New Project").Notes("Description")
    }).
    Reveal(true).
    Execute(ctx)
Configuration
// Use custom database path
client, _ := things3.NewClient(
    things3.WithDatabasePath("/path/to/main.sqlite"),
)

// Enable SQL logging for debugging
client, _ := things3.NewClient(
    things3.WithPrintSQL(true),
)

// Control Things app focus behavior
client, _ := things3.NewClient(
    things3.WithForeground(),        // Bring Things to foreground (default for show)
    things3.WithBackground(),        // Run in background without stealing focus
)

// Preload authentication token
client, _ := things3.NewClient(
    things3.WithPreloadToken(),
)
Database Discovery

The database path is resolved in order:

  1. Custom path via WithDatabasePath()
  2. THINGSDB environment variable
  3. Default: ~/Library/Group Containers/JLMPQHK86H.com.culturedcode.ThingsMac/Things Database.thingsdatabase/main.sqlite
Types
// Task types
things3.TaskTypeTodo     // 0 - To-do item
things3.TaskTypeProject  // 1 - Project
things3.TaskTypeHeading  // 2 - Heading

// Status
things3.StatusIncomplete // 0
things3.StatusCanceled   // 2
things3.StatusCompleted  // 3

// Start bucket
things3.StartInbox    // 0
things3.StartAnytime  // 1
things3.StartSomeday  // 2

// Date helper functions
things3.Today()       // returns today's date at midnight
things3.Tomorrow()    // returns tomorrow's date at midnight

// Scheduling methods (called on builders)
.When(time.Time)      // schedule for specific date
.WhenEvening()        // schedule for this evening
.WhenAnytime()        // schedule for anytime (no specific date)
.WhenSomeday()        // schedule for someday (indefinite future)

// List IDs for navigation
things3.ListInbox
things3.ListToday
things3.ListUpcoming
things3.ListAnytime
things3.ListSomeday
things3.ListLogbook
things3.ListTrash

References

License

Apache License 2.0

Documentation

Overview

Package things3 provides a Go library for Things 3 on macOS with read-only database access and full URL Scheme support for creating and updating tasks.

Features

This package offers two main capabilities:

  • Read-only access to the Things 3 SQLite database for querying tasks, projects, areas, and tags
  • Full Things URL Scheme support for creating, updating, and navigating to items

Getting Started

All operations go through a single Client:

client, err := things3.NewClient()
if err != nil {
    log.Fatal(err)
}
defer client.Close()

// Convenience methods
inbox, _ := client.Inbox(ctx)
today, _ := client.Today(ctx)
todos, _ := client.Todos(ctx)

Fluent Query Builder

For complex queries, use the type-safe fluent query builder:

tasks, _ := client.Tasks().
    Type().Todo().
    Status().Incomplete().
    StartDate().Future().
    All(ctx)

URL Scheme

Create and update items via Things URL Scheme:

// Create a new to-do
client.AddTodo().
    Title("Buy groceries").
    When(things3.Today()).
    Tags("shopping").
    Execute(ctx)

// Update existing items (auth token managed automatically)
client.UpdateTodo("uuid").Completed(true).Execute(ctx)

Configuration

Configure the client with functional options:

client, _ := things3.NewClient(things3.WithDatabasePath("/path/to/main.sqlite"))
client, _ := things3.NewClient(things3.WithPrintSQL(true))

Database Discovery

The database path is discovered in the following order:

  1. Custom path provided via WithDatabasePath option
  2. THINGSDB environment variable
  3. Auto-discovery of default Things 3 database location

Type System

The package uses integer-based enums that map directly to database values:

  • TaskType: TaskTypeTodo (0), TaskTypeProject (1), TaskTypeHeading (2)
  • Status: StatusIncomplete (0), StatusCanceled (2), StatusCompleted (3)
  • StartBucket: StartInbox (0), StartAnytime (1), StartSomeday (2)

References

For the official Things URL Scheme documentation, see: https://culturedcode.com/things/support/articles/2803573/

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDatabaseNotFound is returned when the Things database cannot be located.
	ErrDatabaseNotFound = errors.New("things3: database not found")
	// ErrDatabaseVersionTooOld is returned when the database version is not supported.
	ErrDatabaseVersionTooOld = errors.New("things3: database version too old (requires things3 version > 21)")
)

Database Errors

View Source
var (
	// ErrTaskNotFound is returned when a task with the specified UUID does not exist.
	ErrTaskNotFound = errors.New("things3: task not found")
	// ErrAreaNotFound is returned when an area with the specified UUID does not exist.
	ErrAreaNotFound = errors.New("things3: area not found")
	// ErrTagNotFound is returned when a tag with the specified title does not exist.
	ErrTagNotFound = errors.New("things3: tag not found")
	// ErrInvalidParameter is returned when an invalid parameter value is provided.
	ErrInvalidParameter = errors.New("things3: invalid parameter")
)

Query Errors

View Source
var (
	// ErrAuthTokenNotFound is returned when the URL scheme auth token cannot be read.
	ErrAuthTokenNotFound = errors.New("things3: auth token not found")
	// ErrEmptyToken is returned when an empty token is provided to WithToken.
	ErrEmptyToken = errors.New("things3: empty token provided to WithToken")
	// ErrIDRequired is returned when id is missing for an update operation.
	ErrIDRequired = errors.New("things3: id required for update operation")
	// ErrTitleTooLong is returned when title exceeds 4,000 character limit.
	ErrTitleTooLong = errors.New("things3: title exceeds 4,000 character limit")
	// ErrNotesTooLong is returned when notes exceed 10,000 character limit.
	ErrNotesTooLong = errors.New("things3: notes exceed 10,000 character limit")
	// ErrTooManyChecklistItems is returned when checklist exceeds 100 item limit.
	ErrTooManyChecklistItems = errors.New("things3: checklist exceeds 100 item limit")
	// ErrNoJSONItems is returned when building a JSON URL with no items.
	ErrNoJSONItems = errors.New("things3: no items provided for JSON operation")
	// ErrInvalidReminderTime is returned when reminder hour or minute is out of range.
	ErrInvalidReminderTime = errors.New("things3: invalid reminder time (hour must be 0-23, minute must be 0-59)")
)

URL Scheme Errors

Functions

func ApplyWhen added in v0.4.0

func ApplyWhen[T WhenScheduler[T]](b T, when string) T

ApplyWhen parses a when string and applies scheduling to a builder. Supports:

  • "today": schedules for today
  • "tomorrow": schedules for tomorrow
  • "evening": schedules for this evening
  • "anytime": removes specific scheduling (anytime)
  • "someday": schedules for someday (indefinite future)
  • "yyyy-mm-dd": schedules for specific date

Returns the builder unchanged if the format is not recognized.

Example:

todo := scheme.Todo().Title("Task")
todo = things3.ApplyWhen(todo, "today")
todo = things3.ApplyWhen(todo, "2024-12-25")

func DaysAgo added in v0.4.0

func DaysAgo(n int) time.Time

DaysAgo returns the time n days before now. This is useful for filtering tasks by creation date.

Example:

db.Tasks().CreatedAfter(things3.DaysAgo(7)).All(ctx) // tasks from last 7 days

func Headings added in v0.2.0

func Headings(headings ...string) string

Headings creates heading entries for a project's items. Used within batchProjectBuilder.Todos to organize to-dos under headings.

func MonthsAgo added in v0.4.0

func MonthsAgo(n int) time.Time

MonthsAgo returns the time n months before now. This is useful for filtering tasks by creation date.

Example:

db.Tasks().CreatedAfter(things3.MonthsAgo(1)).All(ctx) // tasks from last month

func Today added in v0.4.0

func Today() time.Time

Today returns today's date at midnight (00:00:00) in local timezone. This is useful for scheduling tasks with When().

Example:

scheme.Todo().Title("Morning task").When(things3.Today())

func Tomorrow added in v0.4.0

func Tomorrow() time.Time

Tomorrow returns tomorrow's date at midnight (00:00:00) in local timezone. This is useful for scheduling tasks with When().

Example:

scheme.Todo().Title("Task for tomorrow").When(things3.Tomorrow())

func WeeksAgo added in v0.4.0

func WeeksAgo(n int) time.Time

WeeksAgo returns the time n weeks before now. This is useful for filtering tasks by creation date.

Example:

db.Tasks().CreatedAfter(things3.WeeksAgo(2)).All(ctx) // tasks from last 2 weeks

func YearsAgo added in v0.4.0

func YearsAgo(n int) time.Time

YearsAgo returns the time n years before now. This is useful for filtering tasks by creation date.

Example:

db.Tasks().CreatedAfter(things3.YearsAgo(1)).All(ctx) // tasks from last year

Types

type Area

type Area struct {
	UUID  string `json:"uuid" yaml:"uuid"`
	Type  string `json:"type" yaml:"type"` // Always "area"
	Title string `json:"title" yaml:"title"`

	// Nested items (populated when include_items=true)
	Tags  []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Items []Task   `json:"items,omitempty" yaml:"items,omitempty"`
}

Area represents an area in Things 3.

type AreaQueryBuilder added in v0.5.0

type AreaQueryBuilder interface {
	AreaQueryExecutor

	WithUUID(uuid string) AreaQueryBuilder
	WithTitle(title string) AreaQueryBuilder
	Visible(visible bool) AreaQueryBuilder
	InTag(title string) AreaQueryBuilder
	HasTag(has bool) AreaQueryBuilder
	IncludeItems(include bool) AreaQueryBuilder
}

AreaQueryBuilder provides a fluent interface for building area queries.

type AreaQueryExecutor added in v0.5.0

type AreaQueryExecutor interface {
	All(ctx context.Context) ([]Area, error)
	First(ctx context.Context) (*Area, error)
	Count(ctx context.Context) (int, error)
}

AreaQueryExecutor executes area queries and returns results.

type AuthBatchCreator added in v0.5.0

type AuthBatchCreator interface {
	AddTodo(configure func(BatchTodoConfigurator)) AuthBatchCreator
	AddProject(configure func(BatchProjectConfigurator)) AuthBatchCreator
	UpdateTodo(id string, configure func(BatchTodoConfigurator)) AuthBatchCreator
	UpdateProject(id string, configure func(BatchProjectConfigurator)) AuthBatchCreator
	Reveal(reveal bool) AuthBatchCreator
	Build() (string, error)
	Execute(ctx context.Context) error
}

AuthBatchCreator builds URLs for batch operations including updates.

type BatchCreator added in v0.5.0

type BatchCreator interface {
	AddTodo(configure func(BatchTodoConfigurator)) BatchCreator
	AddProject(configure func(BatchProjectConfigurator)) BatchCreator
	Reveal(reveal bool) BatchCreator
	Build() (string, error)
	Execute(ctx context.Context) error
}

BatchCreator builds URLs for batch create operations.

type BatchProjectConfigurator added in v0.5.0

type BatchProjectConfigurator interface {
	Title(title string) BatchProjectConfigurator
	Notes(notes string) BatchProjectConfigurator
	PrependNotes(notes string) BatchProjectConfigurator
	AppendNotes(notes string) BatchProjectConfigurator
	When(t time.Time) BatchProjectConfigurator
	WhenEvening() BatchProjectConfigurator
	WhenAnytime() BatchProjectConfigurator
	WhenSomeday() BatchProjectConfigurator
	Deadline(t time.Time) BatchProjectConfigurator
	Tags(tags ...string) BatchProjectConfigurator
	AddTags(tags ...string) BatchProjectConfigurator
	Area(name string) BatchProjectConfigurator
	AreaID(id string) BatchProjectConfigurator
	Todos(configs ...func(BatchTodoConfigurator)) BatchProjectConfigurator
	Completed(completed bool) BatchProjectConfigurator
	Canceled(canceled bool) BatchProjectConfigurator
	CreationDate(date time.Time) BatchProjectConfigurator
	CompletionDate(date time.Time) BatchProjectConfigurator
}

BatchProjectConfigurator configures a project entry for batch operations.

type BatchTodoConfigurator added in v0.5.0

type BatchTodoConfigurator interface {
	Title(title string) BatchTodoConfigurator
	Notes(notes string) BatchTodoConfigurator
	PrependNotes(notes string) BatchTodoConfigurator
	AppendNotes(notes string) BatchTodoConfigurator
	When(t time.Time) BatchTodoConfigurator
	WhenEvening() BatchTodoConfigurator
	WhenAnytime() BatchTodoConfigurator
	WhenSomeday() BatchTodoConfigurator
	Deadline(t time.Time) BatchTodoConfigurator
	Tags(tags ...string) BatchTodoConfigurator
	AddTags(tags ...string) BatchTodoConfigurator
	ChecklistItems(items ...string) BatchTodoConfigurator
	List(name string) BatchTodoConfigurator
	ListID(id string) BatchTodoConfigurator
	Heading(name string) BatchTodoConfigurator
	Completed(completed bool) BatchTodoConfigurator
	Canceled(canceled bool) BatchTodoConfigurator
	CreationDate(date time.Time) BatchTodoConfigurator
	CompletionDate(date time.Time) BatchTodoConfigurator
}

BatchTodoConfigurator configures a to-do entry for batch operations.

type ChecklistItem

type ChecklistItem struct {
	UUID   string `json:"uuid" yaml:"uuid"`
	Type   string `json:"type" yaml:"type"` // Always "checklist-item"
	Title  string `json:"title" yaml:"title"`
	Status string `json:"status" yaml:"status"` // "incomplete", "completed", or "canceled"
	// StopDate: completion date.
	//   Database: "2024-01-15" (date only, format "YYYY-MM-DD")
	//   Parsed:   time.Time with zero time component
	StopDate *time.Time `json:"stop_date,omitempty" yaml:"stop_date,omitempty"`
	// Created: item creation timestamp.
	//   Database: "2024-01-15 10:30:45" (datetime, format "YYYY-MM-DD HH:MM:SS")
	//   Parsed:   time.Time with full date and time
	Created time.Time `json:"created" yaml:"created"`
	// Modified: last modification timestamp.
	//   Database: "2024-01-15 10:30:45" (datetime, format "YYYY-MM-DD HH:MM:SS")
	//   Parsed:   time.Time with full date and time
	Modified time.Time `json:"modified" yaml:"modified"`
}

ChecklistItem represents a checklist item within a to-do.

func (*ChecklistItem) IsCanceled

func (c *ChecklistItem) IsCanceled() bool

IsCanceled returns true if the checklist item is canceled.

func (*ChecklistItem) IsCompleted

func (c *ChecklistItem) IsCompleted() bool

IsCompleted returns true if the checklist item is completed.

func (*ChecklistItem) IsIncomplete

func (c *ChecklistItem) IsIncomplete() bool

IsIncomplete returns true if the checklist item is incomplete.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides unified access to Things 3 database and URL scheme operations. It combines read-only database access with URL scheme write operations, handling authentication token management automatically.

Create a client using NewClient:

client, err := things3.NewClient()
if err != nil {
    log.Fatal(err)
}
defer client.Close()

Query operations read from the Things 3 database:

tasks, _ := client.Inbox(ctx)
tasks, _ := client.Tasks().Status().Incomplete().All(ctx)

Add operations create new items via URL scheme:

client.AddTodo().Title("Buy milk").Execute(ctx)

Update operations automatically manage authentication tokens:

client.UpdateTodo(uuid).Completed(true).Execute(ctx)

Show operations display items in the Things app:

client.Show(ctx, uuid)

func NewClient added in v0.5.0

func NewClient(opts ...ClientOption) (*Client, error)

NewClient creates a new unified Things 3 client. It opens a database connection and initializes the URL scheme handler.

Returns an error if the database cannot be found or opened.

Example:

client, err := things3.NewClient()
if err != nil {
    log.Fatal(err)
}
defer client.Close()

// With options
client, err := things3.NewClient(
    things3.WithDatabasePath("/custom/path"),
    things3.WithPrintSQL(true),
)

func (*Client) AddProject added in v0.5.0

func (c *Client) AddProject() ProjectAdder

AddProject returns a ProjectAdder for creating a new project.

Example:

client.AddProject().
    Title("Home Renovation").
    Notes("Kitchen and bathroom").
    Execute(ctx)

func (*Client) AddTodo added in v0.5.0

func (c *Client) AddTodo() TodoAdder

AddTodo returns a TodoAdder for creating a new to-do.

Example:

client.AddTodo().
    Title("Buy milk").
    Notes("From the grocery store").
    When(things3.Today()).
    Execute(ctx)

func (*Client) Anytime

func (c *Client) Anytime(ctx context.Context) ([]Task, error)

Anytime returns tasks in the Anytime list.

func (*Client) Areas

func (c *Client) Areas() AreaQueryBuilder

Areas creates a new AreaQueryBuilder for querying areas.

func (*Client) AuthBatch added in v0.5.0

func (c *Client) AuthBatch() AuthBatchCreator

AuthBatch returns an AuthBatchCreator for batch operations including updates. The authentication token is fetched automatically on first use.

Example:

client.AuthBatch().
    AddTodo(func(b BatchTodoConfigurator) {
        b.Title("New task")
    }).
    UpdateTodo("uuid", func(b BatchTodoConfigurator) {
        b.Completed(true)
    }).
    Execute(ctx)

func (*Client) Batch added in v0.5.0

func (c *Client) Batch() BatchCreator

Batch returns a BatchCreator for batch create operations.

Example:

client.Batch().
    AddTodo(func(b BatchTodoConfigurator) {
        b.Title("Task 1")
    }).
    AddTodo(func(b BatchTodoConfigurator) {
        b.Title("Task 2")
    }).
    Execute(ctx)

func (*Client) Canceled

func (c *Client) Canceled(ctx context.Context) ([]Task, error)

Canceled returns canceled tasks.

func (*Client) ChecklistItems

func (c *Client) ChecklistItems(ctx context.Context, todoUUID string) ([]ChecklistItem, error)

ChecklistItems returns the checklist items for a to-do.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection.

func (*Client) Completed

func (c *Client) Completed(ctx context.Context) ([]Task, error)

Completed returns completed tasks.

func (*Client) CreatedWithin added in v0.5.0

func (c *Client) CreatedWithin(ctx context.Context, since time.Time) ([]Task, error)

CreatedWithin returns tasks created after the specified time.

func (*Client) Deadlines

func (c *Client) Deadlines(ctx context.Context) ([]Task, error)

Deadlines returns tasks with deadlines, sorted by deadline.

func (*Client) Get

func (c *Client) Get(ctx context.Context, uuid string) (any, error)

Get retrieves an object by UUID. Returns a Task, Area, or Tag depending on what is found. Returns nil if not found.

func (*Client) Inbox

func (c *Client) Inbox(ctx context.Context) ([]Task, error)

Inbox returns all tasks in the Inbox.

func (*Client) Logbook

func (c *Client) Logbook(ctx context.Context) ([]Task, error)

Logbook returns completed and canceled tasks.

func (*Client) Projects

func (c *Client) Projects(ctx context.Context) ([]Task, error)

Projects returns all incomplete projects.

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string) ([]Task, error)

Search searches for tasks matching the query.

func (*Client) Show

func (c *Client) Show(ctx context.Context, uuid string) error

Show opens Things and displays the item with the given UUID. By default, brings Things to foreground since the user wants to view the item. Use WithBackgroundNavigation() option to run in background without stealing focus.

func (*Client) ShowBuilder added in v0.5.0

func (c *Client) ShowBuilder() ShowNavigator

ShowBuilder returns a ShowNavigator for complex navigation operations.

func (*Client) ShowList added in v0.5.0

func (c *Client) ShowList(ctx context.Context, list ListID) error

ShowList opens Things and displays the specified list. Use ListID constants like ListInbox, ListToday, etc.

Example:

client.ShowList(ctx, things3.ListToday)

func (*Client) ShowSearch added in v0.5.0

func (c *Client) ShowSearch(ctx context.Context, query string) error

ShowSearch opens Things and performs a search for the given query. By default, brings Things to foreground since the user wants to view results.

func (*Client) Someday

func (c *Client) Someday(ctx context.Context) ([]Task, error)

Someday returns tasks in the Someday list.

func (*Client) Tags

func (c *Client) Tags() TagQueryBuilder

Tags creates a new TagQueryBuilder for querying tags.

func (*Client) Tasks

func (c *Client) Tasks() TaskQueryBuilder

Tasks creates a new TaskQueryBuilder for querying tasks.

func (*Client) Today

func (c *Client) Today(ctx context.Context) ([]Task, error)

Today returns tasks that would appear in Today view.

func (*Client) Todos

func (c *Client) Todos(ctx context.Context) ([]Task, error)

Todos returns all incomplete to-do items.

func (*Client) Token

func (c *Client) Token(ctx context.Context) (string, error)

Token returns the cached authentication token, fetching it if needed. Most users should not need this; use UpdateTodo/UpdateProject directly.

func (*Client) Trash

func (c *Client) Trash(ctx context.Context) ([]Task, error)

Trash returns trashed tasks.

func (*Client) Upcoming

func (c *Client) Upcoming(ctx context.Context) ([]Task, error)

Upcoming returns tasks scheduled for future dates.

func (*Client) UpdateProject added in v0.5.0

func (c *Client) UpdateProject(id string) ProjectUpdater

UpdateProject returns a ProjectUpdater for modifying an existing project. The authentication token is fetched automatically on first use.

Example:

client.UpdateProject(uuid).
    Title("Renamed Project").
    Execute(ctx)

func (*Client) UpdateTodo added in v0.5.0

func (c *Client) UpdateTodo(id string) TodoUpdater

UpdateTodo returns a TodoUpdater for modifying an existing to-do. The authentication token is fetched automatically on first use.

Example:

client.UpdateTodo(uuid).
    Completed(true).
    Execute(ctx)

type ClientOption added in v0.5.0

type ClientOption func(*clientOptions)

ClientOption is a functional option for configuring the Client.

func WithBackgroundNavigation added in v0.5.0

func WithBackgroundNavigation() ClientOption

WithBackgroundNavigation configures the Client to run navigation operations (Show, ShowList, ShowSearch) in the background without stealing focus.

By default, navigation operations bring Things to foreground since the user typically wants to view the content. Use this option for programmatic navigation where focus change is undesired.

Example:

client, err := things3.NewClient(things3.WithBackgroundNavigation())
client.Show(ctx, "uuid")  // Things stays in background

func WithDatabasePath

func WithDatabasePath(path string) ClientOption

WithDatabasePath sets a custom path to the Things database. If not set, the database path is discovered automatically.

Example:

client, err := things3.NewClient(things3.WithDatabasePath("/path/to/main.sqlite"))

func WithForegroundExecution added in v0.5.0

func WithForegroundExecution() ClientOption

WithForegroundExecution configures the Client to bring Things to foreground when executing create/update operations (AddTodo, AddProject, UpdateTodo, etc.).

By default, create/update operations run in background without stealing focus. Use this option when you want Things to become the active window after operations.

Example:

client, err := things3.NewClient(things3.WithForegroundExecution())
client.AddTodo().Title("Buy milk").Execute(ctx)  // Things comes to foreground

func WithPreloadToken added in v0.5.0

func WithPreloadToken() ClientOption

WithPreloadToken fetches the authentication token immediately during NewClient() instead of lazily on first update operation.

Use this option when you know you will need authenticated operations and want to fail fast if the token cannot be retrieved.

Example:

client, err := things3.NewClient(things3.WithPreloadToken())
if err != nil {
    // May fail due to token retrieval error
}

func WithPrintSQL

func WithPrintSQL(enabled bool) ClientOption

WithPrintSQL enables SQL query logging to stdout. Useful for debugging and understanding the queries being executed.

Example:

client, err := things3.NewClient(things3.WithPrintSQL(true))

type Command added in v0.2.0

type Command string

Command represents Things URL scheme commands.

const (
	// CommandShow opens and shows an item.
	CommandShow Command = "show"
	// CommandAdd creates a new to-do.
	CommandAdd Command = "add"
	// CommandAddProject creates a new project.
	CommandAddProject Command = "add-project"
	// CommandUpdate updates an existing item (requires auth token).
	CommandUpdate Command = "update"
	// CommandUpdateProject updates an existing project (requires auth token).
	CommandUpdateProject Command = "update-project"
	// CommandSearch performs a search.
	CommandSearch Command = "search"
	// CommandVersion returns Things version information.
	CommandVersion Command = "version"
	// CommandJSON enables advanced JSON-based operations.
	CommandJSON Command = "json"
)

func (Command) String added in v0.2.0

func (c Command) String() string

String returns the string representation of the Command.

type DateFilterBuilder added in v0.5.0

type DateFilterBuilder interface {
	Exists(has bool) TaskQueryBuilder
	Future() TaskQueryBuilder
	Past() TaskQueryBuilder
	On(date time.Time) TaskQueryBuilder
	Before(date time.Time) TaskQueryBuilder
	OnOrBefore(date time.Time) TaskQueryBuilder
	After(date time.Time) TaskQueryBuilder
	OnOrAfter(date time.Time) TaskQueryBuilder
}

DateFilterBuilder provides type-safe date filtering.

type JSONItem added in v0.2.0

type JSONItem struct {
	Type       JSONItemType   `json:"type"`
	Operation  JSONOperation  `json:"operation,omitempty"`
	ID         string         `json:"id,omitempty"`
	Attributes map[string]any `json:"attributes,omitempty"`
}

JSONItem represents a single item in a JSON batch operation.

type JSONItemType added in v0.2.0

type JSONItemType string

JSONItemType represents the type of item in a JSON operation.

const (
	// JSONItemTypeTodo represents a to-do item.
	JSONItemTypeTodo JSONItemType = "to-do"
	// JSONItemTypeProject represents a project item.
	JSONItemTypeProject JSONItemType = "project"
)

type JSONOperation added in v0.2.0

type JSONOperation string

JSONOperation represents the operation type for a JSON item.

const (
	// JSONOperationCreate creates a new item.
	JSONOperationCreate JSONOperation = "create"
	// JSONOperationUpdate updates an existing item.
	JSONOperationUpdate JSONOperation = "update"
)

type ListID added in v0.2.0

type ListID string

ListID represents built-in Things list identifiers for the show command.

const (
	// ListInbox is the Inbox list.
	ListInbox ListID = "inbox"
	// ListToday is the Today list.
	ListToday ListID = "today"
	// ListAnytime is the Anytime list.
	ListAnytime ListID = "anytime"
	// ListUpcoming is the Upcoming list.
	ListUpcoming ListID = "upcoming"
	// ListSomeday is the Someday list.
	ListSomeday ListID = "someday"
	// ListLogbook is the Logbook list.
	ListLogbook ListID = "logbook"
	// ListTomorrow is the Tomorrow list.
	ListTomorrow ListID = "tomorrow"
	// ListDeadlines is the Deadlines list.
	ListDeadlines ListID = "deadlines"
	// ListRepeating is the Repeating list.
	ListRepeating ListID = "repeating"
	// ListAllProjects is the All Projects list.
	ListAllProjects ListID = "all-projects"
	// ListLoggedProjects is the Logged Projects list.
	ListLoggedProjects ListID = "logged-projects"
)

func (ListID) String added in v0.2.0

func (l ListID) String() string

String returns the string representation of the ListID.

type ProjectAdder added in v0.5.0

type ProjectAdder interface {
	URLBuilder

	Title(title string) ProjectAdder
	Notes(notes string) ProjectAdder
	When(t time.Time) ProjectAdder
	WhenEvening() ProjectAdder
	WhenAnytime() ProjectAdder
	WhenSomeday() ProjectAdder
	Deadline(t time.Time) ProjectAdder
	Reminder(hour, minute int) ProjectAdder
	Tags(tags ...string) ProjectAdder
	Area(name string) ProjectAdder
	AreaID(id string) ProjectAdder
	Todos(titles ...string) ProjectAdder
	Completed(completed bool) ProjectAdder
	Canceled(canceled bool) ProjectAdder
	Reveal(reveal bool) ProjectAdder
	CreationDate(date time.Time) ProjectAdder
	CompletionDate(date time.Time) ProjectAdder
}

ProjectAdder builds URLs for creating new projects.

type ProjectUpdater added in v0.5.0

type ProjectUpdater interface {
	URLBuilder

	Title(title string) ProjectUpdater
	Notes(notes string) ProjectUpdater
	PrependNotes(notes string) ProjectUpdater
	AppendNotes(notes string) ProjectUpdater
	When(t time.Time) ProjectUpdater
	WhenEvening() ProjectUpdater
	WhenAnytime() ProjectUpdater
	WhenSomeday() ProjectUpdater
	Deadline(t time.Time) ProjectUpdater
	ClearDeadline() ProjectUpdater
	Reminder(hour, minute int) ProjectUpdater
	Tags(tags ...string) ProjectUpdater
	AddTags(tags ...string) ProjectUpdater
	Area(name string) ProjectUpdater
	AreaID(id string) ProjectUpdater
	Completed(completed bool) ProjectUpdater
	Canceled(canceled bool) ProjectUpdater
	Reveal(reveal bool) ProjectUpdater
}

ProjectUpdater builds URLs for updating existing projects.

type ShowNavigator added in v0.5.0

type ShowNavigator interface {
	ID(id string) ShowNavigator
	List(list ListID) ShowNavigator
	Query(query string) ShowNavigator
	Filter(tags ...string) ShowNavigator

	Build() (string, error)
	Execute(ctx context.Context) error
}

ShowNavigator builds URLs for navigating to items or lists.

type StartBucket

type StartBucket int

StartBucket represents the scheduling bucket for a task.

const (
	// StartInbox indicates the task is in the Inbox.
	StartInbox StartBucket = 0
	// StartAnytime indicates the task is scheduled for Anytime.
	StartAnytime StartBucket = 1
	// StartSomeday indicates the task is scheduled for Someday.
	StartSomeday StartBucket = 2
)

func (StartBucket) String

func (s StartBucket) String() string

String returns the string representation of the StartBucket.

type StartFilterBuilder added in v0.5.0

type StartFilterBuilder interface {
	Inbox() TaskQueryBuilder
	Anytime() TaskQueryBuilder
	Someday() TaskQueryBuilder
}

StartFilterBuilder provides type-safe start bucket filtering.

type Status

type Status int

Status represents the completion status of a task.

const (
	// StatusIncomplete indicates the task is not yet completed.
	StatusIncomplete Status = 0
	// StatusCanceled indicates the task was canceled.
	StatusCanceled Status = 2
	// StatusCompleted indicates the task was completed.
	StatusCompleted Status = 3
)

func (Status) IsClosed

func (s Status) IsClosed() bool

IsClosed returns true if the status indicates a closed (completed or canceled) task.

func (Status) IsOpen

func (s Status) IsOpen() bool

IsOpen returns true if the status indicates an open (incomplete) task.

func (Status) MarshalJSON added in v0.5.0

func (s Status) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Status.

func (Status) MarshalYAML added in v0.5.0

func (s Status) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler for Status.

func (Status) String

func (s Status) String() string

String returns the string representation of the Status.

func (*Status) UnmarshalJSON added in v0.5.0

func (s *Status) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Status.

func (*Status) UnmarshalYAML added in v0.5.0

func (s *Status) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for Status.

type StatusFilterBuilder added in v0.5.0

type StatusFilterBuilder interface {
	Incomplete() TaskQueryBuilder
	Completed() TaskQueryBuilder
	Canceled() TaskQueryBuilder
	Any() TaskQueryBuilder
}

StatusFilterBuilder provides type-safe status filtering.

type Tag

type Tag struct {
	UUID     string `json:"uuid" yaml:"uuid"`
	Type     string `json:"type" yaml:"type"` // Always "tag"
	Title    string `json:"title" yaml:"title"`
	Shortcut string `json:"shortcut,omitempty" yaml:"shortcut,omitempty"`

	// Nested items (populated when include_items=true)
	Items []any `json:"items,omitempty" yaml:"items,omitempty"` // Can contain Area or Task
}

Tag represents a tag in Things 3.

type TagQueryBuilder added in v0.5.0

type TagQueryBuilder interface {
	TagQueryExecutor

	WithUUID(uuid string) TagQueryBuilder
	WithTitle(title string) TagQueryBuilder
	WithParent(parentUUID string) TagQueryBuilder
	IncludeItems(include bool) TagQueryBuilder
}

TagQueryBuilder provides a fluent interface for building tag queries.

type TagQueryExecutor added in v0.5.0

type TagQueryExecutor interface {
	All(ctx context.Context) ([]Tag, error)
	First(ctx context.Context) (*Tag, error)
}

TagQueryExecutor executes tag queries and returns results.

type Task

type Task struct {
	UUID   string   `json:"uuid" yaml:"uuid"`
	Type   TaskType `json:"type" yaml:"type"`
	Title  string   `json:"title" yaml:"title"`
	Status Status   `json:"status" yaml:"status"`
	Notes  string   `json:"notes,omitempty" yaml:"notes,omitempty"`
	Start  string   `json:"start,omitempty" yaml:"start,omitempty"` // "Inbox", "Anytime", or "Someday"

	// Trashed indicates whether the task is in the trash.
	Trashed bool `json:"trashed,omitempty" yaml:"trashed,omitempty"`

	// Relationships
	AreaUUID     *string `json:"area_uuid,omitempty" yaml:"area_uuid,omitempty"`
	AreaTitle    *string `json:"area_title,omitempty" yaml:"area_title,omitempty"`
	ProjectUUID  *string `json:"project_uuid,omitempty" yaml:"project_uuid,omitempty"`
	ProjectTitle *string `json:"project_title,omitempty" yaml:"project_title,omitempty"`
	HeadingUUID  *string `json:"heading_uuid,omitempty" yaml:"heading_uuid,omitempty"`
	HeadingTitle *string `json:"heading_title,omitempty" yaml:"heading_title,omitempty"`

	// Dates
	// All date/time fields are converted from SQLite string formats to time.Time.
	//
	// StartDate: scheduled start date.
	//   Database: "2024-01-15" (date only, format "YYYY-MM-DD")
	//   Parsed:   time.Time with zero time component
	StartDate *time.Time `json:"start_date,omitempty" yaml:"start_date,omitempty"`
	// Deadline: task deadline date.
	//   Database: "2024-01-15" (date only, format "YYYY-MM-DD")
	//   Parsed:   time.Time with zero time component
	Deadline *time.Time `json:"deadline,omitempty" yaml:"deadline,omitempty"`
	// ReminderTime: time-only reminder (date component is zero value).
	//   Database: "14:30" (time only, format "HH:MM")
	//   Parsed:   time.Time with zero date (0000-01-01), only Hour/Minute meaningful
	ReminderTime *time.Time `json:"reminder_time,omitempty" yaml:"reminder_time,omitempty"`
	// StopDate: completion or cancellation timestamp.
	//   Database: "2024-01-15 10:30:45" (datetime, format "YYYY-MM-DD HH:MM:SS")
	//   Parsed:   time.Time with full date and time
	StopDate *time.Time `json:"stop_date,omitempty" yaml:"stop_date,omitempty"`
	// Created: task creation timestamp.
	//   Database: "2024-01-15 10:30:45" (datetime, format "YYYY-MM-DD HH:MM:SS")
	//   Parsed:   time.Time with full date and time
	Created time.Time `json:"created" yaml:"created"`
	// Modified: last modification timestamp.
	//   Database: "2024-01-15 10:30:45" (datetime, format "YYYY-MM-DD HH:MM:SS")
	//   Parsed:   time.Time with full date and time
	Modified time.Time `json:"modified" yaml:"modified"`

	// Index values for ordering
	Index      int `json:"index" yaml:"index"`
	TodayIndex int `json:"today_index" yaml:"today_index"`

	// Nested items (populated when include_items=true)
	Tags      []string        `json:"tags,omitempty" yaml:"tags,omitempty"`
	Checklist []ChecklistItem `json:"checklist,omitempty" yaml:"checklist,omitempty"`
	Items     []Task          `json:"items,omitempty" yaml:"items,omitempty"` // For projects and headings
}

Task represents a task in Things 3, which can be a to-do, project, or heading.

func (*Task) HasChecklist

func (t *Task) HasChecklist() bool

HasChecklist returns true if the task has a checklist.

func (*Task) HasTags

func (t *Task) HasTags() bool

HasTags returns true if the task has any tags.

func (*Task) IsCanceled

func (t *Task) IsCanceled() bool

IsCanceled returns true if the task status is canceled.

func (*Task) IsCompleted

func (t *Task) IsCompleted() bool

IsCompleted returns true if the task status is completed.

func (*Task) IsHeading

func (t *Task) IsHeading() bool

IsHeading returns true if the task is a heading.

func (*Task) IsIncomplete

func (t *Task) IsIncomplete() bool

IsIncomplete returns true if the task status is incomplete.

func (*Task) IsProject

func (t *Task) IsProject() bool

IsProject returns true if the task is a project.

func (*Task) IsTodo

func (t *Task) IsTodo() bool

IsTodo returns true if the task is a to-do item.

type TaskQueryBuilder added in v0.5.0

type TaskQueryBuilder interface {
	TaskQueryExecutor
	TaskRelationFilter
	TaskStateFilter
	TaskTimeFilter

	WithUUID(uuid string) TaskQueryBuilder
	WithUUIDPrefix(prefix string) TaskQueryBuilder
	WithDeadlineSuppressed(suppressed bool) TaskQueryBuilder
	Search(query string) TaskQueryBuilder
	OrderByTodayIndex() TaskQueryBuilder
	IncludeItems(include bool) TaskQueryBuilder
}

TaskQueryBuilder provides a fluent interface for building task queries. Composed of: TaskQueryExecutor + TaskRelationFilter + TaskStateFilter + TaskTimeFilter

type TaskQueryExecutor added in v0.5.0

type TaskQueryExecutor interface {
	All(ctx context.Context) ([]Task, error)
	First(ctx context.Context) (*Task, error)
	Count(ctx context.Context) (int, error)
}

TaskQueryExecutor executes task queries and returns results.

type TaskRelationFilter added in v0.5.0

type TaskRelationFilter interface {
	InArea(uuid string) TaskQueryBuilder
	HasArea(has bool) TaskQueryBuilder
	InProject(uuid string) TaskQueryBuilder
	HasProject(has bool) TaskQueryBuilder
	InHeading(uuid string) TaskQueryBuilder
	HasHeading(has bool) TaskQueryBuilder
	InTag(title string) TaskQueryBuilder
	HasTag(has bool) TaskQueryBuilder
}

TaskRelationFilter provides relation-based filtering for tasks.

type TaskStateFilter added in v0.5.0

type TaskStateFilter interface {
	Type() TypeFilterBuilder
	Status() StatusFilterBuilder
	Start() StartFilterBuilder
	Trashed(trashed bool) TaskQueryBuilder
	ContextTrashed(trashed bool) TaskQueryBuilder
}

TaskStateFilter provides state and type filtering for tasks.

type TaskTimeFilter added in v0.5.0

type TaskTimeFilter interface {
	CreatedAfter(t time.Time) TaskQueryBuilder
	StartDate() DateFilterBuilder
	StopDate() DateFilterBuilder
	Deadline() DateFilterBuilder
}

TaskTimeFilter provides time-based filtering for tasks.

type TaskType

type TaskType int

TaskType represents the kind of task in Things 3. Tasks can be to-dos, projects, or headings within projects.

const (
	// TaskTypeTodo represents a regular to-do item.
	TaskTypeTodo TaskType = 0
	// TaskTypeProject represents a project containing tasks.
	TaskTypeProject TaskType = 1
	// TaskTypeHeading represents a heading within a project.
	TaskTypeHeading TaskType = 2
)

func (TaskType) MarshalJSON added in v0.5.0

func (t TaskType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for TaskType.

func (TaskType) MarshalYAML added in v0.5.0

func (t TaskType) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler for TaskType.

func (TaskType) String

func (t TaskType) String() string

String returns the string representation of the TaskType.

func (*TaskType) UnmarshalJSON added in v0.5.0

func (t *TaskType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for TaskType.

func (*TaskType) UnmarshalYAML added in v0.5.0

func (t *TaskType) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for TaskType.

type TodoAdder added in v0.5.0

type TodoAdder interface {
	URLBuilder

	Title(title string) TodoAdder
	Titles(titles ...string) TodoAdder
	Notes(notes string) TodoAdder
	When(t time.Time) TodoAdder
	WhenEvening() TodoAdder
	WhenAnytime() TodoAdder
	WhenSomeday() TodoAdder
	Deadline(t time.Time) TodoAdder
	Reminder(hour, minute int) TodoAdder
	Tags(tags ...string) TodoAdder
	ChecklistItems(items ...string) TodoAdder
	List(name string) TodoAdder
	ListID(id string) TodoAdder
	Heading(name string) TodoAdder
	HeadingID(id string) TodoAdder
	Completed(completed bool) TodoAdder
	Canceled(canceled bool) TodoAdder
	ShowQuickEntry(show bool) TodoAdder
	Reveal(reveal bool) TodoAdder
	CreationDate(date time.Time) TodoAdder
	CompletionDate(date time.Time) TodoAdder
}

TodoAdder builds URLs for creating new to-dos.

type TodoUpdater added in v0.5.0

type TodoUpdater interface {
	URLBuilder

	Title(title string) TodoUpdater
	Notes(notes string) TodoUpdater
	PrependNotes(notes string) TodoUpdater
	AppendNotes(notes string) TodoUpdater
	When(t time.Time) TodoUpdater
	WhenEvening() TodoUpdater
	WhenAnytime() TodoUpdater
	WhenSomeday() TodoUpdater
	Deadline(t time.Time) TodoUpdater
	ClearDeadline() TodoUpdater
	Reminder(hour, minute int) TodoUpdater
	Tags(tags ...string) TodoUpdater
	AddTags(tags ...string) TodoUpdater
	ChecklistItems(items ...string) TodoUpdater
	PrependChecklistItems(items ...string) TodoUpdater
	AppendChecklistItems(items ...string) TodoUpdater
	List(name string) TodoUpdater
	ListID(id string) TodoUpdater
	Heading(name string) TodoUpdater
	HeadingID(id string) TodoUpdater
	Completed(completed bool) TodoUpdater
	Canceled(canceled bool) TodoUpdater
	Duplicate(duplicate bool) TodoUpdater
	Reveal(reveal bool) TodoUpdater
	CreationDate(date time.Time) TodoUpdater
	CompletionDate(date time.Time) TodoUpdater
}

TodoUpdater builds URLs for updating existing to-dos.

type TypeFilterBuilder added in v0.5.0

type TypeFilterBuilder interface {
	Todo() TaskQueryBuilder
	Project() TaskQueryBuilder
	Heading() TaskQueryBuilder
}

TypeFilterBuilder provides type-safe task type filtering.

type URLBuilder added in v0.5.0

type URLBuilder interface {
	Build() (string, error)
	Execute(ctx context.Context) error
}

URLBuilder builds and executes Things URL schemes.

type WhenScheduler added in v0.4.0

type WhenScheduler[T any] interface {
	When(t time.Time) T
	WhenEvening() T
	WhenAnytime() T
	WhenSomeday() T
}

WhenScheduler is implemented by builders that support scheduling. All builder types (TodoBuilder, ProjectBuilder, UpdateTodoBuilder, UpdateProjectBuilder, JSONTodoBuilder, JSONProjectBuilder) satisfy this interface.

Directories

Path Synopsis
Package thingstest provides test utilities for projects that depend on the things3 library.
Package thingstest provides test utilities for projects that depend on the things3 library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL