id = "sfdx" name = "Salesforce CLI" homepage = "https://developer.salesforce.com/tools/salesforcecli" description = "Salesforce CLI simplifies development and build automation when working with your Salesforce org." # The Salesforce cloud: the CLI ships no separate mark of its own. icon = "theSVG:salesforce" # `sf` (v2) and `sfdx` (v7) are the same CLI: sf v2 understands both command # styles and keeps writing the .sfdx state folder for interoperability. executables = ["sfdx", "sf"] [dotfiles] # forcedotcom/sfdx-core, src/global.ts: # SFDX_STATE_FOLDER = '.sfdx' SF_STATE_FOLDER = '.sf' # SFDX_DIR = path.join(os.homedir(), '.sfdx') # src/config/config.ts: CONFIG_FILE_NAME = 'config.json' written under # SF_STATE_FOLDER, plus SFDX_CONFIG_FILE_NAME = 'sfdx-config.json' written # under .sfdx when Global.SFDX_INTEROPERABILITY is on. # src/stateAggregator/accessors/aliasAccessor.ts: # getFileLocation = () => join(homedir(), Global.SFDX_STATE_FOLDER, 'alias.json') # On Windows these are %USERPROFILE%\.sfdx and %USERPROFILE%\.sf, which resolve # to the same ~/ paths, so they are not listed twice. paths = [ "~/.sfdx/sfdx-config.json", "~/.sfdx/alias.json", "~/.sf/config.json", ] exclude = [] # Two kinds of credential live beside those files in ~/.sfdx: # # * the per-org auth files. src/config/authInfoConfig.ts writes # `${username}.json` in the global .sfdx directory and calls it "an auth # config file that stores information such as access tokens, usernames". # A Salesforce username is email-shaped, so *@*.json names them without # catching sfdx-config.json, alias.json or key.json. # * src/crypto/keyChainImpl.ts: getSecretFile() = path.join(Global.DIR, # 'key.json') — the generic-keychain fallback key that decrypts those auth # files when no OS keychain is available. secret = ["~/.sfdx/*@*.json", "~/.sfdx/key.json"] # No machine_lines: target-org, target-dev-hub and org-api-version name orgs # and API levels the developer works against everywhere, not this laptop. [commands] format = 1 label = "Salesforce CLI (sfdx)" description = "Run a SOQL query or deploy source with the legacy sfdx force commands. Other sfdx commands, auth flows and the newer sf command are left out." quality = "ai-draft" base = "fig:sfdx" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sfdx.ts" license = "MIT" [[commands.subcommand]] path = ["force:data:soql:query"] label = "Run a SOQL query" description = "Execute a SOQL query against an org and print the result." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sfdx.ts" license = "MIT" [[commands.subcommand.field]] id = "query" label = "SOQL query" type = "string" option = ["--query", "-q"] description = "SOQL query to execute." sources = ["fig"] [[commands.subcommand.field]] id = "target_org" label = "Target org" type = "string" option = ["--targetusername", "-u"] description = "Username or alias for the target org; overrides the default." sources = ["fig"] [[commands.subcommand.field]] id = "tooling" label = "Use Tooling API" type = "boolean" option = ["--usetoolingapi", "-t"] description = "Execute the query with the Tooling API." sources = ["fig"] [[commands.subcommand.field]] id = "result_format" label = "Result format" type = "enum" option = ["--resultformat", "-r"] description = "Result format emitted to stdout." choices = [{ value = "human", label = "human" }, { value = "csv", label = "csv" }, { value = "json", label = "json" }] sources = ["fig"] [[commands.subcommand.field]] id = "json" label = "JSON output" type = "boolean" option = ["--json"] description = "Format output as json." sources = ["fig"] [[commands.subcommand.task]] id = "query" label = "Run a query" fields = ["query", "target_org", "result_format"] required = ["query"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["query", "target_org", "tooling", "result_format", "json"] [[commands.subcommand]] path = ["force:source:deploy"] label = "Deploy source" description = "Deploy source-format metadata to an org. Choose source path, metadata names or a manifest." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/sfdx.ts" license = "MIT" [[commands.subcommand.field]] id = "target_org" label = "Target org" type = "string" option = ["--targetusername", "-u"] description = "Username or alias for the target org; overrides the default." sources = ["fig"] [[commands.subcommand.field]] id = "sourcepath" label = "Source paths" type = "string" option = ["--sourcepath", "-p"] description = "Comma-separated list of source file paths to deploy." sources = ["fig"] [[commands.subcommand.field]] id = "metadata" label = "Metadata components" type = "string" option = ["--metadata", "-m"] description = "Comma-separated list of metadata component names." sources = ["fig"] [[commands.subcommand.field]] id = "manifest" label = "Manifest (package.xml)" type = "path" option = ["--manifest", "-x"] description = "File path for manifest of components to deploy." path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "checkonly" label = "Validate only" type = "boolean" option = ["--checkonly", "-c"] description = "Validate deploy but do not save to the org." sources = ["fig"] [[commands.subcommand.field]] id = "testlevel" label = "Test level" type = "string" option = ["--testlevel", "-l"] description = "Deployment testing level." suggestions = [{ value = "NoTestRun", label = "NoTestRun" }, { value = "RunSpecifiedTests", label = "RunSpecifiedTests" }, { value = "RunLocalTests", label = "RunLocalTests" }, { value = "RunAllTestsInOrg", label = "RunAllTestsInOrg" }] sources = ["fig"] [[commands.subcommand.field]] id = "wait" label = "Wait (minutes)" type = "integer" option = ["--wait", "-w"] description = "Wait time for command to finish in minutes." sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["--verbose"] description = "Verbose output of deploy result." sources = ["fig"] [[commands.subcommand.task]] id = "validate" label = "Validate a source path" set = { checkonly = [true] } fields = ["sourcepath", "target_org", "testlevel", "wait"] required = ["sourcepath"] [[commands.subcommand.task]] id = "deploy" label = "Deploy a source path" fields = ["sourcepath", "target_org", "testlevel", "wait"] required = ["sourcepath"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["target_org", "sourcepath", "checkonly", "testlevel", "wait"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["metadata", "manifest", "verbose"]