FDK CLI Command Reference
Global Options
--version
| -V
Use this option to check the local version of your FDK CLI. Make sure you are using the latest version. You can always update the CLI by running the following command:
npm install -g @gofynd/fdk-cli
--help
| -h
Use this option with any command or sub-command to view its syntax, available options, and sub-commands.
--debug
| -d
Use this option with any command to run it in debug mode. It generates a debug.log
file in your current working directory.
If you encounter any issues, please share the debug.log
file when contacting our support team.
Global Commands
login
This command allows the user to login via partner panel.
fdk login [options]
Options
Option | Required | Description |
---|---|---|
--host | No | URL of the partners panel host or API host |
user
This command shows the details of the currently logged-in user.
fdk user
logout
This command logs out the user.
fdk logout
populate
Use this command to populate sample data into a development account to get started with theme and extension development.
fdk populate
tunnel
This command starts a tunnel using Cloudflare, allowing you to access your local port via a public URL.
fdk tunnel [options]
Options
Option | Required | Description |
---|---|---|
--port | Yes | The port to be exposed |
Theme Commands
theme new
This command is used to create a new theme for your application.
fdk theme new [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | Yes | Theme name |
theme init
This command is used to initialize an existing theme on your local system.
fdk theme init
theme context
This command is used to add a new context.
fdk theme context [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | Yes | Context name |
Context is a JSON object that holds the configurations related to the application and theme. When you initialize or create a new theme a context is created with the name provided in the commands and assigned as the active context. You can add multiple contexts if you want to use the same theme on multiple applications or environments.
theme context-list
This command is used to get a list of available context. You can also set active context by selecting one of the options in the list.
fdk theme context-list
theme active-context
This command is used to get currently active context.
fdk theme active-context
theme serve
This command is used to run a theme on your local system.
fdk theme serve [options]
Options
Option | Required | Description |
---|---|---|
--ssr | No | Enable/disable Server-side rendering. Default: true |
--port | No | Pass custom port number to serve theme. Default: 5001 |
theme sync
This command is used to sync your theme to the application. Always verify if you have set the correct context before syncing your theme. Refer context commands.
fdk theme sync
theme pull
This command is used to pull latest theme code.
fdk theme pull
theme pull-config
This command is used to pull latest theme config.
fdk theme pull-config
theme package
This command is used to create a zip file of theme.
fdk theme package
theme open
This command is used to preview the theme on browser.
fdk theme open
Extension Commands
You can use the shorthand ext
instead of extension
for all the extension commands.
extension init
This command is used to create a extension's initial code with required dependency. It will also register extension for you on your partner account. Ensure that Git is installed for the init
command to succeed.
fdk extension init [options]
Options
Option | Required | Description |
---|---|---|
--target-dir | No | Target Directory |
--template | No | Specify the template you want to use to create the extension |
extension preview
Use this command to return the preview URL, which can be used to launch or install the extension.
fdk extension preview [options]
Options
Option | Required | Description |
---|---|---|
--company-id | No | Unique identifier of your company. |
--api-key | No | Extension API key. |
--access-token | No | Partner Access Token. |
--tunnel-url | No | Specify a manual Tunnel URL to bypass automatic tunnel creation. |
--no-auto-update | No | Disables auto-updating of tunnel URL as extension launch url on partners panel. |
--reset | No | Resets the extension's context data, prompting you to re-enter all required details. Useful for a fresh start! |
extension pull-env
Use this command to fetch extension context details from partners panel and update current extension context.
fdk extension pull-env
extension launch-url
This command is used to get or set the launch url of your extension.
fdk extension launch-url get [options]
fdk extension launch-url set [options]
Options
Option | Required | Description |
---|---|---|
--url | No | URL to be set |
--api-key | No | Extension ID |
Extension Binding Commands
Extensions bindings are reusable components which are pluggable through the theme editor to improve the user interface of your application. These can be used just like theme sections.
env set
Set the active environment before running extension commands.
fdk env set -u api.fynd.com
binding init
This command is used to create a basic boilerplate code for extension binding with required dependencies.
fdk binding init [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | No | Name of the section binding. |
--interface | -i | No | Interface where this binding will be used. Currently, we only support Web Theme. |
--framework | -f | No | Runtime framework. Supported values are vue2 and react . |
binding draft
This command is used to register the binding with your development companies for alpha or beta testing.
fdk binding draft [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | No | Name of the section binding. |
--framework | -f | No | Runtime framework. Supported values are vue2 and react . |
--extensionId | -id | No | Extension Id of the current extension. |
--organisationId | -org | No | Organisation Id of the current extension. |
binding publish
This command is used to publish the binding across all live companies.
fdk binding publish [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | No | Name of the section binding. |
--framework | -f | No | Runtime framework. Supported values are vue2 and react . |
--extensionId | -id | No | Extension Id of the current extension. |
--organisationId | -org | No | Organisation Id of the current extension. |
binding preview
Use this command to locally serve the extension binding which has been added to a live storefront.
fdk binding preview [options]
Options
Option | Required | Description |
---|---|---|
--name | -n | No | Name of the section binding. |
--framework | -f | No | Runtime framework. Supported values are vue2 and react . |
--extensionId | -id | No | Extension Id of the current extension. |
--organisationId | -org | No | Organisation Id of the current extension. |
binding show-context
Use this command to see the current extension section context.
fdk binding show-context
binding clear-context
Use this command to clear the current extension section context.
fdk binding clear-context
Partner Commands
partner connect
This command is used to add your partner access token to update extension details on partners panel.
fdk partner connect
Config Commands
config get cafile
This command is used to retrieve the current CA file path.
fdk config get cafile
config get strict-ssl
This command is used to retrieve the current strict SSL setting.
fdk config get strict-ssl
config set cafile
This command is used to set the Root Certificate Authority (CA) file. Ensure that the file path provided for the CA file is valid and accessible. E.g., /etc/ssl/certs/ca-certificates.pem
.
fdk config set cafile <file-path>
You can also use the FDK_EXTRA_CA_CERTS
environment variable to set the CA file.
FDK_EXTRA_CA_CERTS="/path/to/your/cafile" fdk login
config set strict-ssl
This command is used to enable or disable strict SSL validation. The strict SSL setting should be either true
or false
.
fdk config set strict-ssl true|false
You can also use the FDK_SSL_NO_VERIFY
environment variable to enable or disable strict SSL validation.
FDK_SSL_NO_VERIFY=true fdk login
config delete cafile
This command is used to remove the current CA file configuration.
fdk config delete cafile
config delete strict-ssl
This command is used to remove the current strict SSL configuration.
fdk config delete strict-ssl
You can also choose to use rm
instead delete
. E.g., fdk config rm strict-ssl