Skip to content

ekata123/fdk-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fynd Development Kit

NPM Version NPM Downloads NPM License Build Status 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.

Quick Links

Fynd Platform Fynd Partners Documentation Other Projects

Installation


npm install -g @gofynd/fdk-cli

Basic Commands


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.

Commands Overview

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

Commands


Environment Commands

Command Description
env List environments
current-env Shows current environment

Authentication Commands

Command Description
login Login user
user Shows user details of logged in user
logout Logout user

Theme Commands

Command Description
new Create new theme
init Initialize an existing theme
context Add context of a theme
context-list List all available contexts
sync Sync theme to application
pull Pull latest theme code
pull-config Pull latest theme config
publish Publish theme to library
unpublish Unpublish theme

Extension Commands

Command Description
init Initialize extension
launch-url Get/set lanuch url

Partner Commands

Command Description
connect Add partner access token

Commands Reference


Environment Commands

Before you setup a theme using FDK CLI you will have to set an environment in which you will be initializing your theme

env

This command show a list of all available envorinments for the user to choose from

Command Options

Option Description
--name, -n Environment name
--help Show help

Example

fdk env -n fynd

Syntax

fdk env -n [your-env]

current-env

This command show the current environment set by the user.

Syntax

fdk current-env

Authentication Commands

After setting the environment the user has to login to the cli. They can use their email ID or phone number to login.

login

This command allows user to login with email or password

Syntax

fdk login

Command Options

Option Description
--email, -e Email
--mobile, -m Mobile
--help Show help

Example

fdk login -e [your-email]
fdk login -m [your-mobile]

user

This command show user details of the currently logged in user.

Syntax

fdk user

logout

This command will logout the user.

Syntax

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

Syntax

fdk theme new [options]

Command Options

Option Description
--token, -t Theme token
--name, -n Theme name
--help Show help

You can find the theme token under the themes panel of Fynd Platform. Reference

Example

fdk theme new -t [theme-token] -n [your-theme-name] 

init

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

Syntax

fdk theme init [options]

Command Options

Option Description
--token, -t Theme token
--help Show help

You can find the theme token under the themes panel of Fynd Platform. Reference

Example

fdk theme init -t [your-theme-token]

context

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.

Syntax

fdk theme context [options]

Command Options

Option Description
--token, -t Theme token
--name, -n Context name
--help Show help

You can find the theme token under the theme panel of Fynd Platform. Reference

Example

fdk theme context -t [your-theme-token] -n [context-name] 

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

Syntax

fdk theme context-list

serve

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

Syntax

fdk theme serve [options]

Command Options

Option Description
--ssr Enable/disable Server-side rendering
--help Show help

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

Example

fdk theme serve

sync

This command is used to sync your theme to the application.

Syntax

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 latest theme code.

Syntax

fdk theme pull

pull-config

This command is used to pull latest theme config.

Syntax

fdk theme pull-config

publish

This command is used to publish your theme.

Syntax

fdk theme publish

unpublish

This command is used to unpublish your theme.

Syntax

fdk theme unpublish

Extension Commands

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

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.

Syntax

fdk extension init [options]

Command Options

Option Description
--target-dir Target Directory
--host Host
--help Show help

Example

fdk extension init --target-dir [your-directory] --host [your_host]

launch-url

This command is used to get or set the launch url of your extension

Syntax

fdk extension launch-url get/set [options]

Command Options

Option Description
--url URL to be set
--api_key Extension ID
--host Host
--help Show help

Set Launch URL Example

fdk extension launch-url set --url [url] --api_key [extension ID] --host [your_host]

Get Launch URL Example

fdk extension launch-url get --api_key [extension id] --host [your_host]

Partner Commands

connect

This command is used to add your partner access token to update extension details on partners panel.

Syntax

fdk partner connect [options]

Command Options

Option Description
--host Host
--help Show help

Example

fdk partner connect --host [your_host]

Other Fynd projects

Project Link
Nitrozen Vue Know more
Javascript SDK snapshot
Extension SDK snapshot
Extension Bridge snapshot

Releases

No releases published

Packages

No packages published

Languages

  • Vue 78.0%
  • TypeScript 10.6%
  • JavaScript 9.5%
  • Less 1.9%