Skip to the content.

@glorioustephan/todoist-autolabel

Auto-classify Todoist Inbox tasks with Claude AI using Structured Outputs — guaranteed-valid label assignments, no retry parsing, no malformed JSON.

npx @glorioustephan/todoist-autolabel

npm CI License: MIT


Documentation

What it does

  1. Polls your Todoist Inbox on an interval.
  2. Skips completed tasks and anything already labelled.
  3. Sends each remaining task to Claude with a schema-constrained output_format. The model can only emit names from your taxonomy — no hallucinated labels, no malformed JSON.
  4. Patches the labels back to Todoist.
  5. Persists state in a local SQLite DB so retries don’t double-classify.

Getting started in 60 seconds

mkdir my-autolabel && cd my-autolabel

# Scaffold .env + labels.json in the current directory
npx @glorioustephan/todoist-autolabel init

# Edit .env to add your tokens, then run
npx @glorioustephan/todoist-autolabel

See the setup guide for the full walkthrough, model options, and troubleshooting.

Library usage

import {
  loadConfig,
  initDatabase,
  initTodoistApi,
  initClassifier,
  initSyncManager,
  getSyncManager,
} from '@glorioustephan/todoist-autolabel';

const config = loadConfig();
initDatabase(config);
await initTodoistApi(config);

const classifier = await initClassifier(config);
if (!classifier.success) throw new Error(classifier.error);

initSyncManager(config);
await getSyncManager().sync();

Fallible operations return Result<T, E> — there’s no surprise throwing past the SDK boundary.

License

MIT © glorioustephan