ma3route-cli v0.7.0
ma3route-cli
Terminal Client for the Ma3Route REST API v2
installation:
$ npm install --global ma3route-cliusage:
options:
Options can be passed to any sub-command in different styles:
$ ma3route --limit=1 # preferred way
$ ma3route --limit 1configurations:
To configure the client, you use the config sub-comand:
$ ma3route config --sdk.key=somekey --sdk.secret=somesecret
$ ma3route config --limit=1Note: you need an API key and secret to be able to interact with the API
All the configurations are used to build requests to the API. Therefore, if
you configure limit to 10, all requests to the API (where applicable)
will use this parameter.
The CLI ships with some default configurations, you can view them with:
$ ma3route config --defaultTo view your own configurations, you can view them with:
$ ma3route config --userTo delete a configuration, you specify its key, use --delete:
$ ma3route config --delete=limit
$ ma3route config --delete=limit,sdk # multiple configuration valuesendpoints:
The terminal client uses the awesome Ma3Route SDK for Node.js to perform operations against the API.
b, banner-adverts banner adverts
d, driving-reports driving reports
e, external-stream external stream
l, listed-adverts listed adverts
m, misc miscellaneous operations
n, news news articles
p, places places
t, traffic-updates traffic updates
u, users ma3route usersAll these sub-commands refer to the SDK inner modules. For example,
banner-adverts uses the bannerAdverts sub-module in the SDK.
If a module (which most do) supports retrieving the relevant entities, you
can use the --get flag or omit it entirely:
$ ma3route traffic-updates --get
$ ma3route traffic-updates # --get is impliedTo create an entity, use the flag --create:
$ ma3route users --create --email=john.done@example.com --password=secretpasswordTo delete an entity, use the flag --delete:
$ ma3route traffic-updates --delete --id=101Any other module function can be specified using a decamelized option.
For example, to invoke the getTowns function in module places, use the
flag --get-towns
$ ma3route places --get-townsNote that not all commands support all these flags. For example, you can not delete a user with
users --delete
parameters:
To pass parameters to the any module function, you use flags. For example, if we wanted to limit a response to 20 items, we could:
$ ma3route driving-reports --limit=20help information:
To view help information:
$ ma3route helpTo view version information:
$ ma3route versionTo enable debug output, just ensure the environment variable ${DEBUG}
is truthy:
$ DEBUG=1 ma3route configYou can also use the --debug flag to show debug output:
$ ma3route config --debuglicense:
The MIT License (MIT)
Copyright (c) 2015-2016 GochoMugo (www.gmugo.in)