Skip to content

ForceCLI/force

Folders and files

NameName
Last commit message
Last commit date
Jul 18, 2014
Jul 9, 2014
Dec 30, 2013
May 23, 2014
Nov 19, 2013
Aug 13, 2014
Sep 26, 2013
May 23, 2014
Sep 27, 2013
Sep 4, 2014
Jul 25, 2014
Jun 4, 2014
Jun 19, 2014
Jan 21, 2014
Sep 25, 2013
Jun 6, 2014
Oct 1, 2013
Dec 16, 2013
Sep 4, 2014
Jun 6, 2014
Sep 4, 2014
Jul 9, 2014
Jul 21, 2014
Jul 23, 2014
Jul 16, 2014
Jul 9, 2014
Jun 6, 2014
Jul 25, 2014
Sep 4, 2014
Oct 24, 2013
Sep 27, 2013
Jun 23, 2014
Aug 12, 2014
Sep 4, 2014
Jul 25, 2014
Jun 4, 2014
Oct 2, 2013
Jun 5, 2014
Jun 4, 2014
Oct 1, 2013
Jun 23, 2014
Sep 29, 2013
Oct 4, 2013
Jun 6, 2014

Repository files navigation

force

A command-line interface to force.com

Installation

Precompiled Binaries

If the download does not work, download instead from the binaries folder in the repo.

Compile from Source
$ go get -u github.com/heroku/force

Usage

Usage: force <command> [<args>]

Available commands:
   login     Log in to force.com
   logout    Log out from force.com
   logins    List force.com logins used
   active    Show or set the active force.com account
   whoami    Show information about the active account
   sobject   Manage standard & custom objects
   field     Manage sobject fields
   record    Create, modify, or view records
   bulk      Load csv file use Bulk API
   fetch     Export specified artifact(s) to a local directory
   export    Export metadata to a local directory
   fetch     Export specified artifact(s) to a local directory
   import    Import metadata from a local directory
   query     Execute a SOQL statement
   apex      Execute anonymous Apex code
   oauth     Manage ConnectedApp credentials
   version   Display current version
   update    Update to the latest version
   push      Deploy single artifact from a local directory
   password  See password status or reset password
   help      Show this help

Run 'force help [command]' for details.

login

When you login using the CLI a record of the login is saved. Eventually your token will expire requiring re-authentication. The default login is for all production instances of salesforce.com. Two predefined non-production instances are available using the test and pre aliases. You can set an arbitrary instance to log in to by specifying the instance url in the form of subdomain.domain. For example login-blitz.soma.salesforce.com.

  force login     		 	# log in to production or developer org
  force login -i=test 		 	# log in to sandbox org
  force login -i=pre  		 	# log in to prerelease org
  force login -u=un -p=pw 	 	# log in using SOAP
  force login -i=test -u=un -p=pw     	# log in using SOAP to sandbox org
  force login -i=<instance> -u=un -p=pw 	# internal only

logout

Logout will delete your authentication token and remove the saved record of that login.

  force logout -u=user@example.org

logins

Logins will list all the user names that you have used to authenticate with the instance URL associated with each one. The active login will be indicated behind the login name in red.

  force logins

active

Active without any arguments will display the currently acctive login that you are using. You can also supply a username argument that will set the active login to the one corresponding to the username argument. Note, just because you set a login as active, does not mean that the token is necessarily valid.

  force active
  force active dave@demo.1

whoami

Whoami will display detailed user information about the currently active logged in user. This is Force.com specific information.

  force whomai

sobject

Sobject command gives you access to creating and deleting schema objects. The list argumenet will list ALL of the objects, both standard and custom, in your org.

  force sobject list
  force sobject create <object> [<field>:<type>]...
  force sobject delete <object>

field

Field gives you the ability to create, list and delete the fields on an object. Fields need to be created one at a time. You can also set required and optional attributes for the type of field. All defaultable field attributes will be defaulted based on the defaults in the web UI.

  force field list Todo__c
  force field create Todo__c Due:DateTime required:true
  force field delete Todo__c Due

Hacking

# set these environment variables in your startup scripts
export GOPATH=~/go
export PATH="$GOPATH/bin:$PATH"

# download the source and all dependencies
$ go get -u github.com/heroku/force
$ cd $GOPATH/src/github.com/heroku/force

# to compile and test modifications
$ go get .
$ force