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.

npx 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.

npx val login

Connect

Connect your local project to a Val Build project at admin.val.build. This command helps you set up the connection between your local development environment and your Val Build project.

npx 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.

npx val versions

List unused files

EXPERIMENTAL: List files that are in public/val 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.

npx val list-unused-files | xargs rm # removes all unused files