Custom Commands
Voltig CLI allows you to define your own custom commands in the voltig.yml configuration file. This makes it easy to automate build, test, deployment, and other project-specific tasks.
Defining Custom Commands
Section titled “Defining Custom Commands”Custom commands are defined under the commands section in your voltig.yml file. Each command can have a summary, a shell command, a script, and optional arguments.
Example
Section titled “Example”commands: build: summary: Build the project command: go build -o voltig . test: summary: Run tests command: go test ./... setup-dev: summary: Run setup script script: ./scripts/setup-dev.sh deploy: summary: Deploy with arguments script: ./scripts/deploy.sh args: - "--prod"Field Reference
Section titled “Field Reference”summary: Short description of the command.command: Shell command to execute (runs in your shell).script: Path to a script file to run.args: List of arguments to pass to the script.
💡 Tip: You can use both
commandandscriptfields, but typically only one is needed per command.
Running Custom Commands
Section titled “Running Custom Commands”To run a custom command, use:
voltig <command-name>For example, to run the build command:
voltig buildBest Practices
Section titled “Best Practices”- Use descriptive summaries for each command.
- Group related scripts and commands for clarity.
- Use arguments to make commands flexible.
- Store scripts in a
scripts/directory for organization.
⚠️ Note: Ensure your scripts are executable (
chmod +x script.sh) and paths are correct relative to your project root.