Grav Content
- Grav - Multi Language
- Grav - Modular Pages
- Grav - Media
- Grav - Image Linking
- Grav - Page Linking
- Grav - Markdown Syntax
- Grav - Pages
Grav Themes
- Grav - Theme Customization
- Grav - Asset Manager
- Grav - Theme Variables
- Grav - Twig Filters & Functions
- Grav - Theme Tutorial
- Grav - Themes Basics
Grav Plugins
Grav Administration Panel
- Grav - Page Editor Advanced
- Grav - Page Editor Options
- Grav - Administration Panel Pages
- Grav - Configuration Site
- Grav - Configuration System
- Grav - Admin Dashboard
- Grav - Admin Introduction
Grav Advanced
- Grav - Forms
- Grav - YAML Syntax
- Grav - Lifecycle
- Grav - Development
- Grav - GPM
- Grav - CLI
- Grav - Debugging & Logging
- Grav - Performance & Caching
- Grav - Blueprints
Grav Hosting
Grav Troubleshooting
Grav Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Grav - CLI
In this chapter, we will understand how the CLI works in Grav. CLI stands for command pne interface stored in bin/Grav. It performs some tasks such as clearing cache, creating backup copy, etc.
Accessing CLI is different on different platforms. On Windows, you can access through cmd, on Mac you can access through Terminal and on Linux you can use shell. In windows, you can t use UNIX style commands. To use these just install the
package which provides GIT and GIT BASH and provides UNIX style commands on Windows.You can pst out the available commands in the Grav by using below command −
$ bin/Grav pst
You can see the available commands as shown in the following screenshot −
New Project Creation
Creating new project with Grav is very simple. You can create a new project with a Grav instance.
Open your terminal or console and navigate to your Grav folder.
$ cd ../ProjectFolder/grav
Your Grav will be installed in the root of your web server. If you want to create folder called contact inside the root folder of your Grav, then use the command as −
$ bin/Grav project-name ../webroot/ contact
It will download all the required dependencies and create a new Grav instance.
Instalpng Grav Dependencies
While instalpng dependencies, Grav automatically installs plugins namely error plugin, problems plugin and antimatter theme. You can install these by using the following command in your terminal or console −
$ cd ../webroot/myproject $ bin/Grav install
You will now see the downloaded plugins in their respective folders as −
../webroot/ myproject/user/plugins/error
../webroot/ myproject/user/plugins/problems
../webroot/ myproject/user/themes/antimatter
Clearing Grav Cache
You can delete files and folders to clear the cache which are stored in the cache/ folder. To clear cache, you can use below command −
$ cd ../webroot/myproject $ bin/Grav clear-cache
Create Backup
In Grav, you can back up your project stored under the root folder. As it won t use the database so there is no difficulty to take a backup. If you want to create the backup of your project called myproject (../webroot/myproject), then use the following command −
$ cd ../webroot/myproject $ bin/Grav backup
You will see a zip file of the backup created under the backup/ folder.
Updating Composer
You can update the Grav composer which was installed via Github and installed manually using composer based vendor packages. The command is −
$ bin/Grav composerAdvertisements