Reference
This page documents exact behavior. Open the reference overview
sync¶
sync is file-based projection.
Use it when another tool explicitly needs a generated dotenv file on disk instead of an in-memory subprocess environment.
Purpose¶
sync is file-based projection.
Use it when another tool expects a dotenv file on disk rather than an in-memory subprocess environment.
What it does¶
- resolves the active environment first
- writes
.env.localby default - writes
.env.<profile>for named profiles - writes to an explicit path with
--output-path PATH - writes the final expanded values, not the original
${...}expressions - respects global selectors such as
--group,--set, and--var - fails fast if the selected explicit profile does not exist
What sync does not do¶
sync does not turn the generated file into the source of truth.
The generated dotenv file is an artifact. It is safe to delete and regenerate because the underlying source of truth remains the contract plus local values.
When to use it¶
Use sync when another tool really needs an env file on disk.
Typical examples include older tooling, explicit Docker handoff, or integration points that cannot consume direct subprocess injection.
When not to use it¶
Do not use sync as your default workflow if run is enough. Writing secrets to disk is often less clean than direct in-memory projection.
If you only need stdout-oriented projection, use export instead.
Typical examples¶
Related commands¶
- use
runfor in-memory subprocess injection - use
exportfor stdout-oriented workflows - use
checkif you only need validation before projection