@beauraines/rtm-cli 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.github/FUNDING.yml +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +143 -0
  4. package/build.js +86 -0
  5. package/config.json +40 -0
  6. package/package.json +58 -0
  7. package/screens/ls.png +0 -0
  8. package/screens/lsd.png +0 -0
  9. package/screens/lsp.png +0 -0
  10. package/screens/planner.png +0 -0
  11. package/src/cli.js +434 -0
  12. package/src/cmd/add.js +100 -0
  13. package/src/cmd/addList.js +92 -0
  14. package/src/cmd/addTags.js +85 -0
  15. package/src/cmd/archiveList.js +78 -0
  16. package/src/cmd/comp.js +82 -0
  17. package/src/cmd/decPri.js +82 -0
  18. package/src/cmd/due.js +82 -0
  19. package/src/cmd/edit.js +82 -0
  20. package/src/cmd/incPri.js +82 -0
  21. package/src/cmd/lists.js +60 -0
  22. package/src/cmd/login.js +27 -0
  23. package/src/cmd/logout.js +31 -0
  24. package/src/cmd/ls.js +181 -0
  25. package/src/cmd/lsd.js +193 -0
  26. package/src/cmd/lsp.js +171 -0
  27. package/src/cmd/move.js +83 -0
  28. package/src/cmd/notes.js +150 -0
  29. package/src/cmd/planner.js +510 -0
  30. package/src/cmd/postpone.js +82 -0
  31. package/src/cmd/pri.js +82 -0
  32. package/src/cmd/remove.js +82 -0
  33. package/src/cmd/removeList.js +79 -0
  34. package/src/cmd/removeTags.js +85 -0
  35. package/src/cmd/renameList.js +80 -0
  36. package/src/cmd/reset.js +35 -0
  37. package/src/cmd/setUrl.js +99 -0
  38. package/src/cmd/tags.js +101 -0
  39. package/src/cmd/uncomp.js +82 -0
  40. package/src/cmd/url.js +92 -0
  41. package/src/cmd/whoami.js +36 -0
  42. package/src/interactive.js +65 -0
  43. package/src/utils/config.js +236 -0
  44. package/src/utils/filter.js +43 -0
  45. package/src/utils/finish.js +21 -0
  46. package/src/utils/index.js +10 -0
  47. package/src/utils/log.js +163 -0
  48. package/src/utils/login.js +69 -0
  49. package/src/utils/printIndicator.js +43 -0
  50. package/src/utils/prompt.js +126 -0
  51. package/src/utils/sort.js +283 -0
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [dwaring87] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: davidwaring # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 David Waring
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,143 @@
1
+ Remember The Milk Command Line Interface
2
+ ========================================
3
+
4
+ **node module:** [rtm-cli](https://www.npmjs.com/package/rtm-cli)<br />
5
+ **GitHub repo:** [dwaring87/rtm-cli](https://github.com/dwaring87/rtm-cli)
6
+
7
+ ---
8
+
9
+ This Node module provides a command line interface, written in JavaScript,
10
+ for the popular [Remember the Milk](https://www.rememberthemilk.com/) task list
11
+ manager.
12
+
13
+ ![](https://raw.githubusercontent.com/dwaring87/rtm-cli/master/screens/ls.png)
14
+
15
+
16
+ ## Installation
17
+
18
+ ### NPM
19
+
20
+ If you already have [Node](https://nodejs.org) installed, this program can be
21
+ installed via `npm`:
22
+
23
+ ```shell
24
+ npm install -g rtm-cli
25
+ ```
26
+
27
+ which will install the executable `rtm` into your `$PATH`.
28
+
29
+ **Note:** RTM CLI requires Node version >= 7.5.0
30
+
31
+ ### Executable Releases
32
+
33
+ Standalone executables, that do not require a pre-existing installation of Node,
34
+ are available in the [Releases](https://github.com/dwaring87/rtm-cli/releases)
35
+ page.
36
+
37
+
38
+ ## Usage
39
+
40
+ The main usage of the program:
41
+
42
+ ```
43
+ Usage: rtm [options] <command> [command arguments]
44
+
45
+
46
+ Options:
47
+
48
+ -V, --version output the version number
49
+ -p, --plain do not use styled/colored text (overrides --color)
50
+ -c, --color force the use of styled/colored text
51
+ -s, --status toggle the display of the status spinner
52
+ -x, --completed [value] set display of completed tasks (true/false/number of days)
53
+ -d, --hideDue [value] hide tasks due more than n days from today (false/number of days)
54
+ -f, --config [file] specify configuration file
55
+ -v, --verbose print stack traces on errors
56
+ -h, --help output usage information
57
+
58
+
59
+ Commands:
60
+
61
+ add|a [task...] Add a new Task
62
+ addList|al [name] [filter...] Add a new List or Smart List
63
+ addTags|at [index] [tags...] Add one or more tags to a Task
64
+ archiveList|arl [name...] Archive a List
65
+ comp|x [indices...] Complete one or more Tasks
66
+ decPri|- [indices...] Decrease the Priority of one or more Tasks
67
+ due [index] [due...] Set the Due Date of a Task
68
+ edit [index] [name...] Change the name of a Task
69
+ incPri|+ [indices...] Increase the Priority of one or more Tasks
70
+ lists|l Display all lists
71
+ login Add RTM User information
72
+ logout Remove RTM User information
73
+ ls [filter...] List all tasks sorted first by list then by priority
74
+ lsd [filter...] List all tasks sorted first by due date then by priority
75
+ lsp [filter...] List all tasks sorted first by priority then due date
76
+ move|mv [index] [list...] Move Task to a different List
77
+ planner [options] [filter...] Display tasks in a weekly planner (--start: sun, mon, today)
78
+ postpone|pp [indices...] Postpone one or more Tasks
79
+ pri|p [index] [priority] Change Task Priority
80
+ remove|rm [indices...] Remove one or more Tasks
81
+ removeList|rml [name...] Remove a List
82
+ removeTags|rmt [index] [tags...] Remove one or more tags from a Task
83
+ renameList|mvl [oldName] [newName] Rename a List
84
+ reset Reset cached task indices
85
+ setUrl|su [index] [url] Set the URL of a Task
86
+ tags|t Display all tags
87
+ uncomp|unc [indices...] Mark one or more Tasks as not complete
88
+ url [options] [index...] Display the associated URL of a Task
89
+ whoami Display RTM user information
90
+ overdue Display incomplete tasks that are overdue
91
+ ```
92
+
93
+
94
+ ### Interactive Mode
95
+
96
+ An interactive mode is started when no commands are given to `rtm`, which
97
+ allows commands to be given sequentially.
98
+
99
+ Use the `quit` command to leave the interactive mode.
100
+
101
+
102
+ ### Full Usage Information
103
+
104
+ For full documentation on the usage of the built-in commands and options,
105
+ see the [Command Reference](https://github.com/dwaring87/rtm-cli/wiki/Command-Reference).
106
+
107
+
108
+ ## Configuration
109
+
110
+ RTM CLI has a number of properties that can be configured using a separate JSON configuration
111
+ file. The default user configuration file is located at `$HOME/.rtm.json` but can be changed
112
+ using the `--config <file>` option.
113
+
114
+ Currently, the configuration can customize:
115
+
116
+ - the formats of displayed dates
117
+ - styled text output for different task properties
118
+ - the display of completed tasks
119
+ - the display of tasks with due dates in the future
120
+ - **custom aliases** for existing commands
121
+ - these are useful for applying commonly used [RTM advanced search](https://www.rememberthemilk.com/help/answer/basics-search-advanced)
122
+ filters to display commands
123
+ - ex: `overdue` = `ls dueBefore:today AND status:incomplete`
124
+
125
+
126
+ For full documentation on the configuration properties, see the
127
+ [Configuration Reference](https://github.com/dwaring87/rtm-cli/wiki/Configuration-Reference).
128
+
129
+
130
+ ## Plugins
131
+
132
+ RTM CLI supports adding additional commands through plugins.
133
+
134
+ **Available Plugins:**
135
+
136
+ - Export - [rtm-plugin-export](https://github.com/dwaring87/rtm-plugin-export)
137
+ - Provides an `export` command to export tasks to a CSV file
138
+
139
+ For information on installing plugins, see the
140
+ [Plugin Reference](https://github.com/dwaring87/rtm-cli/wiki/Plugin-Reference).
141
+
142
+ For information on creating commands, see the **Creating Commands** section
143
+ in the [Project Wiki](https://github.com/dwaring87/rtm-cli/wiki#creating-commands).
package/build.js ADDED
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+ const pkg = require('pkg');
7
+ const archiver = require('archiver');
8
+ const config = require('./package.json');
9
+
10
+ // Build Paths
11
+ const configPath = path.dirname(require.resolve('./package.json'));
12
+ const binPath = path.normalize(configPath + '/' + config.pkg.out);
13
+
14
+
15
+
16
+ clean();
17
+ build()
18
+ .then(pack);
19
+
20
+
21
+
22
+ /**
23
+ * Clean the Bin Directory
24
+ */
25
+ function clean() {
26
+ console.log();
27
+ console.log("CLEANING...");
28
+ let files = fs.readdirSync(binPath);
29
+ for ( let file of files ) {
30
+ fs.unlinkSync(path.normalize(binPath + '/' + file));
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Build Binaries using PKG
36
+ * @returns Promise
37
+ */
38
+ function build() {
39
+ console.log();
40
+ console.log("BUILDING...");
41
+ return pkg.exec(['./package.json', '--targets', config.pkg.targets, '--out-dir', binPath]);
42
+ }
43
+
44
+ /**
45
+ * Pack the Binaries into separate zip files
46
+ */
47
+ function pack() {
48
+ console.log();
49
+ console.log("PACKAGING...");
50
+
51
+ let bins = fs.readdirSync(binPath);
52
+ for ( let bin of bins ) {
53
+ if ( bin.includes('rtm-cli-') ) {
54
+ let parts = bin.split('-');
55
+ let os = parts[2];
56
+ let arch = parts[3];
57
+ let name = 'rtm';
58
+ let version = config.version;
59
+ let zipName = name + '-' + os + '.' + arch + '-' + version + '.zip';
60
+
61
+ let zipFile = path.normalize(binPath + '/' + zipName);
62
+ let binFile = path.normalize(binPath + '/' + bin);
63
+
64
+ let zip = fs.createWriteStream(zipFile);
65
+ let archive = archiver('zip', {zib: {level: 9}});
66
+
67
+ zip.on('close', function() {
68
+ fs.unlinkSync(binFile);
69
+ console.log("..." + bin);
70
+ });
71
+
72
+ zip.on('error', function(err) {
73
+ throw err;
74
+ });
75
+
76
+ if ( os === 'win' ) {
77
+ name = name + '.exe';
78
+ }
79
+
80
+ archive.pipe(zip);
81
+ archive.file(binFile, {name: name});
82
+ archive.finalize();
83
+ }
84
+ }
85
+ }
86
+
package/config.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "client": {
3
+ "key": "cbc76268b901ccb8d9fc5f3aebc4ee1f",
4
+ "secret": "131beea786379309",
5
+ "perms": "delete"
6
+ },
7
+ "dateformat": "ddd mmm-dd",
8
+ "plannerDateformat": "ddd",
9
+ "completed": 7,
10
+ "hideDue": false,
11
+ "plain": false,
12
+ "status": true,
13
+ "styles": {
14
+ "list": "yellow.underline",
15
+ "index": "dim",
16
+ "priority": {
17
+ "0": "reset",
18
+ "1": "red",
19
+ "2": "blue",
20
+ "3": "cyan"
21
+ },
22
+ "completed": "dim",
23
+ "notes": "yellow",
24
+ "url": "yellow",
25
+ "tags": "magenta",
26
+ "due": "green"
27
+ },
28
+ "iconType": "text",
29
+ "aliases": [
30
+ {
31
+ "name": "overdue",
32
+ "description": "Display incomplete tasks that are overdue",
33
+ "command": "lsd",
34
+ "args": "dueBefore:today AND status:incomplete"
35
+ }
36
+ ],
37
+ "plugins": [
38
+ "{{HOME}}/.rtm.plugins/"
39
+ ]
40
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@beauraines/rtm-cli",
3
+ "version": "1.5.2",
4
+ "description": "RTM CLI",
5
+ "keywords": [
6
+ "rtm",
7
+ "cli",
8
+ "terminal",
9
+ "remember the milk",
10
+ "tasks",
11
+ "task manager",
12
+ "todo",
13
+ "gtd"
14
+ ],
15
+ "bin": {
16
+ "rtm": "src/cli.js"
17
+ },
18
+ "main": "src/utils/index.js",
19
+ "scripts": {
20
+ "postversion": "npm run build",
21
+ "build": "node build.js"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/beauraines/rtm-cli.git"
26
+ },
27
+ "author": "Beau Raines <beau.raines@gmail.com>",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://github.com/beauraines/rtm-cli/issues"
31
+ },
32
+ "homepage": "https://github.com/beauraines/rtm-cli#readme",
33
+ "dependencies": {
34
+ "chalk": "^2.3.0",
35
+ "cli-table3": "^0.5.0",
36
+ "commander": "^2.11.0",
37
+ "copy-paste": "^1.3.0",
38
+ "dateformat": "^3.0.2",
39
+ "deepmerge": "^2.0.1",
40
+ "opn": "^5.4.0",
41
+ "ora": "^1.3.0",
42
+ "prompt-sync": "^4.2.0",
43
+ "rtm-api": "@beauraines/rtm-api",
44
+ "window-size": "^1.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "archiver": "^2.1.0",
48
+ "pkg": "^4.3.3"
49
+ },
50
+ "pkg": {
51
+ "scripts": [
52
+ "config.json",
53
+ "src/cmd/*.js"
54
+ ],
55
+ "targets": "node8-linux-x86,node8-linux-x64,node8-macos-x86,node8-macos-x64,node8-win-x86,node8-win-x64",
56
+ "out": "./bin"
57
+ }
58
+ }
package/screens/ls.png ADDED
Binary file
Binary file
Binary file
Binary file