Skip to content

Configuration Reference

David Waring edited this page Sep 5, 2022 · 7 revisions

RTM CLI has a number of properties that can be configured using a separate JSON configuration file. The default user configuration file is located at $HOME/.rtm.json but can be changed using the --config <file> option.

For convenience, if you want to separate the storage of your account credentials and the RTM CLI configuration properties, the $HOME/.rtm.config.json file, if present, will be read and parsed in addition to the $HOME/.rtm.json file.

The RTM account credentials will still be stored in $HOME/.rtm.json. You can put your configuration properties in $HOME/.rtm.config.json.

NOTE: If the --config flag is used to provide a configuration file, only that configuration file will be used.

Default Properties

The default configuration is as follows:

{
  "dateformat": "ddd mmm-dd",
  "plannerDateformat": "ddd",
  "completed": 7,
  "hideDue": false,
  "plain": false,
  "status": true,
  "styles": {
    "list": "yellow.underline",
    "index": "dim",
    "priority": {
      "0": "reset",
      "1": "red",
      "2": "blue",
      "3": "cyan"
    },
    "completed": "dim",
    "notes": "reset",
    "tags": "magenta",
    "due": "green"
  },
  "iconType": "text",
  "aliases": [
    {
      "name": "overdue",
      "description": "Display all tasks that are overdue",
      "command": "lsd",
      "args": "dueBefore:today AND status:incomplete"
    }
  ],
  "plugins": [
    "{{HOME}}/.rtm.plugins/"
  ]
}

Custom Aliases

Custom meta-commands can be added to your configuration file's aliases property. This property is a list of aliased commands that reference an existing command and can provide pre-defined arguments. This can be used to create a meta-command that uses one of the existing display commands (such as ls) and a pre-set filter string (using RTM's Advanced Search Syntax).

The included overdue command is a meta-command added to the default configuration.

To create your own meta command, add the aliases property to your configuration file (located at $HOME/.rtm.json by default). The example below creates the important command listing incomplete tasks with a priority of 1, using the existing ls command.

{
  "aliases": [
    {
      "name": "important",
      "description": "Display incomplete tasks with a priority of 1",
      "command": "ls",
      "args": "priority:1 AND status:incomplete"
    }
  ]
}

The name property gives the command name, description is the command description given in the help output, command is the existing command to map the new one to, and args provide the arguments (such as the filter string) to the command.

Property Definitions

The following is a list of all configuration properties, their descriptions, and default values.

Property Type Description Default
client object

RTM API Client Information

Property Type Description Default
key string RTM API Key RTM CLI API Key
secret string RTM API Secret RTM CLI API Secret
perms string

RTM API Permissions

  • read
  • write
  • delete
delete

RTM CLI includes an RTM API client key/secret but you can override these with your own, if you prefer.

dateformat string

Date Display Format

This property describes how dates will be formatted when displayed in the task lists generated by the ls, lsd, and lsp commands.

The format is parsed by the dateformat node module. Mask options are described in that project's README.

ddd mmm-dd
plannerDateformat string

Planner Date Display Format

This property describes how dates will be formatted when displayed in the headers of the planner table.

The format is parsed by the dateformat node module. Mask options are described in that project's README.

ddd
completed boolean or integer

Display Completed Tasks

The display of completed tasks can be changed to include all, none or some of the completed tasks with the following values:

  • true: display all completed tasks
  • false: don't display any completed tasks
  • n > 0: display tasks completed within the last n days

This can be overridden using the --completed [value] flag at the command line.

7
hideDue boolean or integer

Hide Tasks Due in Future

This property can be configured to hide tasks that have a due date set more than n days in the future. Valid values for this property include:

  • false: Do not hide any tasks based on due date
  • n > 0: Hide tasks with a due date greater than n days from today

This can be overridden using the --hideDue [value] flag at the command line.

false
plain boolean

Display Plain Text

When set to true, output text will not be styled and/or colored.

This can be overridden using the --plain or --color flags at the command line.

false
status boolean

Display Status Text

When set to true, the status/spinner messages (such as 'Getting Tasks...') will be displayed.

This can be overridden using the --status flag at the command line.

true
styles object

Task Attribute Styles

Different attributes of tasks can have different styles applied to them when displayed.

Styles are applied using the chalk npm module and can include the styles listed on that project's README and can be combined using a .:

Property Type Description Default
list string List Name yellow.underline
index string Index Number dim
priority object

Task Priorities

Property Type Description Default
0 string No Priority reset
1 string Priority 1 red
2 string Priority 2 blue
3 string Priority 3 cyan
completed string Completed Tasks dim
notes string Notes Indicator reset
tags string Tags magenta
due string Due Dates green
iconType string

Icon Type

Define how to display note and url indicators. The value can be either text to use plain text symbols or emoji to display emoji icons.

text
aliases object[]

Command Aliases

This configuration property allows you to define your own meta-commands that map a new command name to an existing command (such as ls, planner, etc) with a pre-defined set of arguments (such as a filter string using RTM's advanced search syntax). The today command is already included in the default configuration and can be used as an example.

Property Type Description Default
name string Command Name today
description string Command Description - will be used in the help output Display tasks with a priority, due or completed today, or overdue
command string Command - the existing command to execute. lsp
args string Options and arguments to pass to the specified command. (not priority:none and status:incomplete) or completed:today or (dueBefore:tomorrow and status:incomplete)
plugins string[] This property provides a list of locations for command plugins. The default location is the .rtm.plugins/ directory in the User's Home directory. Values added to this list can include:
  • Node Module Name - such as a globally installed module that can be loaded via require({name}).
  • A Plugin File or Directory - the absolute file path to a single JavaScript file that exports a RTM CLI command or the absolute file path to a directory representing a locally installed Node module that exports a RTM CLI command(s).
  • Directory - the absolute file path to a directory containing plugins (files or module directories)
["{{HOME}}/.rtm.plugins/"]