complete

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package complete implements the ctx task complete command.

It marks a task as completed in TASKS.md by number, partial text match, or full text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx complete" command for marking tasks as done.

Tasks can be specified by number, partial text match, or full text. The command updates TASKS.md by changing "- [ ]" to "- [x]".

Returns:

  • *cobra.Command: Configured complete command

func CompleteTask

func CompleteTask(query, contextDir string) (string, error)

CompleteTask finds a task in TASKS.md by number or text match and marks it complete by changing "- [ ]" to "- [x]".

Parameters:

  • query: Task number (e.g. "1") or search text to match
  • contextDir: Path to .context/ directory; if empty, uses rc.ContextDir()

Returns:

  • string: The text of the completed task
  • error: Non-nil if the task is not found, multiple matches, or file operations fail

func Run

func Run(cmd *cobra.Command, args []string) error

Run executes the complete command logic.

Parameters:

  • cmd: Cobra command for output
  • args: Command arguments (first arg is the query)

Returns:

  • error: Non-nil on task match or write failure

Types

This section is empty.

Jump to

Keyboard shortcuts

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