schema Commands

Use the schema commands to view information about the standard and custom objects in your org.

schema:sobject:describe

Displays the metadata for a standard or custom object.

Command Syntax

sfdx force:schema:sobject:describe
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
-s SOBJECTTYPE
[-t]

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn
-u | --targetusername TARGETUSERNAME
Optional

A username or alias for the target org. Overrides the default target org.

Type: string
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string
-s | --sobjecttype SOBJECTTYPE
Required

The API name of the object to describe.

Type: string
-t | --usetoolingapi
Optional

Execute using Tooling API.

Type: boolean

Help for schema:sobject:describe

Examples:

1$ sfdx force:schema:sobject:describe -s Account
1$ sfdx force:schema:sobject:describe -s MyObject__c
1$ sfdx force:schema:sobject:describe -s ApexClass -t

schema:sobject:list

Lists all objects of a specified sObject category.

Command Syntax

sfdx force:schema:sobject:list
[--json]
[--loglevel LOGLEVEL]
[-u TARGETUSERNAME]
[--apiversion APIVERSION]
-c SOBJECTTYPECATEGORY

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--loglevel LOGLEVEL
Optional

The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn
-u | --targetusername TARGETUSERNAME
Optional

A username or alias for the target org. Overrides the default target org.

Type: string
--apiversion APIVERSION
Optional

Override the API version used for API requests made by this command.

Type: string
-c | --sobjecttypecategory SOBJECTTYPECATEGORY
Required

The type of objects to list: all, custom, or standard.

Type: string

Help for schema:sobject:list

Lists all objects, custom objects, or standard objects in the org.

Examples:

1$ sfdx force:schema:sobject:list -c all
1$ sfdx force:schema:sobject:list -c custom
1$ sfdx force:schema:sobject:list -c standard