2017 © Pedro Peláez
 

library janrain-cli

image

gedex/janrain-cli

  • Wednesday, August 26, 2015
  • by gedex
  • Repository
  • 27 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

jcli

CLI ools for interacting with Janrain., (*1)

, (*2)

Install From Source

git clone git@github.com:xwp/janrain-cli-tools.git jcli
cd jcli
composer install

You can run via ./bin/jcli from current directory., (*3)

If you want to build the phar file:, (*4)

box build

and you can move the file to your OS PATH:, (*5)

mv jcli.phar /usr/local/bin/jcli

Now you can run jcli from anywhere., (*6)

, (*7)

Configuration

The first time you need to do is configure your jcli. By default client_id, client_secret, and base_url are empty:, (*8)

jcli config -l

These are required config keys that need to be set. Set it with:, (*9)

jcli config client_id YOUR_CLIENT_ID
jcli config client_secret YOUR_CLIENT_SECRET
jcli config base_url YOUR_BASE_URL

Additionally you can set default_type to set default entity type. Now, every time you run command you can ignore -t option., (*10)

jcli config default_type user

, (*11)

Commands

$ ./bin/jcli
jcli version @package_version@

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  config                 Janrain config
  help                   Displays help for a command
  list                   Lists commands
 entity
  entity:count           Retrieve number of records of entity type
  entity:fill-unsub-key  Fill empty unsubscribe key on records
  entity:find            Find entity
  entity:update          Update an entity
  entity:view            Retrieve a single entity
 type
  type:list              Retrieve all entity types

, (*12)

Find Records

jcli entity:find "gender != 'male'"

Limit the output to 10 records:, (*13)

jcli entity:find "gender != 'male'" -m 10

Specifying offset (start from 5th record):, (*14)

jcli entity:find "gender != 'male'" -m 10 -f 5

, (*15)

Count Records

jcli entity:count "gender != 'male' AND birthday is not null"

, (*16)

View a Single Record

jcli entity:view id=999
jcli entity:view uuid=c0613105-f632-41ce-80eb-56668df7fc83

, (*17)

Update a Record

jcli entity:update id=999 givenName=Akeda displayName="Akeda Bagus"

, (*18)

Update All Empty ETUID Attributes

jcli entity:fill-unsub-key

You may get API rate limit from Janrain. If so, the jcli will output the message. When that happens, you can re-run jcli entity:fill-unsub-key again for the remaining records., (*19)

The Versions