CLI Commands
Last updated: 2026-11-06
Canvas includes Sculpt, a command-line interface for development workflow. Sculpt provides essential tools to understand, debug, and manage your Canvas applications.
Getting Started
Sculpt is available immediately after installing Canvas. Run it to display command list and usage information:
./vendor/bin/sculpt Route Management
Get a complete overview of your application's routing structure:
./vendor/bin/sculpt routes:list This command displays all your routes in a table:
+-------+---------------------------------------+-----------------+
| Route | Controller | Aspects |
+-------+---------------------------------------+-----------------+
| /henk | Quellabs\Canvas\Controller\Test@index | [CacheAspect] |
+-------+---------------------------------------+-----------------+ Filter routes to show only those handled by a specific controller:
./vendor/bin/sculpt routes:list --controller=UserController Test which controller and method would handle a URL path:
./vendor/bin/sculpt routes:match /url/path/10 Specify the HTTP method to test method-specific routing:
./vendor/bin/sculpt routes:match GET /url/path/10 Clear the route cache to force route re-discovery:
./vendor/bin/sculpt routes:clear-cache Clear the entire annotation cache:
./vendor/bin/sculpt annotations:clear-cache Understanding the Output:
- Route - The URL pattern that triggers this endpoint
- Controller - The class and method responsible for handling requests
- Aspects - Applied AOP aspects for cross-cutting concerns
Project Setup
Generate the Canvas application configuration file, config/app.php, with sensible defaults for directory layout, template engine, output filter, annotation source, and the default security header policy:
./vendor/bin/sculpt canvas:init The command refuses to overwrite an existing config/app.php unless --force is passed:
./vendor/bin/sculpt canvas:init --force Generate the Inspector configuration file, config/inspector.php, with the debug bar disabled by default and the QueryPanel and WakaPACPanel registered as optional panels:
./vendor/bin/sculpt inspector:init Same --force behavior applies when a config file already exists:
./vendor/bin/sculpt inspector:init --force Both commands create the config/ directory automatically if it doesn't exist yet. See Configuration for how config files and .local.php overrides work, and Inspector for what the generated Inspector config controls.
Cache Management
Clear Smarty template cache:
./vendor/bin/sculpt smarty:clear-cache This removes cached template files. Use this when template changes aren't appearing in your application.
Troubleshooting Routes
When a route doesn't behave as expected, verify:
- The route was discovered by Canvas
- The URL pattern matches your expectations
- The correct controller method is mapped
- Expected aspects are applied
- Parameter extraction and validation work correctly
- HTTP method routing behaves as expected
Recommended Workflow
Use Sculpt in your development process:
- Create controllers with
@Routeannotations - Verify route discovery with
sculpt routes:list - Apply aspects using
@InterceptWithannotations - Confirm aspect application through route listing
- Debug routing issues with
routes:listandroutes:match - Test specific URLs with
routes:matchto validate behavior
The Canvas Way: Canvas embraces "convention over configuration." Sculpt doesn't generate boilerplate—it helps you understand and work with your existing application structure.
Sculpt CLI Commands
| Command | Description |
|---|---|
sculpt canvas:init | Create config/app.php with default settings (skips if it already exists) |
sculpt canvas:init --force | Create or overwrite config/app.php |
sculpt inspector:init | Create config/inspector.php with the debug bar disabled and QueryPanel/WakaPACPanel registered (skips if it already exists) |
sculpt inspector:init --force | Create or overwrite config/inspector.php |
sculpt routes:list | List all registered routes, their controllers, and applied aspects |
sculpt routes:list --controller=Name | Filter the route list to a specific controller |
sculpt routes:match /url/path | Show which controller and method would handle a URL |
sculpt routes:match GET /url/path | Same, restricted to a specific HTTP method |
sculpt routes:clear-cache | Clear the route cache and force route re-discovery |
sculpt annotations:clear-cache | Clear the entire annotation cache |
sculpt smarty:clear-cache | Clear the Smarty template cache |