DotHRB: Develop, Run, Build
The DotHRB DotHRB executable serves a dual role: it is both an Application Server for running deployed applications and a command-line tool for building, testing, and managing DotHRB code.
Usage Syntax
dothrb [options] [command]
1. ⚙️ Global Options
These options configure the server environment, logging, and connection parameters.
| Option | Description |
|---|---|
-h / -help | Display the help documentation. |
-c <conf> | Set the Configuration profile: Debug or Release. |
-e <env> | Set the Environment: Development or Production. |
-url <url> | Set the listen URL for the application server (e.g., http://localhost:5000). |
-dbs <json> | Set dotdbs connection parameters (JSON format). |
-p:<prop=val> | Set a specific system property to a defined value. |
-l <0-9> | Set the log level (0 for minimal, 9 for verbose debugging). |
-workdir | Set the working directory for the executed command. |
-o | Set the output path for build commands. |
-err-stop | Halt execution immediately in case of an error. |
--license | Display license and copyright information. |
--version | Display the tool version number. |
2. 🧩 Commands
These actions are used for project lifecycle management (building, running, testing) and server control.
| Command | Description |
|---|---|
run | Build and run the project or a specific program file (.prg). |
build | Compile the project sources into deployable artifacts. |
watch | Monitor sources for changes and automatically rebuild/hot-reload the application (used for development). |
publish | Prepare the project for deployment, creating a final published package. |
test | Execute project tests defined in the codebase. |
clean | Remove build outputs (compiled files, artifacts) from the project directories. |
connect | Test a dotdbs server connection using the parameters defined by the -dbs option. |
html | Start as a plain HTTP/HTML server (serving static files). |
eval "expression" | Evaluate the given expression and print the result to standard output (stdout). |
3. 📝 Practical Examples
| Scenario | Command | Purpose |
|---|---|---|
| Hot-Reload Dev Mode | dothrb watch run | Starts the application and watches files, providing a quick development cycle. |
| Run Published App | dothrb myapp.app | Launches an application that has already been published/compiled. |
| Static File Server | dothrb html | Starts a minimal server to serve static HTML and assets. |
| Test DB Connection | dothrb -dbs dbs.json connect | Attempts to establish a connection to the dotdbs server using settings from dbs.json. |
| Code Evaluation | dothrb -eval "left('He', 1)" | Executes a simple DotHRB code expression and prints the result (H). |
| Run Specific Program | dothrb run mytest.prg | Compiles and executes a single program file. |