Skip to content

Vyuh CLI

The Vyuh CLI is a new tool that allows you to quickly scaffold projects, features, and schemas for the Vyuh framework. It is built on top of the Mason package and includes a few other utilities to make it easier to generate projects and features.

Activate the Vyuh CLI

The first step is to activate the pub package globally. This gives you access to the vyuh command that can be used to generate the initial structure. Run this command in your terminal:

Terminal window
dart pub global activate vyuh_cli

Create your new project

In the folder where you plan to build your mono-repo project for the Vyuh Application, run the following. The <project_name> tag is the one where you should specify your own name for the project.

Terminal window
vyuh create project <project_name>

The above command will create a complete folder structure under <project-name> which is described in more detail in the Project Structure article.

More parameters

There are more details you can pass when creating the project as shown below:

Create Project
A Vyuh Flutter project created by Vyuh CLI.
Usage: vyuh create project <project-name> [arguments]
-h, --help Print this usage information.
-o, --output-directory The desired output directory when creating a new project.
--description The description for this new project.
(defaults to "A Vyuh Flutter project created by Vyuh CLI.")
--cms The content management system for this new project.
(defaults to "sanity")
--org-name The organization for this new project.
(defaults to "com.example.vyuh")
--application-id The bundle identifier on iOS or application id on Android. (defaults to <org-name>.<project-name>)

Add a new feature

Just like the command for creating projects, we also have a vyuh create feature <feature-name> that does very similar things in terms of setting up a new feature for the project.

This will create a new feature package (in Flutter) inside the current folder of your shell.

Create Feature
Create a new Vyuh feature.
Usage: vyuh create feature <feature-name> [arguments]
-h, --help Print this usage information.
-o, --output-directory The desired output directory when creating a new feature.
Run "vyuh help" to see global options.

Add a new schema

We also have the command for creating a new schema for the CMS. You can use vyuh create schema <feature-name> to set it up.

This will create a new schema package (in Typescript) inside the current folder of your shell.

Create Schema
Create a new Vyuh feature CMS schema.
Usage: vyuh create schema <feature-name> [arguments]
-h, --help Print this usage information.
-o, --output-directory The desired output directory when creating a new feature.
--cms The content management system for this new schema.
(defaults to "sanity")
Run "vyuh help" to see global options.

Update the CLI

The Vyuh CLI has an inbuilt mechanism to update itself. You can run the following command to update the CLI:

Terminal window
vyuh update

This will check for the latest version of the CLI and update it if necessary.

Terminal window
> vyuh update
โœ“ Checked for updates (0.7s)
CLI is already at the latest version.

Summary

This guide showed you the steps to set up the Vyuh CLI on your system and use it to generate various parts of the Application. Currently, there is support for creating a new Vyuh App, a Vyuh Feature package for Flutter and a Vyuh schema package for Sanity CMS.

There will be more added in the future to accommodate other aspects of developing Vyuh Apps.