jj / How jj util config-schema works

How jj util config-schema works

jj util config-schema prints the JSON Schema that describes jj's TOML config, the copy compiled into the binary.

On this page
  1. 1. Command-line surface
  2. 3. End-to-end flow
  3. 4. Core architecture touchpoints

In short: cli/src/config-schema.json is embedded at compile time as CONFIG_SCHEMA, and this command writes it to stdout unchanged. It reads no config and loads no repo.

The command is cmd_util_config_schema. Its help text: "Print the JSON schema for the jj TOML config format." (source). It is the ConfigSchema variant of UtilCommand (source, dispatch).

1. Command-line surface

No arguments: UtilConfigSchemaArgs is empty (source). The global flags are on the CLI page.

3. End-to-end flow

jj util config-schema: flow At compile time, config.rs embeds config-schema.json as the CONFIG_SCHEMA string. At run time, cmd_util_config_schema writes that string's bytes to stdout. CONFIG_SCHEMA include_str!("config-schema.json") cmd_util_config_schema ui.stdout().write_all(…)

4. Core architecture touchpoints

PieceRole here
cli/src/config-schema.jsonThe schema itself. Its top level is a draft-04 schema titled "Jujutsu config" (test).
CONFIG_SCHEMAThe embedded copy. Shell completion reads the same string to complete config keys (source).
Repo, working copy, operation logNot touched (source).