env-setup is a workstation provisioner for macOS or Linux. It uses Ansible and Homebrew.
- Install the tool:
bash <(curl -sL jig.io/env-setup)- Or use Homebrew:
brew install luciditi/tap/env-setup.
- Or use Homebrew:
- Set the configuration:
env-setup -cnone: Use an empty configuration.mini: Use a minimum configuration.default: Use a workable default configuration.most: Use all features.custom: Create a newconfig.ymlconfiguration. Edit this configuration withenv-setup -e.
- Run the tool:
env-setup
The initialize command makes sure that you have git and an SSH key to download this repository. It installs the tool in your home directory under env-setup.
If you do not have an SSH key, add a new SSH key in GitHub.
The configuration YAML file (config.yml) contains a manifest of Ansible variables. These variables set what the system installs in your environment.
env-setup has five starter configuration templates:
none: The tool gives no environment setup. It keeps theenv-setuptool for later use.mini: The tool gives basic features (scripts, Homebrew, and Ansible).default: The tool gives a workable default environment setup.most: The tool gives all features for a complete environment setup.custom: You specify a customconfig.ymlconfiguration. Read this example config.yml.
Change the values in config.yml to match the needs of your environment setup. If you must manually update a custom configuration, run env-setup -e to edit the file.

When you run env-setup for the first time, it makes sure that you have Ansible. Then, it prompts you to select an Ansible playbook.
To specify a playbook, run the command with the playbook name. To run the configuration playbook, run env-setup 01-config. To run all playbooks in sequence, run env-setup all.
Run env-setup -u to update the installed repository and the installed dotfiles repository.
An Ansible playbook is a series of tasks. The tasks run to build your setup. env-setup has 8 main playbooks and other optional playbooks.
01-config: Configures your dotfiles for your app and CLI configuration. It defaults to env-setup-dotfiles when not overridden.02-cli: Installs CLI tools with Homebrew formulas.03-apps: Installs GUI applications with Homebrew casks. It also uses the Linux package manager and the App Store via mas.04-packages: Installs common programming language dependencies for development tooling. It supports Go, Node, PHP, Ruby, Rust, and Python.05-repos: Clones Git repositories for active development projects or reference vendors.06-os: Configures the OS settings.07-cloud: Configures the host for cloud file sync.08-prefs: Configures other app settings.
To add other playbooks, read the Custom Playbook section.
To see a list of tasks in a playbook, run env-setup -i with the playbook name. For example, run env-setup -i 03-apps.
The tool prints an ordered task list. The list contains a description and tags for each task in the playbook.
Each task has associated tags.
To select tags, use the -t option. To skip tags, use the -s option. To specify multiple tags, separate them with a comma.
For example:
- To install only Node and Python packages, run
env-setup -t node,python 04-packages. - To install all packages except PHP packages, run
env-setup -s php 04-packages.
You can override these environment variables to change behavior.
Init:
ENVSETUP_INTERACT: Enables interactive prompts during initialization. The default is1.ENVSETUP_KEY_FILE: Sets the SSH key path that the tool creates during initialization. The default is$HOME/.ssh/id_rsa.ENVSETUP_KEY_FILE_COMMENT: Sets the SSH key comment that the tool creates during initialization. The default isenv-setup:$USER@$(hostname).ENVSETUP_INSTALL_DIR: Sets the path to installenv-setupduring initialization. The default is$HOME/env-setup.
RunTime:
ENVSETUP_INSTALL_DIR: Sets the path whereenv-setuplooks for itsconfig.ymlfiles. The default is$HOME/env-setup.ANSIBLE_SUDO:env-setupruns Ansible with a sudo prompt (-Kby default). A value of-ndisables the prompt.ANSIBLE_CHECK:env-setupruns Ansible with a dry-run check. A value of-Cenables the check.ANSIBLE_STDOUT_CALLBACK:env-setupruns Ansible with a different status update. The options areunixy,dense,debug,yaml, orselective. The default isunixy.ANSIBLE_PLAYBOOK_INFO:env-setupruns Ansible with a display of playbook steps. A value of--list-tasksenables the display.ANSIBLE_SKIPPED_TAGS:env-setupruns Ansible and skips specified tags. The value is a comma-delimited list of tags.ANSIBLE_TAGS:env-setupruns Ansible and runs specific tags. The value is a comma-delimited list of tags.ANSIBLE_VERBOSE:env-setupruns Ansible with verbosity. A value of-vvvenables verbosity.
env-setup has tools to install an environment for testing.
The docker directory contains a Dockerfile. The Dockerfile builds an Ubuntu Linux docker image with env-setup and all playbooks.
You can find pre-built images on ghcr.io/luciditi/env-setup.
To test with a quick command, run source <(curl -sL jig.io/dev-aliases) && dev-env. This command installs an alias for docker run ... ghcr.io/luciditi/env-setup.
The terraform directory is a Terraform module. The module builds an SSH key and EC2 VMs for Linux (Ubuntu 20) and macOS (Sonoma).
After you build the VMs, use the scripts to test env-setup in the new VMs.
The vm directory has scripts to build Linux (Ubuntu) and macOS (Sonoma) VMs in Tart.
To use these scripts, do these steps:
- Run
eval "$(env-setup -A)"to createenv-vm-*aliases. - Run
env-vm-createto create a new VM. - Run
env-vm-startto start the VM. - Run
env-vm-initto initialize the VM withenv-setup. - Run
env-vm-sshto open a shell in the VM. - Run
env-vm-env-setupto runenv-setupin the VM. - Run
env-vm-stopto stop the VM.
To create a custom playbook, run ./scripts/add-playbook 09-my-playbook.
This command builds the directory structure in the ansible directory. The new playbook is selectable in the env-setup tool.
To add your playbook tasks, edit ansible/*/09-my-playbook/main.yml.
To add ansible-galaxy dependencies, edit ansible/*/09-my-playbook/requirements.yml.
Read the development README.