Google Calendar command line tool for Node.js
Programmatic event listing, insert or bulk insert made easy:
$ gcal insert 'Party tomorrow from 3pm to 5pm' Party: 2017-09-08T15:00:00+09:00 ~ 2017-09-08T17:00:00+09:00 https://www.google.com/calendar/event?eid=amNpMWE5cjg2bG80n2s0Nmg1ZWlqcW01OXMgdG9rYWdlcm9oQG0
$ echo \ '[{ "calendarId": "primary", "resource": { "summary": "Party", "start": { "dateTime": "2017-09-08T20:00" }, "end": { "dateTime": "2017-09-08T22:00" }} },{ "calendarId": "primary", "resource": { "summary": "Party again", "start": { "dateTime": "2017-09-08T22:00" }, "end": { "dateTime": "2017-09-08T23:30" }} }]' \ > events.json $ gcal bulk -e events.json Event inserted id: gif4hl86kgt7bmgq2ojvteqe2o summary: Party htmlLink: https://www.google.com/calendar/event?eid=Z2lmNGhsODZrZ3Q3Ym1ncTJvanZ0ZXFlMm8gdG9rYWdlcm9oQG0 Event inserted id: blrrb8kbrih3pq9mn10slii8ac summary: Party again htmlLink: https://www.google.com/calendar/event?eid=YmxycmI4a2JyaWgzcHE5bW4xMHNsaWk4YWMgdG9rYWdlcm9oQG0
$ gcal list Upcoming events (2017-09-07T00:00:00+09:00 ~ 2017-09-07T23:59:59+09:00) 2017-09-07 20:00 - My favorite TV show 2017-09-07 22:30 - Prepare tomorrow's meeting stuff
Install it as a global module:
npm install -g gcal
Authorization and authentication is done with OAuth 2.0.
Ok, this will take only 2 minutes:
You will need a file with your credentials: client ID
, client secret
and redirect URI
. This can be obtained in the Developer Console:
Credentials
Create credentials
→ OAuth client ID
( Application type
must be Other
)Once we got the credentials we must generate a consent page URL.
$ gcal generateUrl
(By default the credentials will be searched in your home directory under the name client_secret.json
).
The page will prompt you to authorize access, follow the instructions.
With the code we got through the authorization page, we can obtain a token and store it in our machine.
$ gcal storeToken <code>
(By default the token is stored in your home folder under the name calendar_api_token.json
).
NOTE: The token will expiry after one hour, but a refresh_token
is included as well, allowing the app to refresh automatically the token each time it's used.
With this we are good to go. The stored token and credentials files will be required from now on to use this tool.
List today events:
$ gcal list
List events using natural language (powered by Sherlock):
$ gcal list tomorrow
$ gcal list 'from 03/23/2017 to 03/27/2017'
$ gcal list 'from March 23th to 27th'
Or with specific ISO dates:
$ gcal list -f 2017-03-23 -t 2017-03-27
Insert events using natural language:
$ gcal insert 'Party tomorrow from 3pm to 5pm'
Insert events specifying the parameters:
$ gcal insert -s 'Party' -d 2017-03-23 -t 15:00 -D 2h
Bulk insert passing a .js
or .json
file:
events.json
[{
"calendarId": "primary",
"resource": {
"summary": "Having coffee with Okuyasu",
"location": "Morio City",
"description": "I'm not very imaginative now so some description goes here",
"start": {
"dateTime": "2017-09-08T09:00:00"
},
"end": {
"dateTime": "2017-09-08T10:00:00"
}
}
}, {
"calendarId": "primary",
"resource": {
"summary": "Defeat Dio",
"location": "179 Orouba St, Cairo",
"description": "Dio is a bad boy so I need to kick his ass asap",
"start": {
"date": "1987-06-01"
},
"end": {
"date": "1987-06-12"
}
}
}]
$ gcal bulk -e ./events.json
Using a .js
file can be useful for relative dates and more:
events.js
const today = new Date();
today.setHours('17', '00', '00');
const tomorrow = new Date(today.getTime()+1000*60*60*24);
module.exports = [{
"calendarId": "primary",
"resource": {
"summary": `Release`,
"start": {
"dateTime": today.toISOString()
},
"end": {
"dateTime": today.toISOString()
}
}
}, {
"calendarId": "primary",
"resource": {
"summary": "Release",
"start": {
"dateTime": tomorrow.toISOString()
},
"end": {
"dateTime": tomorrow.toISOString()
}
}
}];
$ gcal bulk -e ./events.js
The available properties are listed here.
Using the option -C <file>
the default config can be overwritten. This file must be .js
or .json
. Configurable options are located in ./conf.js.
Example:
/somepath/config.json
{
"CRED_PATH": "/my/secret/path/credentials.json",
"TOKEN_PATH": "/my/secret/path/token.json"
}
$ gcal -C /somepath/config.json generateUrl
Doing this you can store your credential files wherever you want.
Use the help
command. More details will be added soon.
$ gcal help
Usage:
gcal [-C <file>] [cmd] [--debug]
OPTIONS
-C, --config <file>
--debug
Commands:
list [<term> | [-f <date | datetime>] [-t <date | datetime>]] [-i]
List events. By default it shows today events (executed without arguments).
OPTIONS
-f, --from <date | datetime>
-t, --to <date | datetime>
-i, --show-id
insert <term> | -s <summary> -d <date> [-t <time>] [-D <duration>]
Insert events. <term> is specified in natural language, in case it's not specified,
-s and -d are mandatory.
OPTIONS
-s, --summary <summary>
-d, --date <date>
-t, --time <time>
-D, --duration <duration>
bulk -e <file>
Bulk insert of events. File can be .json or .js.
OPTIONS
-e, --events <file>
generateUrl
Generate consent page URL. In order to work client_secret.js must be in your
home folder.
storeToken <code>
Store Token in your home folder.
help
Show this help page.
Version 0.3.0 used an immersive-cli instead of shell commands. If you want to use it, go to the branch 0.3.0.
MIT © Antonio V
我用vue init webpack myvue 新建了一个vue项目,npm run dev能正常启动, 然后我又跟着B站老师安装了webpack和webpack-cli,后来再运行这个项目的时候就报错了: internal/modules/cjs/loader.js:892 throw err; ^ Error: Cannot find module ‘webpack-cli/bin/conf
一、介绍 今天继续redis-cli使用的介绍,上一篇文章写了一部分,写到第9个小节,今天就来完成第二部分。话不多说,开始我们今天的讲解。如果要想看第一篇文章,地址如下:http://www.cnblogs.com/PatrickLiu/p/8508975.html 二、使用详解 上篇文章写到第9个小节,今天直接按着以上的序号,继续来写
predix-cli predix-cli提供了一个操作predix云端的简化版命令行接口. 它对cf-cli做了封装并且提供了将以往复杂的多个步骤合并成一步的单个命令的功能. wiki https://github.com/PredixDev/predix-cli/wiki 安装 下载 https://github.com/PredixDev/predix-cli/releases Linux
本篇文章详细讲述就vue脚手架使用安装全过程,在使用vue-cli之前,请确认你的电脑已经安装了 node,Vue-cli需要 Node.js支持如果还未安装node可以参考https://www.runoob.com/nodejs vue-cli脚手架安装----整个项目过程中只需要完整的走一遍即可 安装Nodejs(常规下一步下一步安装即可) 安装完成之后,可以在命令行工具中输入node -v
安装node.js 注册cnpm 来代替npm,使用命令:npm install cnpm -g --registry=https://registry.npm.taobao.org 安装vue 命令:cnpm install vue 安装vue脚手架vue-cli,命令:cnpm install -g vue-cli 创建项目 vue create test [外链图片转存失败,源站可能有防盗链
ASCH-CLI说明 0 asch-cli简介 以下内容引用自 Asch白皮书 asch-cli是Asch系统提供了一个命令行工具,只需要根据提示输入一些配置项,就可以快速的建立一个侧链,并可在侧链上开发任意类型的应用。其次,系统还提供了一系列的 api 帮助用户构建复杂的智能合约应用,这些 api 涵盖共识、强随机数、数据库、密码学等方面。 1 asch-cli的安装 sudo apt-get
Vue2.x vue-cli,生命周期,computed,watch,自定义指令 vue-cli环境配置、项目安装、目录树 我们使用webpack也可以手动安装配置vue脚手架环境,但是有一套更简单一点的vue-cli的构建工具,大大降低了webpack的使用难度。 一、配置vue的脚手架环境 npm install -g vue-cli 完成之后查看vue版本: vue -V 如果终端承认v
一、准备工作: mac系统的前面加上sudo获取管理员权限 安装node.js(自带了软件包管理工具npm) 安装webpack,命令: sudo npm install webpack -g //-g表示全局安装 安装vue cli3的脚手架构建工具,命令: sudo npm install -g @vue/cli //vue cli3的包名称由vue-cli改成了@vue/cli 测试有