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:
Syntax | Example |
---|---|
module | theme |
method | init |
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
Command | Description |
---|---|
login | Login user |
user | Shows user details of logged-in user |
logout | Logout user |
Theme Commands
Command | Description |
---|---|
new | Create a new theme |
init | Initialize an existing theme |
context | Add context to a theme |
context-list | List all available contexts |
active-context | show currently active context |
serve | Start theme serving on localhost |
sync | Sync theme to the application |
pull | Pull the latest theme code |
pull-config | Pull the latest theme config |
publish | Publish theme to the library |
unpublish | Unpublish theme |
open | preview 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
Option | Description |
---|---|
--host -h | To change your environment |
--help | Show 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
Option | Description |
---|---|
--name, -n | Theme name |
--type, -t | vue2 |
--help | Show 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
Option | Description |
---|---|
--help | Show 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]
Option | Description |
---|---|
--name, -n | Context name |
--help | Show 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]
Option | Description |
---|---|
--ssr | Enable/disable Server-side rendering |
--port | Pass custom port number to serve theme. Default: 5001 |
--help | Show 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.