VTEX IO CLI installation and command reference
Any development in VTEX IO begins and ends with the Toolbelt, our CLI (Command Line Interface).
Toolbelt allows you to login to a desired VTEX account, link your local files to the platform, manage an account's workspaces, in addition to performing any action necessary to your development process.
Installation
To install the VTEX IO’s CLI, you need to ensure that Node.js and Yarn are installed on your machine.
Thereafter, type yarn global add vtex
in your computer’s terminal.
$ yarn global add vtex
vtex
command. This should display all available commands in a help text.
Troubleshooting
After installing and running vtex
in the terminal, an error saying that the command or program wasn't found may show up.
This happens due to an error concerning the Yarn installation. The yarn global add
command does not properly add Yarn binaries to a directory known by your terminal as PATH
.
By not adding the Yarn binaries to terminal PATH
, Yarn and its programs can't be found, thereby resulting in an error when running Toolbelt.
Workaround for MacOS and Linux users
- In your local directories, find the Profile file. It is usually hidden and is named after the command line's interpreter. For example: If you're using
bash
, your Profile file will be namedbashrc
. If you usezsh
, it will bezshrc
; - Once in the Profile file, add the following command:
export PATH="$PATH: yarn global bin"
; - Log in and log out of your terminal for the changes to take effect;
set -U fish_user_paths (yarn global bin) $fish_user_paths
.
Workaround for Windows users
- Runs the
yarn global bin
command in your terminal. It will return the path in which the yarn global binaries were saved; - Copy it to your clipboard. This path now must be added to the Windows Environment Variable Path;
- Click on the windows button and search for environment. Then, click on
Edit the system environment variables
; - In the
System Properties
dialog, click on theEnvironment Variables...
button; - In
User Variables
, selectPath
and then click on theEdit...
button; - Click on the
New
button to add a new path to the search; - Paste the yarn global binary path copied in step 2 and click
OK
when prompted. This will save your changes; - Log in and log out of your terminal for the changes to take effect.
If the error persists, don't hesitate to send a ticket to our support team.
Command Reference
Every command executed in Toolbelt must begin with vtex
, irrespective of its name, as can be seen in the examples in the command table below.
Command Name | Functionality | Example |
---|---|---|
add | Adds an app to the dependencies of the app you are currently working on. | vtex add [email protected] |
browse | Opens an endpoint in a browser window based on the current logged in account, workspace and environment data. | vtex browse |
deploy | Publishes an app as a stable version. It only works in apps already published as a release candidate version. | vtex deploy [email protected] |
deprecate | Deprecates an app's version. | vtex deprecate [email protected] |
deps list | Lists the apps dependencies of the workspace in which you are working. | vtex deps list |
deps update | Updates all app dependencies of the workspace in which you are working or a single app dependency (when specified). | vtex deps update or vtex deps [email protected] |
deps diff | Compares app dependencies list of two workspaces and lists the apps that appear in both. | vtex deps diff workspace1 workspace2 |
edition | Gets the edition of the account you are logged in. | vtex edition |
edition set | Sets an edition for the account you are logged in. | vtex edition set [email protected] |
init | Displays a list with boilerplate files or directories for new VTEX apps. | vtex init |
install | Installs an app to the account you are logged into. | vtex install [email protected] |
link | Locally links the app directory you are working into the development workspace you are working on. | vtex link |
list | Lists all VTEX apps running in the account you are logged into. | vtex list |
local account | Displays the account name you are logged into and copies it to the clipboard. | vtex local account |
local workspace | Displays the workspace name you are working in and copies it to the clipboard. | vtex local workspace |
local token | Displays the user's authentication token current being used and copies it to the clipboard. | vtex local token |
promote | Promotes the production workspace you are working in to Master. | vtex workspace promote |
publish | Publishes the app as a release candidate version. | vtex publish [email protected] or vtex publish |
redirects import | Adds a URL redirect into the account and workspace you are logged into. | vtex redirects import {fileName}.csv |
redirects export | Gets existing redirects from the account and workspace you are logged into. | vtex redirects export {fileName}.csv |
redirects delete | Deletes redirects in the the account and workspace you are logged into. | vtex redirects delete {urlPath} |
release | Only for git users. When executed in the app's directory, it releases the app's new version in the manifest.json file according to SemVer (semantic versioning) best practices, updates the CHANGELOG.md file, assigns commit tags and sends the performed changes to the app's repository. | vtex release major beta |
support | Logs you into an account using a support role. | vtex support storecomponents |
test | Runs the app's unit tests according to the directory you are in (in case the app has any tests already configured for it). | vtex test |
undeprecate | Reverts an app's deprecation. | vtex undeprecate [email protected] |
uninstall | Uninstalls an app from the account you are logged into. | vtex uninstall [email protected] |
unlink | Unlinks the app directory you are in from the development workspace you are working in. | vtex unlink |
update | Update all installed apps to the latest version in the account you are logged into (valid only for patches and minors, Majors are not updated when using this command). | vtex update |
url | Displays a complete URL in the terminal, based on the current logged in account, workspace and environment data. | vtex url |
Updated 7 days ago