A simple utility, written in Go, for interacting with Salesforce.

Overview

Salesforce CLI

Status GitHub tag (latest SemVer) GitHub GoDoc Go Report Card

A simple utility, written in Go, for interacting with Salesforce. Currently only specific functionality is implemented, and the output is defined by current requirements, however it can be easily extended to add further capabilities.

There is already a Salesforce CLI available on the Salesforce website, but that doesn't currently support the V2 Bulk API.

Authentication

Currently only the "username-password authorization flow" is supported. Moving forward, the aim would be to support other authorization flows.

You can follow the Quick Start for setting up this authorization method.

The following environment variables are required for authentication:

  • CLIENT_ID - consumer key from salesforce with access to the APIs
  • CLIENT_SECRET - associated secret for the consumer key
  • USERNAME - username with access to salesforce
  • PASSWORD - associated password for that user
  • BASEURL - base url for the salesforce tenant, e.g. https://mycompany--uat.my.salesforce.com

You can also provide these in a .sfcli yaml file in your home directory or the directory in which you are running the command, e.g.:

CLIENT_ID: fjafafhalsdjfhaksj§hdf
CLIENT_SECRET: afjf34kjhsgljdgnajk
PASSWORD: supersecretpassword
USERNAME: [email protected]
BASEURL: https://mycompany--uat.my.salesforce.com

You can have different files for different environments and specify which to use with the --config option, e.g. sfcli --config .sfcli.dev.yaml

For full command help simply use:

$ sfcli --help

Salesforce CLI Utility

Usage:
  sfcli [command]

Available Commands:
  accounts      account related commands
  bulk          bulk API V2 Commands
  completion    generate the autocompletion script for the specified shell
  contacts      contact related commands
  help          Help about any command
  opportunities opportunity related commands

Flags:
      --config string   config file (default is $HOME/.sfcli.yaml)
  -h, --help            help for sfcli

Use "sfcli [command] --help" for more information about a command.

Supported Features

The following capabilities are currently available with this tool:

  • Bulk Uploads
    • List Bulk Upload Jobs
    • Show Bulk Upload Job Status
    • Create a Bulk Insert Job
    • Create a Bulk Upsert Job
  • Accounts
    • Describe Accounts (show account fields)
    • List Accounts
  • Contacts
    • Describe Contacts
    • List Contacts
  • Opportunities
    • Describe Contacts
    • List Contacts
  • Describe other object types

Bulk Uploads

Bulk uploads are achieved with the sfcli bulk command:

  • bulk insert : Bulk Insert a CSV File
  • bulk list : List the last 1000 bulk jobs
  • bulk status : Get the status of a specific job
  • bulk upsert : Bulk Upsert a CSV File

Each of the commands supports various flags as required which can be displayed within the help, e.g.:

$ sfcli bulk upsert --help

Bulk Upsert a CSV File

Usage:
  sfcli bulk upsert [flags]

Flags:
  -e, --external string   External ID Field
  -f, --file string       CSV File
  -h, --help              help for upsert
  -o, --object string     Type of Object for Insert, e.g. Account, Contact, Opportunity

CSV Format

Use the correct column names as headers in the CSV. These can be obtained from the "describe" endpoint for each object type.
This CLI provides a describe command for some objects.

You can use relationship fields in the CSV so long as the External ID field is selected or, if it's a standard field, its idLookup property is set to true.

For example, for an Account, you can use Owner.Email because Owner is a relationship to a "User" and the "User" Email field has its idLookup property set to true. See the Salesforce documentation for more detail.

Describing objects

There are some objects that have their own command, such as account, contact and opportunity. You can also specify the object type on the command line for objects that don't have their own command. Here are some examples:

$ sfcli describe account
$ sfcli describe contact
$ sfcli describe opportunity
$ sfcli describe -o campaign
$ sfcli describe -o lead
You might also like...
a simple & tiny scrapy clustering solution, considered a drop-in replacement for scrapyd

scrapyr a very simple scrapy orchestrator engine that could be distributed among multiple machines to build a scrapy cluster, under-the-hood it uses r

Simple gc using integer vectors to simulate

gcint Simple gc using integer vectors to simulate Iterate primarily over what should be the shorter vector (readers) removing unused references in fro

Bcfm-study-case - A simple http server using the Echo library in Go language
Bcfm-study-case - A simple http server using the Echo library in Go language

Task 1 Hakkında Burada Go dilinde Echo kütüphanesini kullanarak basit bir http s

Data interface for salesforce price bulk get

data-interface-for-salesforce-price-bulk-get 概要 data-interface-for-salesforce-price-bulk-get は、salesforce の価格オブジェクト取得に必要なデータの整形、および作成時に salesforce から返

gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform.
gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform.

gopsa Overview gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform. Credit This project is a rewrite of the excellent work fr

Gosfdc module - a collection of packages containing the data structures from the various Salesforce APIs and Tools

Gosfdc module - a collection of packages containing the data structures from the various Salesforce APIs and Tools

Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

