Local Development
Command Line Interface Setup
17 min
the back4app command line interface (cli) is a powerful tool for managing apps, deploying code, and handling cloud functions directly from your terminal this guide will walk you through installation, configuration, and key features to get you started what you can do with back4app cli create and manage back4app applications deploy cloud code functions and other local files manage app versions and releases deploy web applications install and manage npm modules 1 installation prerequisites a back4app account sign up here https //www back4app com python on your machine for macos and linux option 1 install via script open your terminal and run curl https //raw\ githubusercontent com/back4app/parse cli/back4app/installer sh | sudo /bin/bash 2\ the tool will be installed as b4a in /usr/local/bin/b4a option 2 manual installation check your system's architecture by running uname pm 2\ download the correct executable for your system from this repository https //github com/back4app/parse cli/blob/back4app/installer sh 3\ move the downloaded file to /usr/local/bin/ mv \<downloaded file> /usr/local/bin/b4a chmod 755 /usr/local/bin/b4a 4\ the cli is now ready to use for windows download the b4a exe file from the releases page https //github com/back4app/parse cli/releases move the file to c \windows\system32 to make it accessible globally 2 configuration connect cli to your back4app account log into your back4app account generate an account key hover over the "hello, \[username]" menu go to account keys and create a new key 3\ configure the key in the cli b4a configure accountkey paste your account key when prompted this command will only work for the first time you do this setup on a specific computer otherwise, run b4a configure accountkey d b4a configure accountkey d to overwrite your old key with a new one the account keys you’ve used are stored in ${home}/ back4app/netrc ${home}/ back4app/netrc for mac and linux 3 usage create a new app open the terminal and run b4a new select "(n)ew" to create a new app follow the prompts to name and set up your app deploy cloud functions create your local cloud code file, e g , main js parse cloud define("hello", (request) => { return "hello, world!"; }); 2\ deploy the code b4a deploy the cli will upload your cloud and public folders to back4app other useful commands command description b4a list list all apps connected to your account b4a deploy deploy cloud code and hosting files b4a releases gets the releases for an app b4a rollback rolls back the version for the given app run b4a help for a full list of commands 4 troubleshooting common issues permission errors use sudo for linux/mac installations or ensure the windows executable is in the correct directory connection problems verify your account key configuration by re running b4a configure accountkey deployment errors check the parse local and parse project files for correct configuration 5 next steps experiment with cloud code by writing custom functions explore the local parse server environment https //www back4app com/docs/local development/parse server local for offline development conclusion with the back4app cli, you can efficiently manage your applications, deploy updates, and leverage powerful cloud code functions follow this guide to get started and explore the full potential of back4app's cli tool