Codify
DocumentationUser guide

What is Codify?

A technical overview of Codify

Codify is a configuration as code tool that lets you define installations, packages and applications in an easy to read json file. Codify takes care of the hard part of downloading, installing and configuring them.

How does it work

Components:

  1. CLI: The CLI is the interface that the user interacts with. The Codify CLI reads configuration files (codify.jsonc files), downloads and manages plugins, generates diffs and orchestrates the process.

  2. Plugins: The Codify CLI relies on plugins to perform operations on the operating system. Plugins allow Codify to be extensible and any operation / installation can be supported as long as there is a plugin written for it. Plugins interact with the operating system using shell commands just as a user would do. By default, Codify ships with a core plugin maintained by the Codify team that handles common installations such as: homebrew, NodeJS, Python, and more. Additional packages can be found on the Codify registry here.

  3. codify.jsonc: The desired configuration that Codify should plan. The Codify CLI reads the codify.jsonc file, initializes the required plugins, plans the changes needed to meet the desired config in codify.jsonc and then applies the changes.

Multiple JSON like file types are supported such as .json, .jsonc, .json5 and .yaml. It is recommended to use jsonc because of the wide range of support and the ability to add comments. If your editor supports it, json5 is the preferred file type for it's looser syntax requirements, comments and multi-line strings.

Workflow

This is a common workflow when working with Codify.

  • Write configs: Write the desired config for your dev environment. See here for rules and the syntax for writing codify.jsonc files. Instead of writing your own configs, there are also pre-written that be found on the recipes page. For a list of available resources that can be provisioned using Codify see the codify registry.

  • Plan: Use codify plan or codify apply in the same directory as the codify.jsonc file in order for the CLI to pick up the file. Both codify plan and codify apply will generate a plan. A plan is a list of changes (a change set) that Codify will need to make in order for the desired config to be reached.

  • Apply: When using codify apply, the user will also be asked if they want to continue applying the plan. After answering yes, the CLI will apply the operations that were listed in the plan.

Usage Scenarios

Setting up a new computer

home
codify.jsonc

Codify is great at setting up new systems from scratch. It automates the process of downloading and installing packages and setting up the configurations so that developers don't need to waste their time looking through company wikis, reading documentation or debugging strange errors. Teams can maintain a central codify.jsonc file or a new codify.jsonc file can be quickly generated using the command codify import.

Project Integration

.gitignore
codify.jsonc
package.json
package-lock.json
tsconfig.json

Codify can also be directly integrated into project repositories. Simply commit a codify.jsonc file into the project. By maintaining a codify.jsonc file inside a project, the required packages and dependencies are kept together with the project.

On this page