A CLI and JavaScript library to manage Google Play tasks. Uses Selenium for easy maintenance and flexibility.
PlayBot requires NodeJS.
$ npm install playbot
# or
$ npm install playbot -g
app:create
- Creates an entry for a new app on Google Playapp:update
- Updates an existing entry for an app on Google Playapp:delete
- Deletes an existing entry for an app on Google Playapp:publish
- Publishes an existing entry for an app on Google Playapp:unpublish
- Unpublishes an existing entry for an app on Google Playapp:list
- Lists existing app entries on Google Play Dev ConsoleMost commands take in options - you can either pass them individually, or use a JSON manifest file like this:
{
"title": "My new app",
"short_description": "This app is great!"
}
For example, the following commands are equivalent usng this JSON manifest:
$ playbot app:create --title 'My new app' --short_description 'This app is great!'
$ playbot app:create --manifest ./manifest.json
// JavaScript
PlayBot.app.create({title: "My new app", short_description: "This app is great!"});
PlayBot.app.create({manifest: "./manifest.json"});
PlayBot installs an playbot
command, which you can explore with -h
flags:
$ playbot -h
Commands:
app:create Create App
app:update Update App
app:delete Delete App
app:publish Publish App
app:unpublish Unpublish App
app:list List Apps
help Display global or [command] help documentation.
Global Options:
--manifest FILE.json Use a JSON file to load options for each command
--username USERNAME Username to login to Google Play, or $PLAYBOT_USERNAME
--password PASSWORD Password to login to Google Play, or $PLAYBOT_PASSWORD
--format FORMAT Output format - ['json', 'pretty']
--verbose Verbose output
For every command, you can pass --username
and --password
flags to enter you auth credentials; you can also set $PLAYBOT_USERNAME
and $PLAYBOT_PASSWORD
environment variables.
The Node package uses a PlayBot
object, and its properties map to the CLI commands:
var PlayBot = require('playbot');
PlayBot.app.create({options: here});
The JavaScript library has a few shortcuts for logging in to Google Play:
// pass as options
PlayBot.app.create({username: "username", password: "password"});
// run in closure
PlayBot.with_credentials({username: "username", password: "password"}, function() {
PlayBot.app.create(options);
});
// set globally
PlayBot.set_credentials({username: "username", password: "password"});
The :list
commands are meant to return some data. If you're using the JavaScript library, you'll receive an Array
when the command is done; if you're using the CLI, the command will output a JSON object with one entry.
PlayBot.app.list({options}, function(err, res) {
// res = ["com.usepropeller.myapp"]
});
$ playbot app:list
{"apps": ["com.usepropeller.myapp"]}
If you're using any other command (which generally create side-effects), the end result will be true
in Javascript, or exit code 0 on the CLI.
You can base a --verbose
flag (or a verbose: true
option in JavaScript) to see all of the output as each script processes. There are two output formats, json
and pretty
, which you are set with either the --format
flag or format: 'format_string'
options in JavaScript.
PlayBot is available under the MIT license. See the LICENSE file for more info.