Skip to content
open tomato/ rafa
GitHub
rafa pages
  1. rafa
  2. rafa config

rafa config

Show every setting with the layer and file it came from, and set one key in the project's YAML file, keeping every comment.

rafa config reads and writes settings. Configuration explains where settings live and walks the keys by situation; this page is the reference.

Spends: nothing. Changes: set edits the project's .rafa/config.yaml in place and keeps its comments; it never writes a rafa.config.ts or rafa.config.mjs. show reads only.

Things to know before you use it:

  • A dangerous.* key is a person's consent. rafa prints each one set off its default once per run, naming the file that set it.
NOTE

In the target layout's cut table this code counts toward the command-line package, @open-tomato/rafa, at the root of the repository, which is where it lives in 0.47.0 too (Repository layout). [verify: its final placement]

Actions

ActionDoes
setset one key in the project's .rafa/config.yaml, keeping every comment
showprint every setting with its merged value, or with the layer, file and entry it came from

rafa config set

Set one key in the project's .rafa/config.yaml, keeping every comment.

rafa config set <assignment>

Sets one setting in the project's .rafa/config.yaml by its dotted key, one or two levels deep, and prints the value the file held before and the value it holds now. The file's text is edited in place and never re-serialised, so every comment survives: an uncommented line setting the key is replaced, a key missing from its section is added under it, and a missing section is appended. The edited text is read back through the config reader before it is written, and a file already reading the value is left as it was. Exit code 1, with nothing written, for an argument that is not <key>=<value>, a key the config schema does not know, a value the key's reader refuses, and a key written twice or in flow style. A key of the dangerous section is a person's consent, so it is refused the same way, before the file is read, in a shell an agent runs (CLAUDECODE set): the refusal prints the line to run in a terminal of your own, and no flag passes it. With --output=json the key, the file, the old and new values and whether it changed are the data of the terminal result event. The YAML file is the project's local layer, read over rafa.config.ts or rafa.config.mjs key by key, so beside a module file the command still edits the YAML file and never writes the module file. Starts no session.

ArgumentTypeWhat it is
assignmentstring, requiredThe dotted key, =, and the value as YAML writes it after the key's colon.

Examples:

  • rafa config set pr.base=stretch/9: Points pull requests at stretch/9 and prints the base they pointed at before.
  • rafa config set pr.base=main --output=json: Gives the key, the file, the old and new values and whether it changed as the terminal result.

Output formats: text, json.

rafa config show

Print every setting with its merged value, or with the layer, file and entry it came from.

rafa config show [--resolved] [--sources]

Prints every setting the config reads, resolved as every command resolves it: the project's files over the user scope's under ~/.rafa/, each over the default. A scope is read from two layers: its .rafa/config.yaml, the local layer rafa writes, over its rafa.config.ts or rafa.config.mjs, the module file rafa never writes, key by key. With no flag or --resolved, every setting with its merged value, nested as a config file spells it and printed as YAML, each value written as JSON. With --sources, one line per setting by its dotted key: its value, the layer that answered it (local for the project's YAML file, project for its module file, user, default, or template:<name> for a config template a file named) and, for a file, the file and the zero-based entry of it that last set the setting, for a template the file that named it; a YAML file is one entry, entry 0. Exit code 1 for an argument, for both flags at once, and for a config that cannot be used, each problem named. With --output=json the view is the data of the terminal result event: the nested settings under config, or the rows under settings. Starts no session.

FlagType and defaultWhat it does
--resolvedbooleanPrint every setting with its merged value, nested as the file spells it; the default view.
--sourcesbooleanPrint every setting with its value, its layer, and the file and entry it came from.

Examples:

  • rafa config show: Prints every setting with the value it resolved to, as YAML nested by section.
  • rafa config show --sources: Prints each setting with its value and where it came from: the layer, the file and the entry.
  • rafa config show --sources --output=json: Gives one row per setting, with its key, value, layer, file and entry, as the terminal result.

Output formats: text, json.