Skip to main content

Command Reference

Installation

npm install -g @gofynd/fdk-cli

Basic Commands

To help you get started with a few basic commandes, enter:

fdk --help

To see the available theme commands, enter:

fdk theme

See the Command overview for a listing of all available commands, or the Command reference for syntax details and usage examples of the commands.

Commands Overview

All FDK CLI commands start with fdk. The general syntax a command is:

fdk [module] [method] [options]

This command can be broken down as follows:

SyntaxExample
moduletheme
methodinit
options--email [email protected]

Deprecation Notice

⚠️ Deprecation Warning:

The fdk env command is deprecated and should no longer be used to set environment variables.

Details:

  • Deprecated Command: fdk env
  • Replacement of setting env Command: fdk login --host partners.fynd.com
  • Effective Date: 12th Aug, 2024
  • Reason: The functionality of setting the environment can be more effectively managed within the login command based on the use case.

Commands


Authentication Commands

CommandDescription
loginLogin user
userShows user details of logged-in user
logoutLogout user

Theme Commands

CommandDescription
newCreate a new theme
initInitialize an existing theme
contextAdd context to a theme
context-listList all available contexts
active-contextshow currently active context
serveStart theme serving on localhost
syncSync theme to the application
pullPull the latest theme code
pull-configPull the latest theme config
publishPublish theme to the library
unpublishUnpublish theme
openpreview theme

Commands Reference


Authentication Commands

After setting the environment, the user has to login into the CLI.

login This command allows users to login with your partner account.

fdk login

Command Options

OptionDescription
--host -hTo change your environment
--helpShow help

Example

fdk login

To switch your active environment, use the --host flag. By default, the active environment is set to partners.fynd.com.

fdk login --host partners.fynd.com

user This command shows details of the currently logged-in user.

fdk user

logout This command will log out the user.

fdk logout

Theme Commands

A theme is a VueJS project that developers can scaffold using this CLI tool. Themes change the look and feel of websites built using the Fynd Platform. Always create a new directory while creating or initializing a theme.

new This command is used to create a new theme for your application

fdk theme new [options]

Command Options

OptionDescription
--name, -nTheme name
--type, -tvue2
--helpShow help

Example

fdk theme new -n [your-theme-name] --type [react | vue2]

init This command is used to initialize an existing theme on your local system.

fdk theme init

Command Options

OptionDescription
--helpShow help

Example

fdk theme init

Context

Context is a JSON object which 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.

This command is used to add a new context.

fdk theme context [options]
OptionDescription
--name, -nContext name
--helpShow help

Example

fdk theme context -n [context-name]

context-list

This command is used to get a list of available contexts. You can also set the active context by selecting one of the options in the list

fdk theme context-list

active-context This command is used to run a theme on your local system.

fdk theme active-context

serve This command is used to run a theme on your local system.

fdk theme serve [options]
OptionDescription
--ssrEnable/disable Server-side rendering
--portPass custom port number to serve theme. Default: 5001
--helpShow help

By default Server-side rendering is enable. To disable it use --ssr false with the serve command

Example

fdk theme serve
fdk theme serve --port 5002

sync 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.

pull This command is used to pull the latest theme code.

fdk theme pull

pull-config This command is used to pull the latest theme config.

fdk theme pull-config

open This command is used to preview the theme on browser.

fdk theme open

Contributing

Checkout https://github.com/gofynd/fdk-cli/blob/master/CONTRIBUTING.md for more information on how to get started contributing to this repository.