CLI

CLI

Validate

Validate val modules in your project. This command checks that your content follows your schema definitions and catches any validation errors.

Use the --fix flag to automatically fix issues that can be fixed, and --root to specify a different project root directory.

Bash
npx -p @valbuild/cli val validate --fix

Login

Login to admin.val.build and generate a Personal Access Token. This token is used to authenticate your local project with the Val Build service.

Bash
npx -p @valbuild/cli val login

Connect

Connect your project to Val Build to enable non-technical users to edit content. See Connect to Val Build for details.

Bash
npx -p @valbuild/cli val connect

Versions

Display the versions of @valbuild/core and @valbuild/next packages installed in your project. Useful for debugging and ensuring you have the correct versions.

Bash
npx -p @valbuild/cli val versions

List unused files

EXPERIMENTAL: List files that are in the /public/val folder but not in use by any Val module. This is useful for cleaning up unused files.

By default files and images are stored in the /public/val folder. You can pipe the output to xargs to remove all unused files.

Bash
npx -p @valbuild/cli val list-unused-files | xargs rm # removes all unused files