3 个版本

0.1.2 2023年2月6日
0.1.1 2022年12月31日
0.1.0 2022年11月23日

命令行工具 中排名第 2424

MIT OR Apache-2.0 OR GPL-2.0-or-later

135KB
3.5K SLoC

tada

命令行 todo.txt 管理器。

Latest version CI codecov Documentation Licence

状态

早期开发,但可使用。

用法

tada 命令默认操作您主目录中的名为 "todo.txt" 和 "done.txt" 的文件。这些文件应使用 todo.txt 格式进行格式化;每行一个任务。允许空行,以 "#" 开头的行被视为注释并被忽略。

您可以使用环境变量 TODO_FILEDONE_FILE 指定不同的文件,或者使用命令行标志实现相同的功能。存在 TODO_DIR 环境变量,它会影响这两个文件。

Tada 通常沿着三个主要向量对任务进行分类

  • 紧急性 - 也就是说,从哪个日期开始,执行任务就会“太晚”
  • 重要性 -任务完成的重要性如何
  • 衬衫尺寸 - 任务是小型、中型还是大型?

人们经常混淆紧急性和重要性。在电视上观看足球比赛可能很紧急,因为比赛将在十分钟后开始,但它可能并不那么重要。提交您的税收可能并不紧急,但因为没有完成它的后果是严重的,所以它很重要。重要性通过设置优先级大写字母 (A)(E) 来表示。(E 后面的字母是允许的,但将被视为基本上等效。)

截止日期通过在任务描述中包含 due:YYYY-MM-DD 来表示,紧急性将基于截止日期的接近程度或是否已过期来计算。也可以使用 start:YYYY-MM-DD 在任务上设置开始日期。在此日期之前,任务将以灰色显示。(所有日期都是日期,不是日期时间。)

T恤尺码通过在任务标记中使用 @S@M@L 来表示。作为一个粗略的指导,不到一小时的任务可能是小的,不到一天的任务可能是中等的,其他任务可能是大的。但你比我更清楚你的任务通常有多大,所以你可能需要不同的阈值。Tada 对 @S@M@L 分别代表分钟、小时或天没有任何假设;只是这三种尺寸存在。允许使用如 @XS@XXL 这样的标签,但它们将被视为 @S@L 的同义词。

A todo list manager

Usage: tada <COMMAND>

Commands:
  add        Add a task to the todo list
  remove     Remove a task or tasks
  edit       Open your todo list in your editor
  pull       Reschedule a task or tasks to be done today (or another
                 date)
  done       Mark a task or tasks as done
  find       Search for a task
  show       Show the full todo list
  important  Show the most important tasks
  urgent     Show the most urgent tasks
  quick      Show the smallest tasks
  archive    Move completed tasks from todo.txt to done.txt
  tidy       Remove blank lines and comments from a todo list
  zen        Automatically reschedule overdue tasks
  path       Prints the full path to your todo list
  help       Print this message or the help of the given
                 subcommand(s)

Options:
  -h, --help     Print help information
  -V, --version  Print version information

可以使用快捷键 tada itada utada q 来显示重要、紧急和快速的任务。

可以使用快捷键 tada +projecttada @contexttada #linenumber 作为按项目、上下文和行号查找项目的快捷方式。

tada add

Add a task to the todo list

Usage: tada add [OPTIONS] [task]

Arguments:
  [task]  Task text (may use todo.txt features)

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --no-date           Don't automatically add a creation date to the
                          task
      --no-fixup          Don't try to fix task syntax
      --quiet             Quieter output
  -T, --today             Include a due date of today
  -S, --soon              Include a due date of overmorrow
  -W, --next-week         Include a due date the end of next week
  -M, --next-month        Include a due date the end of next month
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -h, --help              Print help information

After success, displays the added task.

tada remove

Remove a task or tasks

Usage: tada remove [OPTIONS] <search-term>...

Arguments:
  <search-term>...  A tag, context, line number, or string

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -y, --yes               Assume 'yes' to prompts
  -n, --no                Assume 'no' to prompts
  -h, --help              Print help information

tada edit

Open your todo list in your editor

Usage: tada edit [OPTIONS]

Options:
  -f, --file <FILE>  The path or URL for todo.txt
  -l, --local        Look for files in local directory only
  -h, --help         Print help information

Ensure the EDITOR environent variable is set.

tada pull

Reschedule a task or tasks to be done today (or another date)

Usage: tada pull [OPTIONS] <search-term>...

Arguments:
  <search-term>...  A tag, context, line number, or string

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -T, --today             Set a due date of today (default)
  -S, --soon              Set a due date of overmorrow
  -W, --next-week         Set a due date the end of next week
  -M, --next-month        Set a due date the end of next month
  -y, --yes               Assume 'yes' to prompts
  -n, --no                Assume 'no' to prompts
  -h, --help              Print help information

If a task has a start date, that will be set to today.

tada done

Mark a task or tasks as done

Usage: tada done [OPTIONS] <search-term>...

Arguments:
  <search-term>...  A tag, context, line number, or string

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
      --no-date           Don't automatically add a completion date to
                          the task
  -y, --yes               Assume 'yes' to prompts
  -n, --no                Assume 'no' to prompts
  -h, --help              Print help information

tada find

Search for a task

Usage: tada find [OPTIONS] <search-term>...

Arguments:
  <search-term>...  A tag, context, line number, or string

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -s, --sort <BY>         Sort by 'smart', 'urgency', 'importance',
                          'size', 'alpha', or 'due' (default: smart)
  -h, --help              Print help information

