sf

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 44 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sf implements the command tree used when the force binary is invoked under the name sf. Commands accept the names and flags of the Salesforce sf CLI and print output in its format.

Index

Constants

View Source
const CompatVersion = "2.138.6"

CompatVersion is the sf release whose commands, flags and output this package reproduces.

View Source
const ModeFlag = "--sf"

ModeFlag is the force flag that selects sf-compatible mode.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the sf command tree with the process arguments and exits.

func InvokedAsSf

func InvokedAsSf(argv0 string) bool

InvokedAsSf reports whether argv0 names the binary sf.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd builds a new sf command tree. Each call returns independent commands and flag values.

func Run

func Run(args []string, out, errOut io.Writer) int

func SetInvocation

func SetInvocation(argv0 string, withModeFlag bool)

SetInvocation records how sf-compatible mode was started: argv0 as it was typed, such as "sf", "/tmp/sf" or "./force", followed by the mode flag when the mode was selected with it. A name that cannot be written in a message without quoting, and the temporary binary of "go run", are replaced by "sf", or by "force" with the flag.

func StripModeFlag

func StripModeFlag(args []string) ([]string, bool)

StripModeFlag reports whether args contain --sf and returns args without it. An argument after "--" is not a flag. "force --sf org list" and "force org list --sf" both run "sf org list".

Types

type Error

type Error struct {
	Name     string
	Message  string
	ExitCode int
	Actions  []string
	// Label replaces Name in the human "Error (<label>):" line and in the
	// "code" field of the JSON envelope.  sf prints the exit code there
	// for some errors that have a name.
	Label string
	// Data is written as the "data" field of the JSON envelope.
	Data interface{}
	// Compact prints one blank line after the message instead of two, as
	// the sf plugins that are installed on first use do.
	Compact bool
}

Error is an error reported in sf's format. Name is the error name sf prints, such as NoDefaultEnvError.

func (*Error) Error

func (e *Error) Error() string

Directories

Path Synopsis
Package templates holds the file templates of the "template generate" commands.
Package templates holds the file templates of the "template generate" commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL