Boss โ Dependency Manager for Delphi and Lazarus
Getting Started
Boss is an open source dependency manager inspired by npm for projects developed in Delphi and Lazarus. We have a Getting Started article to help you get started with Boss.
- Download setup
- Just type
bossin the terminal - (Optional) Install a Boss Delphi IDE complement
Or you can use the following steps:
- Download the latest version of the Boss
- Extract the files to a folder
- Add the folder to the system path
- Run the command
bossin the terminal
Initialize a Project
Initialize a new project and create a boss.json file. Add -q or --quiet to skip interactive prompts and use default values.
boss init
boss init -q
boss init --quiet
Install Dependencies
Install one or more dependencies with real-time progress tracking:
boss install
Progress Tracking: Boss displays progress for each dependency being installed:
- โณ horse Waiting...
- ๐งฌ dataset-serialize Cloning...
- ๐ jhonson Checking...
- ๐ฅ redis-client Installing...
- ๐ฆ boss-core Installed
The dependency name is case insensitive. For example, boss install horse is the same as boss install HORSE.
boss install horse # HashLoad organization on GitHub
boss install fake/horse # Fake organization on GitHub
boss install gitlab.com/fake/horse # Fake organization on GitLab
boss install https://gitlab.com/fake/horse # Full URL
You can also specify the compiler version and platform:
boss install --compiler=37.0 --platform=Win64
Aliases: i, add
Remove Dependencies
Remove a dependency from the project:
boss uninstall
Aliases: remove, rm, r, un, unlink
Update Dependencies
Update all installed dependencies to their latest compatible versions:
boss update
Aliases: up
Upgrade Boss CLI
Upgrade the Boss CLI to the latest version. Add --dev to upgrade to the latest pre-release:
boss upgrade
boss upgrade --dev
List Dependencies
List all project dependencies in a tree format. Add -v to show version information:
boss dependencies
boss dependencies -v
Aliases: dep, ls, list, ll, la, dependency
Run Scripts
Execute a custom script defined in your boss.json file. Scripts are defined in the scripts section:
{
"name": "my-project",
"scripts": {
"build": "msbuild MyProject.dproj",
"test": "MyProject.exe --test",
"clean": "del /s *.dcu"
}
}
boss run build
boss run test
boss run clean
Authentication
Register credentials for a repository. Useful for private repositories:
boss login
boss login -u UserName -p Password
boss login -s -k PrivateKey -p PassPhrase # SSH authentication
Aliases: adduser, add-user
Remove saved credentials for a repository:
boss logout
Version
Show the Boss CLI version:
boss version
boss v
boss -v
boss --version
Aliases: v
Global Installation
Use global environment for installation. Packages installed globally are available system-wide:
boss install -g
boss --global install
Debug Mode
Enable debug mode to see detailed output:
boss install --debug
boss -d install
Help
Show help for any command:
boss --help
boss --help <command>
Cache Management
Manage the Boss cache. Remove all cached modules to free up disk space:
boss config cache rm
Aliases: purge, clean
Delphi Version Configuration
You can configure which Delphi version BOSS should use for compilation. This is useful when you have multiple Delphi versions installed.
Lists all detected Delphi installations (32-bit and 64-bit) with their indexes:
boss config delphi list
Selects a specific Delphi version to use globally. You can use the index from the list command, the version number, or the version with architecture:
boss config delphi use <index>
boss config delphi use <version>
boss config delphi use <version-architecture>
Example:
boss config delphi use 0
boss config delphi use 37.0
boss config delphi use 37.0-Win64
Git Client Configuration
You can configure which Git client BOSS should use:
embedded: Uses the built-in go-git client (default).native: Uses the system's installed git client (git.exe). Using native is recommended on Windows if you need support forcore.autocrlf(automatic line ending conversion).
boss config git mode native
boss config git mode embedded
Shallow Cloning
You can enable shallow cloning to significantly speed up dependency downloads. Shallow clones only fetch the latest commit without the full git history, reducing download size dramatically (e.g., from 127 MB to < 1 MB):
boss config shallow true
boss config shallow false
boss.json Configuration
The boss.json file is the configuration file for your project. It defines the project metadata, dependencies, scripts, and toolchain settings.
Fields
name(required): Package name. Must be unique if publishing."name": "my-awesome-library"description(optional): A brief description of your project."description": "REST API framework for Delphi"version(required): Package version following semantic versioning."version": "1.2.3"homepage(optional): Project website or repository URL."homepage": "https://github.com/myuser/my-project"mainsrc(optional): Main source directory path."mainsrc": "src/"browsingpath(optional): Additional paths for IDE browsing (semicolon-separated)."browsingpath": "src/;src/controllers/;src/models/"projects(optional): List of Delphi project files (.dproj) to compile."projects": [ "MyProject.dproj", "MyLibrary.dproj" ]Note: If not specified, Boss won't compile the package but will still manage dependencies.
dependencies(optional): Map of package dependencies with version constraints."dependencies": { "github.com/HashLoad/horse": "^3.0.0", "dataset-serialize": "~2.1.0", "jhonson": "*" }Supported version formats:
- Exact version:
"1.0.0" - Caret (minor updates):
"^1.0.0"(allows 1.x.x, but not 2.x.x) - Tilde (patch updates):
"~1.0.0"(allows 1.0.x, but not 1.1.x) - Wildcard (any):
"*"or"x" - Range:
">=1.0.0 <2.0.0"
- Exact version:
scripts(optional): Map of script names to commands."scripts": { "build": "msbuild MyProject.dproj /p:Config=Release", "test": "dunitx-console.exe MyProject.exe", "clean": "del /s *.dcu *.exe", "deploy": "xcopy /s /y bin\\*.exe deploy\\" }Execute with:
boss run build boss run testengines(optional): Specify minimum compiler/platform requirements."engines": { "compiler": ">=35.0", "platforms": ["Win32", "Win64", "Linux64"] }compiler: Minimum compiler versionplatforms: Supported target platforms
toolchain(optional): Specify the exact toolchain to use for this project."toolchain": { "compiler": "37.0", "platform": "Win64", "path": "C:\\Program Files\\Embarcadero\\Studio\\37.0", "strict": true }compiler: Required compiler versionplatform: Target platform ("Win32", "Win64", "Linux64", etc.)path: Explicit path to the compiler (optional)strict: Iftrue, fails if the exact version is not found (default:false)
Minimal Valid boss.json
{
"name": "my-project",
"version": "1.0.0"
}
Example Configurations
Use boss init to create a new boss.json interactively:
boss init
Or use quiet mode for defaults:
boss init -q
{
"name": "my-delphi-library",
"description": "Utilities for Delphi applications",
"version": "2.1.0",
"homepage": "https://github.com/myuser/my-library",
"mainsrc": "src/",
"projects": [
"MyLibrary.dproj"
],
"dependencies": {
"github.com/HashLoad/horse": "^3.0.0"
}
}
{
"name": "my-app",
"description": "My awesome Delphi application",
"version": "1.0.0",
"projects": [
"MyApp.dproj"
],
"dependencies": {
"github.com/HashLoad/horse": "^3.0.0"
},
"scripts": {
"build": "msbuild MyApp.dproj /p:Config=Release",
"run": "bin\\MyApp.exe",
"test": "dunitx-console.exe bin\\MyAppTests.exe"
},
"toolchain": {
"compiler": "37.0",
"platform": "Win32"
}
}
Comments
No comments yet. Start the discussion.