Skip to content

Recipes

Common codify.json setups for different scenarios.

NodeJS

codify.json
[
{
"type": "nvm",
"nodeVersions": [
"20"
],
"global": "20"
}
]

Explanation: This config installs nvm or node version manager, a popular tool to download, install and manage NodeJS versions. Using nvm multiple versions of Node can be installed simultaneously and switched to using the command nvm use. See the nvm homepage for more info. This config will also install Node 20 and set Node 20 as the default version on the system.

Github SSH setup

codify.json
[
{
"type": "ssh-key",
"passphrase": "ReplacePassphraseHere"
},
{
"type": "ssh-config",
"hosts": [{
"Host": "github.com",
"AddKeysToAgent": true,
"UseKeychain": true,
"IdentityFile": "~/.ssh/id_ed25519",
"IgnoreUnknown": "UseKeychain"
}]
},
{
"type": "ssh-add",
"path": "~/.ssh/id_ed25519",
"appleUseKeychain": true
}
]

Explanation: This config will generate a new SSH key and complete the SSH setup for Github. Setting up SSH allows users to push and pull changes from Github without signing in. The Codify configs shown above will generate a new SSH key (if it doesn’t exist), automatically load the key to the ssh-agent and then save the passphrase for the key to the Apple keychain. To complete the setup for Github, the contents of the public key located in the file ~/.ssh/id_ed25519.pub will need to be copied to Github to the SSH and GPG keys page. After this git clone, pull, push and any other commands over SSH should work.

Python

codify.json
[
{
"type": "pyenv",
"global": "3.12",
"pythonVersions": [
"3.12"
]
}
]

Explanation: This config installs pyenv or python version manager. Similar to nvm, pyenv is a popular tool that downloads, manages, and installs Python versions. See the pyenv homepage for more info. This config will install pyenv, python 3.12 and then set 3.12 as the default system version.

Java

codify.json
[
{ "type": "homebrew" },
{
"type": "jenv",
"global": "21",
"add": [
"21"
]
}
]

Explanation: This config installs jenv, or Java version manager which is a popular tool for managing Java versions. Unlike nvm or pyenv, jenv can’t install Java versions by itself. See the jenv homepage for more info. Codify’s core plugin augments the functionality of jenv by attempting to install Java via homebrew if possible. In this config, Codify will install jenv, homebrew, Java 21 (via homebrew) and then set Java 21 as the system default.

Cloud dev-ops: AWS + Terraform + Docker

codify.json
[
{
"type": "homebrew",
"formulae": ["docker"]
},
{ "type": "terraform" },
{ "type": "aws-cli" },
{
"type": "aws-profile",
"profile": "default",
"csvCredentials": "TODO add path to csv credentials file"
}
]

Explanation: This is a config installs a couple of things for managing cloud dev-ops.

  • homebrew
  • docker
  • terraform
  • aws-cli

Docker is a tool for running application separately from the infrastructure and is widely used. Next Terraform is a configuration as code tool used for managing cloud environments allowing for reproducible and consistent cloud infrastructure. Terraform can be used to manage an entire AWS environment via code. AWS CLI is the commandline tool for managing an AWS environment. And aws-profile is a utility resource provided by Codify to help setup AWS CLI.

Environment Setup / Company Setup

codify.json
[
{
"type": "homebrew",
"formulae": ["jq", "openjdk@17", "jenv", "docker"],
"casks": ["openvpn-connect", "sublime-text", "dbeaver-community", "intellij-idea-ce", "1password", "google-chrome"]
},
{
"type": "nvm",
"nodeVersions": ["20"],
"global": "20"
},
{ "type": "vscode" },
{ "type": "aws-cli" },
{ "type": "terraform" },
{ "type": "pgcli" },
{
"type": "pyenv",
"global": "3.12",
"pythonVersions": ["3.12"]
},
{ "type": "git-lfs" },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo1.git" },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo2.git", "dependsOn": ["git-lfs"] },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo3.git" },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo4.git" },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo5.git" },
{ "type": "git-clone", "parentDirectory": "~/projects", "remote": "[email protected]:org/repo6.git" },
{ "type": "path", "path": "$HOME/projects/tools/bin", "dependsOn": ["git-clone.0"] }
]

Explanation: A sample setup file for a backend + dev-ops developer. This config will install both the tools needed for backend and dev-ops development as well as git clone all of the code as well. Note that git ssh will need to set up first before the git clone will run successfully. Follow the instruction guide on Github for setting up SSH keys

This is actually a redacted version of a config I created to help set up laptops at the startup I work at.