CLI Tools
CLI Tools
Hazaar ships with several CLI tools for common framework and database tasks. Each tool supports a help command to list available commands and show usage details for specific commands.
Hazaar
The hazaar tool provides core framework utilities such as configuration inspection, scaffolding, docs generation, file encryption helpers, and geo data caching.
Basic usage:
hazaar help
hazaar help <command>Global options:
--env,-e <ENV>: Override theAPPLICATION_ENVenvironment variable.
Common commands:
config: Check, show, or get application configuration.create: Create application objects (layout, view, controller, controller_basic, controller_action, model).doc: Generate API documentation (compile,index).file: Encrypt/decrypt files and view encrypted content.geo: Cache the geodata database file.metrics: View application metrics as list output (show) or as a graph (graph).
Examples:
hazaar config show
hazaar create controller Blog
hazaar doc compile
hazaar file encrypt config/secrets.json
hazaar geoMetrics
The metrics command can list available metric data sources and display metric data in either list or graph form.
Basic usage:
hazaar help metrics
hazaar metrics list <type>
hazaar metrics show <datasource>
hazaar metrics graph <datasource>Commands:
list [type]: List available application metrics. The type can bearchivesordatasources.show <datasource>: Display metric points in a timestamp/value list.graph <datasource>: Display metric points as an ASCII graph.
Examples:
hazaar metrics list datasources
hazaar metrics show hit
hazaar metrics graph hitExample output (hazaar metrics graph hit):
Hazaar Tool v0.3.0
Environment: development
Application Path: /work/app
Runtime Path: /work/app/.runtime
Showing metrics for data source: hit
Hit Counter - Count per minute for last hour (ticks: 6, rows: 60)
█
█
█ █
█ █
█ █
█ █
█ █
██ █
██ █
..|.....|.....|.....|.....|.....|.....|.....|.....|.....|...
08:41 08:47 08:53 08:59 09:05 09:11 09:17 09:23 09:29 09:35Warlock
The warlock tool controls the Warlock server and its agents.
Basic usage:
warlock help
warlock help <command>Global options:
--env,-e <ENV>: Override theAPPLICATION_ENVenvironment variable.
Server commands:
run: Start the server. Options:--config,--silent,--daemon.restart: Restart the server. Options:--force,--pid.stop: Stop the server. Options:--force,--pid.
Agent commands:
agent run: Start an agent. Options:--env,--path,--config,--silent,--daemon.agent restart: Restart an agent.agent stop: Stop an agent.
Examples:
warlock run --config config/warlock.php
warlock restart --force
warlock agent run --path /var/www/app --daemonDBI Tool
The dbitool utility manages database schema migrations and data synchronisation. It is the CLI companion to the DBI schema manager and data sync system.
See the DBI docs for deeper workflows:
Basic usage:
dbitool help
dbitool help <command>Global options:
--env,-e <ENV>: Override theAPPLICATION_ENVenvironment variable.--path,-p <PATH>: Application path to use when running the tool.
Common commands:
migrate [version]: Apply schema migrations. Options:--force_sync,--keep_tables,--force_init.sync [sync_file]: Sync data files into the database.snapshot: Create a migration snapshot from the current schema.checkpoint: Consolidate migrations into a baseline checkpoint.rollback: Roll back schema changes.current: Show current schema version.list: List schema versions.schema: Display the current schema.replay: Replay schema changes.
Examples:
dbitool migrate
dbitool migrate 20240215_120000
dbitool sync db/sync/core.json