Framer CLI is the official set of command line tools that can be used to work with the Framer Framework.
The CLI helps the user to
- Easily generate new project.
- Generate new components/pages.
Requirements
Make sure the following are installed on your system
-
Make sure PHP is installed and can be accessed globally.
Window users
MacOs users
-
Git is installed in your system.
-
Composer is installed in your system environment
-
Make sure the git bash has
curl
orwget
installed
To install the CLI o nyour system run one of the following command based on your preferences
via curl
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/truestbyheart/Framer-CLI/master/install.sh)"
via wget
sudo sh -c "$(wget -O- https://raw.githubusercontent.com/truestbyheart/Framer-CLI/master/install.sh)"
Once the script has finished, make sure you add the following line to your shell configuration file.
alias framer="php $HOME/Framer-CLI/Framer.phar"
NB: $HOME is optional because its full path will be displayed once the script has executed successfully.
- Full-install
- This type of installation, clones the whole repository. it is a contributors choice where as you can modify and rebuild the app as you wish. But Please, share the love.
Note In order to build the CLI you need to turn off the Phar readonly in your php.ini
file.
- phar-install
- This installation downloads the build phar file from the repository. it is only for developer that only wish to use the CLI.
Once the installation is complete and the path is added to the shell configuration files i.e ~/.zshrc
or ~/.bash_profile
you can create a new project
by running the following command on your terminal/CMD
framer generate new name_of_your_project
For example
framer generate new todo-app
Make sure you run the command on root of the project.
framer generate component name_of_component
For example
framer generate component home
or
framer generate component components/home/home