Fynd development Kit (FDK CLI) is a cli tool developed by Fynd to create and update themes, extensions and various other components of the Fynd Platform.
Fynd Platform | Fynd Partners | Documentation | Other Projects | | Contributing |
npm install -g @gofynd/fdk-cli
To help you get started, there are some basic commands you can use.
fdk --help
To see the available theme commands, enter:
fdk theme
To see the available extension commands, enter:
fdk extension
See the Command overview for a listing of all available commands, or the Command reference for syntax details and usage examples of the commands.
All FDK CLI commands start with fdk. The general syntax for the commands is as follows:
fdk [module] [method] [options]
This command can be broken down as follows:
Syntax | Example |
---|---|
module | theme |
method | init |
options | --email email@gmail.com |
Command | Description |
---|---|
env ls | List environments |
env get | Shows current environment |
env set | Set active environment to the value provided by the user. Default environment: fynd |
Command | Description |
---|---|
login | Login user |
user | Shows user details of logged in user |
logout | Logout user |
Command | Description |
---|---|
new | Create new theme |
init | Initialize an existing theme |
context | Add context of a theme |
context-list | List all available contexts |
active-context | show currently active context |
serve | Start theme serving on localhost |
sync | Sync theme to application |
pull | Pull latest theme code |
pull-config | Pull latest theme config |
publish | Publish theme to library |
unpublish | Unpublish theme |
open | preview theme |
Command | Description |
---|---|
init | Initialize extension |
setup | setup development environment |
launch-url | Get/set lanuch url |
Command | Description |
---|---|
connect | Add partner access token |
Before you setup a theme using FDK CLI you will have to set an environment in which you will be initializing your theme
This command displays a list of all supported environments.
fdk env ls
This command sets the active environment to the value provided by the user.
fdk env set -n [env-name]
fdk env set -n fynd
Option | Description | Required |
---|---|---|
--name, -n | Environment name | Yes |
--help | Show help | No |
--verbose, -v | enable debug mode | No |
This command displays the active environment set by the user. Default environment: fynd
fdk env get
After setting the environment the user has to login to the cli. They can use their email ID or phone number to login.
This command allows user to login with email or password
fdk login
Option | Description |
---|---|
--email, -e | |
--mobile, -m | Mobile |
--help | Show help |
--verbose, -v | enable debug mode |
fdk login -e [your-email]
fdk login -m [your-mobile]
This command show user details of the currently logged in user.
fdk user
This command will logout the user.
fdk logout
A theme is a VueJS project that developers can scaffold using this cli tool. Themes change the look and feel of websites built using Fynd Platform. Always create a new directory while creating or initializing a theme.
This command is used to create a new theme for your application
fdk theme new [options]
Option | Description |
---|---|
--token, -t | Theme token |
--name, -n | Theme name |
--help | Show help |
--verbose, -v | enable debug mode |
You can find the theme token under the themes panel of Fynd Platform. Reference
fdk theme new -t [theme-token] -n [your-theme-name]
This command is used to initialize an exisiting theme on your local system.
fdk theme init [options]
Option | Description |
---|---|
--token, -t | Theme token |
--help | Show help |
--verbose, -v | enable debug mode |
You can find the theme token under the themes panel of Fynd Platform. Reference
fdk theme init -t [your-theme-token]
Context is a JSON object which holds the configurations related the 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 envoirnments.
This command is used to add a new context.
fdk theme context [options]
Option | Description |
---|---|
--token, -t | Theme token |
--name, -n | Context name |
--help | Show help |
--verbose, -v | enable debug mode |
You can find the theme token under the theme panel of Fynd Platform. Reference
fdk theme context -t [your-theme-token] -n [context-name]
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
This command is used to get currently active context.
fdk theme active-context
This command is used to run a theme on your local system.
fdk theme serve [options]
Option | Description |
---|---|
--ssr | Enable/disable Server-side rendering |
--port | Pass custom port number to serve theme. Default: 5001 |
--help | Show help |
--verbose, -v | enable debug mode |
By default Server-side rendering is enable. To disable it use --ssr false
with the serve command
fdk theme serve
fdk theme serve --port 5002
This command is used to sync your theme to the application.
fdk theme sync
Always verify if you have set the correct context before syncing your theme. Refer context commands.
This command is used to pull latest theme code.
fdk theme pull
This command is used to pull latest theme config.
fdk theme pull-config
This command is used to publish your theme.
fdk theme publish
This command is used to unpublish your theme.
fdk theme unpublish
This command is used to preview the theme on browser.
fdk theme open
Extensions are pluggable snippets of code that can be installed in your applications so improve the feature set of your application. To know more visit - Fynd Partners
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.
fdk extension init [options]
Option | Description |
---|---|
--target-dir | Target Directory |
--host | Host |
--help | Show help |
--verbose | enable debug mode |
fdk extension init --target-dir [your-directory] --host [your_host]
#### **setup** This command is used to setup extension's development environment in local machine with required dependecies created on [Fynd Partners](https://partners.fynd.com/) panel. #### ****Syntax**** ```sh fdk extension setup [options] ```
Option | Description |
---|---|
--target-dir | Target Directory |
--host | Host |
--help | Show help |
--verbose | enable debug mode |
fdk extension setup --target-dir [your-directory] --host [your_host]
This command is used to get or set the launch url of your extension
fdk extension launch-url get/set [options]
Option | Description |
---|---|
--url | URL to be set |
--api_key | Extension ID |
--host | Host |
--help | Show help |
--verbose | enable debug mode |
fdk extension launch-url set --url [url] --api_key [extension ID] --host [your_host]
fdk extension launch-url get --api_key [extension id] --host [your_host]
This command is used to add your partner access token to update extension details on partners panel.
fdk partner connect [options]
Option | Description |
---|---|
--host | Host |
--help | Show help |
--verbose, -v | enable debug mode |
fdk partner connect --host [your_host]
To print the curl command in the console for all network calls,
run the cli commands in debug mode using --verbose
flag.
fdk login -e <your_email> --verbose
above command will log the curl command in the console
************** CURL **************
METHOD: POST | PATH: https://api.fynd.com/service/panel/authentication/v1.0/auth/login/password
curl --include --request POST 'https://api.fynd.com/service/panel/authentication/v1.0/auth/login/password' --header 'content-type: application/json' --header 'x-fp-cli: 1.0.144' --header 'x-fp-date: 20230227T174059Z' --header 'x-fp-signature: v1.1:ab4fa30b4f12e2d968110ed809863f6f404621e03eb8a98c8a4fe228c8262684' --header 'x-debug: true' --data-raw '{"username":"email@fynd.com","password":"password@123","g-recaptcha-response":"_skip_"}'
************** END OF CURL **************
User logged in successfully
Project | Link |
---|---|
Nitrozen Vue | |
Javascript SDK | |
Extension SDK | |
Extension Bridge |
Checkout CONTRIBUTING.md for more information on how to get started contributing to this repository.