It's client library written in Golang for interacting with Linkedin Cruise Control using its HTTP API.

go-cruise-control It's client library (written in Golang) for interacting with Linkedin Cruise Control using its HTTP API. Supported Cruise Control ve

Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump.
Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump.

Capdns is a network capture utility designed specifically for DNS traffic. This utility is based on tcpdump. Some of its features include: Unde

A very simple, silly little kubectl plugin / utility that guesses which language an application running in a kubernetes pod was written in.

A very simple, silly little kubectl plugin / utility that guesses which language an application running in a kubernetes pod was written in.

Golang client library for adding support for interacting and monitoring Celery workers, tasks and events.

Celeriac Golang client library for adding support for interacting and monitoring Celery workers and tasks. It provides functionality to place tasks on

Library for interacting with LLVM IR in pure Go.

llvm Library for interacting with LLVM IR in pure Go. Introduction Introductory blog post "LLVM IR and Go" Our Document Installation go get -u github.

Go library for interacting with CircleCI

go-circleci Go library for interacting with CircleCI's API. Supports all current API endpoints allowing you do do things like: Query for recent builds

Go client library for interacting with Coinpaprika's API

Coinpaprika API Go Client Usage This library provides convenient way to use coinpaprika.com API in Go. Coinpaprika delivers full market data to the wo

:money_with_wings: CLI app for interacting with paymail service providers
:money_with_wings: CLI app for interacting with paymail service providers

Paymail Inspector CLI application for interacting with paymail service providers Table of Contents Installation Commands Documentation Examples & Test

Terraform provider implementation for interacting with the Tailscale API.

Terraform Provider Tailscale This repository contains a Terraform provider implementation for interacting with the Tailscale API.

A babashka pod for interacting with sqlite3.

A babashka pod for interacting with sqlite3. Implemented using the Go go-sqlite3 and transit libraries.

mdmb is a tool for simulating Apple devices interacting with Apple MDM servers.

mdmb mdmb — short for MDM Benchmark, à la ab — is a tool for simulating Apple devices interacting with Apple MDM servers. mdmb creates sets of fake Ap

franz-go contains a high performance, pure Go library for interacting with Kafka from 0.8.0 through 2.7.0+. Producing, consuming, transacting, administrating, etc.

franz-go - Apache Kafka client written in Go Franz-go is an all-encompassing Apache Kafka client fully written Go. This library aims to provide every

Owner
Darren Parkinson
Darren Parkinson
Genetic Algorithms library written in Go / golang

Description Genetic Algorithms for Go/Golang Install $ go install git://github.com/thoj/go-galib.git Compiling examples: $ git clone git://github.com

Thomas Jager 193 Sep 27, 2022
Neural Networks written in go

gobrain Neural Networks written in go Getting Started The version 1.0.0 includes just basic Neural Network functions such as Feed Forward and Elman Re

Go Machine Learning 531 Dec 20, 2022
A recommender system service based on collaborative filtering written in Go

Language: English | 中文 gorse: Go Recommender System Engine Build Coverage Report GoDoc RTD Demo gorse is an offline recommender system backend based o

Zhenghao Zhang 6.4k Dec 29, 2022
A Naive Bayes SMS spam classifier written in Go.

Ham (SMS spam classifier) Summary The purpose of this project is to demonstrate a simple probabilistic SMS spam classifier in Go. This supervised lear

Dan Wolf 13 Sep 9, 2022
k-means clustering algorithm implementation written in Go

kmeans k-means clustering algorithm implementation written in Go What It Does k-means clustering partitions a multi-dimensional data set into k cluste

Christian Muehlhaeuser 414 Dec 6, 2022
a* pathfinding algorithm written in go

astar a* (a-star) pathfinding algorithm written in go Wikipedia: EN: A* search algorithm DE: A*-Algorithmus Install go get github.com/jpierer/[email protected]

Julian Pierer 26 Mar 21, 2022
Suricate-bank - API to transfer money between accounts at Suricate Bank,written in Go

⚠️ WORK IN PROGRESS ⚠️ Suricate Bank is an api that creates accounts and transfe

João Saraceni 12 Oct 8, 2022
ncurses matrix/log app written in go to visualize chess problems.

dorrella/matrix-curses Matrix using ncurses and gbin/goncurses. Visual matrix based puzzles Install need libncurses-dev. Probably hard to run on windo

null 0 Jan 12, 2022
Fast, simple sklearn-like feature processing for Go

go-featureprocessing Fast, simple sklearn-like feature processing for Go Does not cross cgo boundary No memory allocation No reflection Convenient ser

Nikolay Dubina 89 Dec 2, 2022
A simple OCR API server, seriously easy to be deployed by Docker, on Heroku as well

ocrserver Simple OCR server, as a small working sample for gosseract. Try now here https://ocr-example.herokuapp.com/, and deploy your own now. Deploy

Hiromu OCHIAI 541 Dec 28, 2022