Gitconfig parse
gitconfig-parse · version 1.0.0 · Structured formats · free, no key needed
Parse git config text into ordered sections, subsections, and multivar entries.
Use when you need to: parse git config file text · read gitconfig sections and subsections · decode git config quotes escapes and continuations.
Decide before calling
Read the versioned contract and the supported scope below. Reuse gitconfig-parse@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use gitconfig-parse@1.0.0 for parse git config file text. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- parse git config file text
- read gitconfig sections and subsections
- decode git config quotes escapes and continuations
- keep ordered git config multivar entries
- parse a git config without following includes
- gitconfig syntax to structured sections
- פענוח קובץ הגדרות גיט למקטעים ולציטוטים
Not supported
- follow include or includeIf files
- accept deprecated dotted subsection headers
- canonicalize boolean integer or path values
- preserve comments blank lines or key case
Behavior
- Whitespace is only SP and HT. CRLF is one line break. A lone CR, NUL, DEL, or any other C0 control except HT, LF, and BS is invalid_input. A leading U+FEFF is not skipped.
- Section and variable names are ASCII case-folded. A variable must start with a letter. A subsection is case-sensitive and is not folded. A dot in the unquoted section token is unsupported_input reason dotted_section_name.
- Value escapes, inside or outside quotes, are only \" \\ \n \t and \b. A backslash before LF continues the value. Quotes are delimiters, so adjacent quotes concatenate. # and ; comment only outside quotes. A bare name is implicit_bool true with a null value. Explicit values stay strings: yes, no, true, false, integers, paths, and the empty string are not canonicalized.
- include and includeIf headers are unsupported_input reason include_not_supported. A truncated header is invalid_input even when the partial name looks like include.
- Duplicate sections are not merged. Repeated variables stay in file order.
- The entry line is the physical line of the terminating newline, which is the last line of a continued value. The section line is the line containing [. Output bytes are the UTF-8 size of the JSON result.
Input
text(string, required): max length 65536; Git config file text. UTF-8 byte length is enforced separately.
Output
sections(array of object, required): max items 128section_count(integer, required): min 0; max 128entry_count(integer, required): min 0; max 512
Limits
- max input bytes: 65536
- max output bytes: 16384
- max sections: 128
- max entries: 512
- max value bytes: 8192
- max subsection bytes: 1024
- max line bytes: 4096
Example
Request input:
{
"text": "[core]\n\tfilemode = false\n"
}
Response:
{
"result": {
"sections": [
{
"name": "core",
"subsection": null,
"line": 1,
"entries": [
{
"key": "filemode",
"value": "false",
"implicit_bool": false,
"line": 2
}
]
}
],
"section_count": 1,
"entry_count": 1
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "gitconfig-parse",
"version": "1.0.0",
"input": {
"text": "[core]\n\tfilemode = false\n"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/gitconfig-parse/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"[core]\n\tfilemode = false\n"}'
The machine-readable contract is at /v1/tools/gitconfig-parse/versions/1.0.0.
CLI
node cli.mjs run gitconfig-parse 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Gitconfig format: Format git config sections as canonical text with escapes and subsections.
- Gitconfig key list: List git config keys in file order with qualified names and occurrences.
- Systemd directive list: List systemd unit directives as words using syntax quoting, continuation, and resets.
- Systemd .env parse: Parse a systemd EnvironmentFile into assignments, a last-wins map, and duplicate keys.
- Systemd .env format: Format assignments into canonical systemd EnvironmentFile text, one quoting mode per value.
- Xpath10 evaluate: Evaluate an XPath 1.0 value expression and return its type with an exact string, number, or boolean token.