New PhoneGap Build NodeJS CLI module: pgb-cli

brett
PhoneGap
Published in
2 min readApr 9, 2018

Are you tired of using our website? Are you tired of not being able to easily script PhoneGap Build operations into your development pipeline?

I assume you are answering yes to both those questions. This CLI allows simple access from the command line to most of the functionality available on our site.

Here are some snippets for some common operations:

# list my apps
> pgb ls
# create a new app from a repo
> pgb new mygithubrepo/myrepo
# update an app with an update from the repo
> pgb clone <id>
# create a new app from the source in the current directory
> pgb new .
# update an existing app with source from the current directory
> pgb update <id> .

The CLI can be installed by

> yarn global add pgb-clior> npm install -g pgb-clior> brew tap phonegap-build/build
> brew install pgb

If you don’t have (or don’t want) node installed you can download executables for Mac OSX, Linux and Windows here.

Here is the full list of commands:

Usage: pgb [OPTIONS] COMMAND [arg...]
pgb [ --help | -? | --version | -v ]
Options: -d, --debug Enable debug mode
-f, --force Skip confirmation
-j, --json Print raw json
--no-progress Don't show progress
-c, --no-colours Don't use colors
-v, --version Print version
-?, --help Print usage
-b, --bare Print numerical ids
Commands: app Show information about an app
build Build an app
clone Shortcut to update and build a repo backed app
download Download an app package
lock Lock a signing key
log Show a build log
login Sign in to PhoneGap Build
logout Sign out of PhoneGap Build
ls List your apps
key Show information about a signing key
keys List your signing keys
new Create an app from a repository, file or dir
new-key Create a signing key
phonegaps List supported versions of PhoneGap
rm Delete an app
rm-key Delete a signing key
unlock Unlock a signing key
update Update an app
update-key Update a signing key
whoami Show signed in user
Run 'pgb COMMAND --help' for more information on a command

If you find a bug or have a feature request tell me about it here.

Follow me on twitter @brettrudd

--

--