Commands — Command Handler

The commands package implements the CommandHandler class and its mixins, which process user input in both quick-add and command modes.

CommandHandler

class jot.commands.handler.CommandHandler(task_manager, registry=None)[source]

Bases: CoreMixin, MetadataMixin, TransferMixin, BulkMixin, GcalMixin, GithubMixin, AiAnalysisMixin, AiSuggestMixin, NotesMixin, WebClipboardMixin, AudioTimerMixin, ContextMixin, ClaudeMixin

Extensible command system — composed from domain-specific mixins.

handle(command)[source]

Handle a command

Mixins

Core Commands

Core task CRUD and utility mixin.

class jot.commands._core_mixin.CoreMixin[source]

Bases: object

Core task operations: add, delete, edit, set current, help, refresh.

add_task()[source]

Add a new task

quit()[source]

Quit the application

set_current()[source]

Mark a task as current

set_agent_task()[source]

Mark current task as agent task (Claude Code is working on it)

duplicate_task()[source]

Duplicate the current task.

fix_duplicate_ids_interactive()[source]

Check for and fix duplicate task IDs (Shift+1)

delete_task()[source]

Delete a task by ID

delete_current()[source]

Delete the current task

edit_task()[source]

Edit a task’s text

edit_current()[source]

Edit the current task

collect_all_category_tasks(project_dir, show_archived=False)[source]

Collect tasks from all categories (default + local + global).

Returns list of (category_name, is_global, tasks, archived_tasks).

static toggle_all_categories_view(current_mode)[source]

Toggle between normal view and all-categories view.

Returns:

(should_toggle, new_mode)

Return type:

tuple

refresh()[source]

Refresh task list from file

static help()[source]

Show help modal with all keyboard shortcuts.

toggle_caps()[source]

Toggle current task text between ALL CAPS and original case.

Bulk Operations

Bulk task operations mixin for CommandHandler.

class jot.commands._bulk_mixin.BulkMixin[source]

Bases: object

Bulk actions on multiple selected tasks.

bulk_actions_menu(selected_task_ids)[source]

Show bulk actions menu and return selected action.

Returns:

‘priority’, ‘status’, ‘delete’, ‘archive’, ‘cancel’, or None

Return type:

str

bulk_set_priority(task_ids)[source]

Set priority for multiple tasks.

bulk_set_status(task_ids)[source]

Set status for multiple tasks.

bulk_delete(task_ids)[source]

Delete multiple tasks with confirmation.

bulk_archive(task_ids)[source]

Archive multiple tasks with confirmation.

Context Commands

Project/category switching mixin.

class jot.commands._context_mixin.ContextMixin[source]

Bases: object

Switch projects, switch categories, register projects.

switch_category()[source]

Switch to a different category (local or global)

switch_project()[source]

Switch to a different registered project

register_current_project()[source]

Register the current project in the global project registry

Metadata Commands

Metadata operations mixin (priority, status, day assignment).

class jot.commands._metadata_mixin.MetadataMixin[source]

Bases: object

Day assignment, priority, and status operations.

assign_day()[source]

Assign a day of the week to the current task

set_priority()[source]

Set priority for the current task

toggle_highlight()[source]

Pick a task state (color-coded) for the current task.

quick_highlight()[source]

Toggle default highlight color on the current task.

set_priority_high()[source]

Toggle current task priority between high and none.

set_status()[source]

Set status for the current task

assign_parent()[source]

Assign current task as a subtask of another task (Ctrl+L).

Notes Commands

Notes editing, subtask sync, and keyword action mixin.

class jot.commands._notes_mixin.NotesMixin[source]

Bases: object

Editor-based notes, subtask sync, and keyword actions.

static safe_launch_editor(file_path)[source]

Safely launch editor with file_path, avoiding command injection.

Uses shlex.split() to safely parse $EDITOR which may contain arguments (e.g., “emacs -nw”), then calls subprocess without shell=True to prevent command injection.

get_notes_file_extension(editor)[source]

Determine file extension based on editor.

edit_task_notes()[source]

Edit notes for the current task using $EDITOR

sync_subtasks()[source]

Manually sync subtasks from current task’s notes (Ctrl+S)

trigger_keyword_action()[source]

Manually trigger keyword action for current task

Transfer Commands

Task transfer/copy/move mixin.

class jot.commands._transfer_mixin.TransferMixin[source]

Bases: object

Copy, move, and transfer tasks between projects/categories.

copy_task_to_project()[source]

Copy current task to a different project (keeps original)

move_task_to_project()[source]

Move current task to a different project

transfer_task_to_category()[source]

Transfer current task to a different category within the same project

AI Analysis

AI task analysis and execution mixin.

class jot.commands._ai_analysis_mixin.AiAnalysisMixin[source]

Bases: object

Analyze tasks with Claude and execute analysis plans.

ultrathink_task()[source]

Analyze current task with Claude Code

execute_analysis_task()[source]

Execute analysis plan with Claude Code.

AI Suggest

AI task suggestion mixin.

class jot.commands._ai_suggest_mixin.AiSuggestMixin[source]

Bases: object

Suggest new tasks using Claude CLI.

suggest_task()[source]

Analyze tasks and suggest a new one using Claude (Shift+4)

Audio Timer (deprecated)

Text-to-speech and timer mixin.

class jot.commands._audio_timer_mixin.AudioTimerMixin[source]

Bases: object

Read tasks aloud and priority timer.

read_tasks_aloud()[source]

Read all tasks in current category aloud using TTS (Shift+2)

start_priority_timer()[source]

Launch bullet priority timer for current task

Google Calendar

Google Calendar integration mixin.

Exceeds 300-line guideline: gcal requires 7 user-facing flows (account setup, selection, export single/bulk, import with multi-day direction/grouping/display, re-authentication) that cannot be further decomposed without losing readability.

class jot.commands._gcal_mixin.GcalMixin[source]

Bases: object

Google Calendar import, export, and account management.

select_gcal_account()[source]

Select Google Calendar account. Returns account name or None.

export_to_gcal()[source]

Export task(s) to Google Calendar — single or bulk today

import_from_gcal()[source]

Import Google Calendar events as tasks (1-7 days)

reauthenticate_google_calendar()[source]

Force re-authentication with Google Calendar (Shift+3)

Web Clipboard

Web search, URL opening, and clipboard mixin.

class jot.commands._web_clipboard_mixin.WebClipboardMixin[source]

Bases: object

Web search, URL opening, and clipboard operations.

Open a web search with the current task text

open_url()[source]

Open URL(s) from current task text in browser

copy_to_clipboard()[source]

Copy current task text to clipboard