sections + key/valueCompact application and server settingsStructured configuration: change the value, not the punctuation
A text editor exposes the source. A structured command exposes the data model. Knowing when to use each view is one of the most practical terminal habits.
Why a specialized editor can be simpler than a text editor
Imagine a large configuration file where you only need to change application.debug. In a normal editor you search for the section, confirm the correct occurrence, preserve punctuation and save the whole file. A structured command lets you name the logical path directly.
This is not about replacing source editing. It is about matching the tool to the intention. If the intention is a value, address the value.
One rhythm across several formats
The structured modules share a deliberately similar grammar: open a file, read a key, search, write with :, delete a key, validate with -c, or dump the serialized source. After one format, the others feel familiar.
Opening a structured file also makes it active. $ can then stand in for that path, which keeps a sequence readable while you work on several keys in the same file.
install md mf code ini json xml yml toml conf propertiesmd lil-playground/project/configmf lil-playground/project/config/app.inicd lil-playgroundini project/config/app.iniini $ -w application.name : "lil playground"ini $ application.nameini $ -cINI: sections and simple values
INI is common in configuration because it is compact and readable: sections group key/value pairs. In lil-terminal, dotted paths let you address that logical structure without scrolling through the file.
Use INI when the format fits the software you are configuring; do not choose a format merely because a terminal command exists for it. The command is there to make an existing format easier to handle.
ini project/config/app.iniini $ -w application.debug : trueini $ application.debugini $ -f "application*" -kJSON: objects, arrays and typed values
For this practice file, open project/config/app.json with {} starter shown below, save it, and only then run the
JSON represents nested objects and arrays and is everywhere in APIs, application settings and package metadata. The punctuation is strict, so a focused path-based change can avoid accidental commas or braces.
Values keep their types: a number should stay a number, a boolean should stay a boolean, and quoted text is text. After changes, -c is a useful explicit validation step.
{}code project/config/app.json -njson project/config/app.jsonjson $ -w limits.history : 100json $ limits.historyjson $ -cYAML, TOML, XML, conf and properties
YAML is indentation-oriented and common in deployment files; TOML favors explicit tables and typed values; XML represents elements and attributes; .conf and .properties families are common in server and application configuration. They solve overlapping problems with different syntax traditions.
lil exposes a common day-to-day surface for supported structures, but it does not pretend the formats are identical. Advanced YAML features, unusual XML constructs or software-specific syntax may be better handled as source text in
objects + arraysAPIs, metadata and application configurationindentation + mappingsDeployment and human-edited configurationtables + typed valuesTool and application configurationelements + attributesStructured documents and legacy integrationskey/value familiesServer and application settingsValidate the model; dump only when you need the source
-c asks the module to validate the current document. dump returns a serialized source representation. Those are different operations: one answers “is this valid for the handler?”, the other answers “what source would this data produce?”.
Structured writes may normalize formatting, ordering or comments because the data is parsed and serialized. If exact source formatting is part of the requirement, use
json $ -cjson dump $ini dump project/config/app.iniKnow when to return to the code editor
Use the structured module for targeted values, searches and validation. Use
A good operator switches views without ideology: structure when meaning matters, source when source matters.
code project/config/app.ini -inicode project/config/app.json -jsonConfiguration changes are excellent script material
A verified sequence of configuration changes is exactly the kind of knowledge worth saving. Instead of keeping a note that says “remember to enable debug and change the name”, save the commands that perform those changes and validate the document.
The script becomes documentation that can execute. On another project you can review it, adjust the values and reproduce the same environment with much less guesswork.
Keep this as a script
Save this as configure-app.lil. It performs two focused INI changes and validates the result. Keep secrets out of reusable scripts unless you have deliberately designed a protected secret workflow.
#lil
@install md mf ini json
md lil-playground/project/config
mf lil-playground/project/config/app.ini
cd lil-playground
ini project/config/app.ini
ini $ -w application.debug : true
ini $ -w application.name : "lil playground"
ini $ -c