Skip to content

Getting Started

Get up and running with Project-Env: install the CLI, create a configuration file, run it, and integrate it into your environment.

Terminal window
brew install --cask project-env/tap/project-env-cli

See the CLI documentation for more details.

Add a project-env.toml file to the root of your project. Here is a minimal example that sets up a JDK and Maven:

tools_directory = ".tools"
[jdk]
version = "21.0.2+13"
distribution = "TEMURIN"
[maven]
version = "3.9.6"

See the CLI documentation for the full configuration reference, including Gradle, NodeJS, Git hooks, and generic tools.

Terminal window
project-env-cli install

This downloads and sets up the configured tools into the specified tools_directory. By default, the CLI outputs JSON with tool metadata (paths, environment variables).

To make the installed tools available in your current shell session, use the --output-template flag to generate and source a shell script:

Terminal window
source <(project-env-cli install --output-template=sh)

This exports the correct PATH and environment variables (e.g. JAVA_HOME) into your current shell.

To automatically activate tools when you enter a project directory, add this to your ~/.zshrc:

Terminal window
# Project-Env auto-loader
load_project_env() {
local search_dir="$PWD"
while [[ "$search_dir" != "/" ]]; do
if [[ -f "$search_dir/project-env.toml" ]]; then
source <(project-env-cli --config-file="$search_dir/project-env.toml" --output-template=sh)
return 0
fi
search_dir="$(dirname "$search_dir")"
done
}
autoload -U add-zsh-hook
add-zsh-hook chpwd load_project_env
load_project_env

This walks up the directory tree to find a project-env.toml and sources the tools on every directory change.

For automated integration without manual shell setup:

  • IntelliJ Plugin — configures IntelliJ to use the installed tools automatically
  • GitHub Action — makes tools available in your GitHub Actions workflows
  • Jenkins Plugin — makes tools available in Jenkins Pipeline steps