Skip to content
 
 

Repository files navigation

task.json-cli

Version License

Command line task management app for task.json written in Node.js.

Screenshots

Screenshot

Features

  • User-friendly command-line interface
  • Highlighting for urgent tasks
  • Filtering tasks by various field
  • Sync with remote task.json-server
  • Workspace support
  • ZSH autocompletion

Installation

npm i -g task.json-cli

Environment Variables

  • TASK_JSON_PATH: the path of task.json data (default: $HOME/.config/task.json)

Migration from v5 to v6

Move the data from $HOME/.task.json to $HOME/.config/task.json.

Usage

$ npm install -g task.json-cli
$ tj COMMAND
running command...
$ tj (-v|--version|version)
task.json-cli/6.2.2 linux-x64 node-v17.8.0
$ tj --help [COMMAND]
USAGE
  $ tj COMMAND
...

Commands

tj add TEXT

Add a new task

USAGE
  $ tj add TEXT

ARGUMENTS
  TEXT  text of the task

OPTIONS
  -D, --deps=deps          dependencies (use #)
  -P, --priority=priority  priority (A-Z)
  -c, --contexts=contexts  one or more contexts
  -d, --due=due            due date
  -h, --help               show CLI help
  -p, --projects=projects  one or more projects
  -w, --wait=wait          wait until date
  --no-workspace           ignore workspace settings temporarily

EXAMPLES
  $ tj add Hello World
  $ tj add "Hello World" -p test -p greeting -c test --due 2020-12-24
  $ tj add Hello World -p test -D t1 -D t2

See code: src/commands/add.ts

tj autocomplete DIR

Install completion file

USAGE
  $ tj autocomplete DIR

ARGUMENTS
  DIR  Install completion files to specific directory

OPTIONS
  -h, --help  show CLI help
  --zsh       Install zsh completion

EXAMPLE
  $ tj autocomplete --zsh ~/.zsh_completion

See code: src/commands/autocomplete.ts

tj config

Modify or show config

USAGE
  $ tj config

OPTIONS
  -h, --help                    show CLI help
  -r, --reset=server|token|all  reset configurations (server, token, all)
  -s, --server=server           set server address
  -t, --token=token             set token for login

EXAMPLES
  $ tj config  # show config
  $ tj config --server "http://localhost:3000"  # set config
  $ tj config --reset all  # reset all config
  $ tj config -r server -r token # reset server and token

See code: src/commands/config.ts

tj detail NUM...

Show task details

USAGE
  $ tj detail NUM...

ARGUMENTS
  NUM...  tasks to show details of

OPTIONS
  -h, --help  show CLI help
  --iso       show date in ISO format

EXAMPLES
  $ tj detail t1
  $ tj detail t1 d1

See code: src/commands/detail.ts

tj do NUM...

Mark tasks as done

USAGE
  $ tj do NUM...

ARGUMENTS
  NUM...  mark specific tasks as done

OPTIONS
  -h, --help  show CLI help

EXAMPLES
  $ tj do t1
  $ tj do t1 t2

See code: src/commands/do.ts

tj due

Show most recent due date

USAGE
  $ tj due

OPTIONS
  -h, --help  show CLI help
  --iso       show most recent due date in ISO format

EXAMPLE
  $ tj due

See code: src/commands/due.ts

tj erase NUM...

Erase removed tasks

USAGE
  $ tj erase NUM...

ARGUMENTS
  NUM...  erase specific removed tasks

OPTIONS
  -f, --force  force erasing without confirmation
  -h, --help   show CLI help

EXAMPLE
  $ tj erase r1

See code: src/commands/erase.ts

tj help [COMMAND]

display help for tj

USAGE
  $ tj help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

tj login

Log into the server

USAGE
  $ tj login

OPTIONS
  -h, --help               show CLI help
  -p, --password=password  log in with password

EXAMPLES
  $ tj login  # interactive input the password
  $ tj login --password "xxx"  # log in with password

See code: src/commands/login.ts

tj ls

List tasks

USAGE
  $ tj ls

OPTIONS
  -D, --deps                         show dependent tasks and dependencies
  -P, --priorities=priorities        filter tasks by priorities (A-Z)
  -T, --types=todo|done|removed|all  [default: todo] filter tasks by types (todo, done, removed, all)
  -c, --contexts=contexts            filter tasks by specific contexts
  -h, --help                         show CLI help
  -p, --projects=projects            filter tasks by specific projects
  -w, --wait                         show waiting tasks
  --and-contexts                     filter contexts using AND operator instead of OR
  --and-projects                     filter projects using AND operator instead of OR
  --no-workspace                     ignore workspace settings temporarily

EXAMPLES
  $ tj ls
  $ tj ls -p test
  $ tj ls -c ""  # list tasks without contexts
  $ tj ls -p projA -p projB  # list tasks with projA or projB

See code: src/commands/ls.ts

tj lsctx

List contexts

USAGE
  $ tj lsctx

OPTIONS
  -T, --types=todo|done|removed|all  [default: todo] list contexts of tasks of types (todo, done, removed, all)
  -h, --help                         show CLI help
  -n, --negative                     include negative representation (! symbol before contexts)

EXAMPLES
  $ tj lsctx
  $ tj lsctx -T all

See code: src/commands/lsctx.ts

tj lsnum

List Numbers

USAGE
  $ tj lsnum

OPTIONS
  -T, --types=todo|done|removed|all  [default: todo] list numbers of tasks of types (todo, done, removed, all)
  -h, --help                         show CLI help

EXAMPLES
  $ tj lsnum
  $ tj lsnum -T all
  $ tj lsnum -T done

See code: src/commands/lsnum.ts

tj lsproj

List projects

USAGE
  $ tj lsproj

OPTIONS
  -T, --types=todo|done|removed|all  [default: todo] list projects of tasks of types (todo, done, removed, all)
  -h, --help                         show CLI help
  -n, --negative                     include negative representation (! symbol before projects)

EXAMPLES
  $ tj lsproj
  $ tj lsproj -T all

See code: src/commands/lsproj.ts

tj modify [NUM...]

Modify tasks (use a single empty string to delete the field or filter tasks without it)

USAGE
  $ tj modify [NUM...]

ARGUMENTS
  NUM...  modify specific tasks

OPTIONS
  -D, --deps=deps                        modify dependencies
  -P, --priority=priority                modify priority (A-Z)

  -T, --types=todo|done|removed|all      filter tasks by types (todo, done, removed, all) [default: all (if no number
                                         specified)]

  -c, --contexts=contexts                modify contexts (overwrite all)

  -d, --due=due                          modify due date

  -h, --help                             show CLI help

  -p, --projects=projects                modify projects (overwrite all)

  -t, --text=text                        modify text

  -w, --wait=wait                        modify wait date

  --and-contexts                         filter contexts using AND operator instead of OR

  --and-projects                         filter projects using AND operator instead of OR

  --filter-contexts=filter-contexts      filter tasks by specific contexts

  --filter-priorities=filter-priorities  filter tasks by priority (A-Z)

  --filter-projects=filter-projects      filter tasks by specific projects

EXAMPLES
  $ tj modify t1 -d 2020-12-12
  $ tj modify d2 d3 -p projA -p projB
  $ tj modify t1 -t "New description"
  $ tj modify t2 -p ""  # delete projects field
  $ tj modify -T todo --filter-projects projA -p projB # Modify all projA to projB

See code: src/commands/modify.ts

tj restore

Undo the last modification using the bak file

USAGE
  $ tj restore

OPTIONS
  -f, --force  force overwriting without confirmation
  -h, --help   show CLI help

EXAMPLES
  $ tj restore
  $ tj restore -f

See code: src/commands/restore.ts

tj rm NUM...

Delete tasks

USAGE
  $ tj rm NUM...

ARGUMENTS
  NUM...  delete specific tasks

OPTIONS
  -h, --help  show CLI help

EXAMPLES
  $ tj rm t1
  $ tj rm d1

See code: src/commands/rm.ts

tj sync

Sync local task.json with server

USAGE
  $ tj sync

OPTIONS
  -d, --download  download task.json from server to overwrite the local one
  -f, --force     overwrite without confirmation
  -h, --help      show CLI help
  -u, --upload    upload local task.json to overwrite the one on server

EXAMPLES
  $ tj sync
  $ tj sync --upload
  $ tj sync --download --force

See code: src/commands/sync.ts

tj undo NUM...

Undo tasks

USAGE
  $ tj undo NUM...

ARGUMENTS
  NUM...  undo specific done or removed tasks

OPTIONS
  -h, --help  show CLI help

EXAMPLES
  $ tj undo d1 d2
  $ tj undo r1 r2  # restore removed tasks

See code: src/commands/undo.ts

tj workspace

Set workspace

USAGE
  $ tj workspace

OPTIONS
  -c, --contexts=contexts                                      set current contexts (auto filter and set contexts for
                                                               other commands [add, ls] if not specified. empty to
                                                               reset)

  -h, --help                                                   show CLI help

  -p, --projects=projects                                      set current projects (auto filter and set projects for
                                                               other commands [add, ls] if not specified. empty to
                                                               reset)

  -r, --reset=contexts|projects|all|and-projects|and-contexts  reset fields (projects, contexts, all) to empty

  --and-contexts                                               filter contexts using AND operator instead of OR

  --and-projects                                               filter projects using AND operator instead of OR

EXAMPLES
  $ tj workspace -c ctxA
  $ tj workspace -c ctxA -c ctxB -p projA
  $ tj workspace -p ""  # set projects to empty
  $ tj workspace -r projects  # reset projects to empty
  $ tj workspace -r all # reset both ctx and proj to empty

See code: src/commands/workspace.ts

About

Command-line todo management app based on task.json format

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages