# Gitconfig key list

`gitconfig-key-list` · version 1.0.0 · Structured formats · free, no key needed

List git config keys in file order with qualified names and occurrences.

**Use when you need to: list git config keys in file order · flatten gitconfig multivar occurrences · enumerate qualified git config names.**

## Decide before calling

Read the [versioned contract](/v1/tools/gitconfig-key-list/versions/1.0.0) and the supported scope below. Reuse `gitconfig-key-list@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-key-list@1.0.0` for list git config keys in file order. 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

- list git config keys in file order
- flatten gitconfig multivar occurrences
- enumerate qualified git config names
- git config key list with subsections
- count repeated git config variables
- ordered keys from gitconfig text
- רשימת מפתחות לפי סדר הופעה בקובץ ההגדרות

## Not supported

- follow include or includeIf files
- accept deprecated dotted subsection headers
- return only the last multivar value
- canonicalize boolean integer or path values

## 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.
- A missing subsection produces section.key. A present subsection, even when empty or containing dots, produces section.subsection.key. Occurrence counts the same section, subsection, and key triple from 1 in file order. Output bytes are the UTF-8 size of this tool's JSON, not the parse tool's JSON.

## Input

- `text` (string, required): max length 65536; Git config file text. UTF-8 byte length is enforced separately.

## Output

- `keys` (array of object, required): max items 512
- `key_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:

```json
{
  "text": "[core]\n\tfilemode = false\n"
}
```

Response:

```json
{
  "result": {
    "keys": [
      {
        "section": "core",
        "subsection": null,
        "key": "filemode",
        "canonical": "core.filemode",
        "value": "false",
        "implicit_bool": false,
        "occurrence": 1,
        "line": 2
      }
    ],
    "key_count": 1
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "gitconfig-key-list",
  "version": "1.0.0",
  "input": {
    "text": "[core]\n\tfilemode = false\n"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/gitconfig-key-list/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-key-list/versions/1.0.0](/v1/tools/gitconfig-key-list/versions/1.0.0).

### CLI

```sh
node cli.mjs run gitconfig-key-list 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Gitconfig parse](/tools/gitconfig-parse): Parse git config text into ordered sections, subsections, and multivar entries.
- [Gitconfig format](/tools/gitconfig-format): Format git config sections as canonical text with escapes and subsections.
- [Systemd .env format](/tools/systemd-env-format): Format assignments into canonical systemd EnvironmentFile text, one quoting mode per value.
- [Systemd directive list](/tools/systemd-directive-list): List systemd unit directives as words using syntax quoting, continuation, and resets.
- [Systemd .env parse](/tools/systemd-env-parse): Parse a systemd EnvironmentFile into assignments, a last-wins map, and duplicate keys.
- [XML exc c14n canonicalize](/tools/xml-exc-c14n-canonicalize): Exclusive XML Canonicalization 1.0 of a whole document, with an optional inclusive prefix list.
