Inspect and edit values with eval, set and diff

§ 1Purpose

Read a single field, change it from the command line, and confirm exactly what changed.

§ 2Prerequisites

§ 3Flowchart

1. Read a field with eval2. Edit a field withset3. Confirm the change withdiff

§ 4Steps

§ 4.11

§ 4.2Read a field with eval

console
$ wcl eval site.wcl service.web.port
80

Run wcl eval site.wcl <dotted.path> (aliased wcl get) to resolve a path from the document root and print its value. Add --json for machine-readable output.

§ 4.32

§ 4.4Edit a field with set

console
$ wcl set site.wcl service.web.port 9090u32

Quoting

The value is parsed as a WCL expression — quote shell-special characters, e.g. wcl set site.wcl name '"alpha"'.

Run wcl set site.wcl <path> <value> to rewrite the field. wcl set follows the import chain and edits the file that actually declares the field.

§ 4.53

§ 4.6Confirm the change with diff

console
$ wcl diff HEAD:site.wcl site.wcl
modified "service:web" {
  field "port" { kind = :changed  old = 80u32  new = 9090u32 }
}

Run wcl diff <old> <new> over the evaluated views to see exactly what changed. Either side may be a <rev>:<path> git specifier, so you can diff the working tree against a committed version.

Verification

wcl eval returns the new value and wcl diff reports a single modified field — confirming the edit landed where you intended.