Multiple search terms may be provided, which will be combined with an
'AND' operator.

Searches are case-insensitive.

tada show

Show the full todo list

Usage: tada show [OPTIONS]

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -s, --sort <BY>         Sort by 'smart', 'urgency', 'importance',
                          'size', 'alpha', or 'due' (default: smart)
  -i, --importance        Group by importance
  -u, --urgency           Group by urgency
  -z, --size              Group by tshirt size
  -h, --help              Print help information

tada important

Show the most important tasks

Usage: tada important [OPTIONS]

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -n, --number <N>        Maximum number to show (default: 3)
  -s, --sort <BY>         Sort by 'smart', 'urgency', 'importance',
                          'size', 'alpha', or 'due' (default:
                          importance)
  -h, --help              Print help information

Ignores tasks which are marked as already complete or have a start date
in the future.

tada urgent

Show the most urgent tasks

Usage: tada urgent [OPTIONS]

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -n, --number <N>        Maximum number to show (default: 3)
  -s, --sort <BY>         Sort by 'smart', 'urgency', 'importance',
                          'size', 'alpha', or 'due' (default: urgency)
  -h, --help              Print help information

Ignores tasks which are marked as already complete or have a start date
in the future.

tada quick

Show the smallest tasks

Usage: tada quick [OPTIONS]

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --colour            Coloured output
      --no-colour         Plain output
      --max-width <COLS>  Maximum width of terminal output
  -L, --show-lines        Show line numbers for tasks
      --show-created      Show 'created' dates for tasks
      --show-finished     Show 'finished' dates for tasks
  -n, --number <N>        Maximum number to show (default: 3)
  -s, --sort <BY>         Sort by 'smart', 'urgency', 'importance',
                          'size', 'alpha', or 'due' (default: size)
  -h, --help              Print help information

Ignores tasks which are marked as already complete or have a start date
in the future.

tada archive

Move completed tasks from todo.txt to done.txt

Usage: tada archive [OPTIONS]

Options:
  -f, --file <FILE>       The path or URL for todo.txt
  -l, --local             Look for files in local directory only
      --done-file <FILE>  The path or URL for done.txt
      --colour            Coloured output
      --no-colour         Plain output
  -h, --help              Print help information

tada tidy

Remove blank lines and comments from a todo list

Usage: tada tidy [OPTIONS]

Options:
  -f, --file <FILE>  The path or URL for todo.txt
  -l, --local        Look for files in local directory only
  -s, --sort <BY>    Sort by 'smart', 'urgency', 'importance', 'size',
                     'alpha', or 'due' (default: original)
  -h, --help         Print help information

This is the only command which will renumber tasks in your todo list.

tada zen

Automatically reschedule overdue tasks

Usage: tada zen [OPTIONS]

Options:
  -f, --file <FILE>  The path or URL for todo.txt
  -l, --local        Look for files in local directory only
      --colour       Coloured output
      --no-colour    Plain output
  -h, --help         Print help information

Zen will reschedule any overdue tasks on your todo list. It does not
consult you to ask for a new due date, but guesses when a sensible due
date might be.

zen 精确的工作方式可能会改变,但它将旨在首先重新安排既小又重要的任务,然后是既小又重要的任务,最后是较大且不那么重要的任务。它只会重新安排那些已经逾期且未完成的任务。

tada path

Prints the full path to your todo list

Usage: tada path [OPTIONS]

Options:
  -f, --file <FILE>  The path or URL for todo.txt
  -l, --local        Look for files in local directory only
  -h, --help         Print help information

This allows things like:

  /path/to/some/editor `tada path`

tada help

Print this message or the help of the given subcommand(s)

Usage: tada help [COMMAND]...

Arguments:
  [COMMAND]...  Print help for the subcommand(s)

重复任务

tada 没有任何对重复任务的支持。但是,应该可以很容易地设置一个 cron 作业来按计划将任务添加到你的列表中。例如,为了在每个周五早上将紧急任务添加到你的待办事项列表中

1  0  *  *  5  tada add --today 'Take out the trash @home'

协议支持

可以将 TADA_FILE--file 选项设置为 HTTP 或 HTTPS URL。它执行 GET 请求来读取文件,并执行 PUT 来写入文件。

可以使用 TADA_HTTP_USER_AGENTTADA_HTTP_AUTHORIZATIONTADA_HTTP_FROM 环境变量来进行一些非常基本的身份验证,如果请求另一端的服务器设置正确。请参阅 php-tada-server 以获取示例。

文件格式

如上所述,待办文件应采用 todo.txt 格式。仅由空白字符组成的行将被忽略。以 # 开头的行被视为注释并忽略。

tada 在描述中识别以下特殊标签

上下文标签

  • 使用 @S@M@L 上下文来表示任务是否为小、中或大。
  • 如果任务具有上下文 @work@school,它将避免自动安排在周六或周日。

键值标签

  • due:YYYY-MM-DD 为任务设置截止日期。
  • start:YYYY-MM-DD 设置任务的开始日期。

许可证

本项目在以下三个许可证下进行三重授权:Apache License,版本2.0、MIT许可证和GNU通用公共许可证,版本2.0。

贡献

除非您明确表示,否则您有意提交的任何贡献,均将按照Apache-2.0/MIT/GPL-2.0三重授权,不附加任何额外条款或条件。

依赖项

~12–30MB
~449K SLoC