Generates the metadata resource file in the specified directory or the current working directory. Static resource files must be contained in a parent directory called “staticresources” in your package directory. Either run this command from an existing directory of this name, or use the –output-dir flag to create one or point to an existing one.
Aliases for template generate static-resource
force:staticresource:create
static-resource:generate
Flags
Flag Name (Long)
Flag Name (Short)
Description
‑‑api‑version
N/A
Type: Value
Override the api version used for api requests made by this command
‑‑flags‑dir
N/A
Type: Value
Import flag values from a directory.
‑‑json
N/A
Type: Boolean
Format output as json.
‑‑name
‑n
Type: Value Required
Name of the generated static resource.
This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
‑‑output‑dir
‑d
Type: Value Default value:.
Directory for saving the created files.
The location can be an absolute path or relative to the current working directory. The default is the current directory.
‑‑type
N/A
Type: Value Default value:application/zip
Content type (mime type) of the generated static resource.
Must be a valid MIME type such as application/json, application/javascript, application/zip, text/plain, text/css, etc.
Examples for template generate static-resource
Generate the metadata file for a static resource called MyResource in the current directory: