Usage
How to use Codify
Codify is designed around two main commands (plan and apply) and a codify.jsonc configuration file.
codify plan reads your configuration file to determine the desired final state, queries what is currently
installed and configured on your system, then generates a plan showing how to reach the desired state.
codify apply executes the changes listed in the plan.
Commands
- plan: Generates an execution plan showing changes needed to reach the desired configuration. Performs a refresh scan to determine current state, then compares with the config file to compute required operations. The plan is not executed.
- apply: Generates a plan and prompts for approval before installing or updating resources on the system based on the config file.
- destroy: Uninstalls supported resources. Can work with or without a config file. If a config file exists, destroys matching resources. Otherwise, prompts for additional information to identify the resource.
- import: Generates Codify configurations from currently installed programs. Supports importing all supported resources or specific ones using wildcard matching (e.g.,
nvm asdf*). Results can be saved to an existing file, a new file, or printed to console. - init: Automatically generates a complete Codify config based on currently installed system resources. By default writes to
~/codify.jsonc.
Config File
| File type | Plan | Apply | Import |
|---|---|---|---|
| jsonc | ✅ | ✅ | ✅ |
| json | ✅ | ✅ | ✅ |
| json5 | ✅ | ✅ | ✅ |
| yaml | ✅ | ✅ | ❌ |
The config file defines your desired system state. You declare which resources (programs, tools, or settings)
should be installed and how they should be configured. The recommended file type is jsonc for its comment support.
YAML, JSON5 and regular JSON are also supported.
The config file is a top-level array of resource objects, each with a required type and resource-specific parameters. Most IDEs with SchemaStore support will automatically provide autocomplete for codify.jsonc files.
See codify.jsonc for more information.
[
{
"type": "homebrew",
"formulae": ["jq"]
},
{
"type": "vscode"
}
]Use Cases
Individual Developers
Keep multiple machines in sync: Maintain identical development environments across your work laptop, personal laptop, and desktop. Apply the same configuration to all machines with a single command.
Recover from system changes quickly: After a system reinstall, upgrade, or when setting up a new machine, run codify apply to restore your entire development environment in minutes instead of hours.
Document your setup as code: Version control your development environment alongside your projects. Know exactly what tools and versions you're using at any point in time.
Try new tools safely: Test new tools and configurations in an isolated environment using codify test, then destroy them cleanly if they don't work out.
Development Teams
Onboard developers instantly: Share a single codify.jsonc file with new team members. They run one command and have the exact environment needed to start contributing.
Ensure environment consistency: Eliminate "works on my machine" problems by ensuring everyone runs the same versions of tools, dependencies, and system configurations.
Share configurations easily: Store team configurations in Git or share via the Codify Dashboard. Update everyone's environment by updating a single file.
Standardize across projects: Maintain different configurations for different projects while ensuring consistency within each project's team.
Organizations
Standardize development environments: Define organization-wide standards for tools, versions, and configurations. Ensure compliance across teams and departments.
Reduce IT support burden: Developers self-service their environment setup and recovery. IT provides the configuration file instead of manual setup assistance.
Break down silos: Share and reuse configurations across teams. Make it easy for developers to work on multiple projects without manual environment switching.