-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathcli.js
executable file
·44 lines (40 loc) · 956 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
import meow from 'meow';
import syncActivity from './src/sync.js';
const cli = meow(
`
Usage
$ wakatime-to-toggl -w <wakatime-api-key> -t <toggl-api-key>
Options
--wakatime, -w Your Wakatime api key
--toggl, -t Your Toggl api key
--day, -d The day to fetch. 0 is today, 1 is yesterday... Default: 1
--min-duration -m Minimum duration (in seconds) of entries to sync. Default: 120
`,
{
flags: {
wakatime: {
type: 'string',
shortFlag: 'w',
isRequired: true,
},
toggl: {
type: 'string',
shortFlag: 't',
isRequired: true,
},
day: {
type: 'number',
shortFlag: 'd',
default: 1,
},
minDuration: {
type: 'number',
shortFlag: 'm',
default: 120,
},
},
importMeta: import.meta,
},
);
syncActivity(cli.flags);