# INI win format

`ini-win-format` · version 1.0.0 · Structured formats · free, no key needed

Format sections and keys into stable Windows initialization-file text.

**Use when you need to: format windows initialization profile · write private profile section text · canonical windows profile document.**

## Decide before calling

Read the [versioned contract](/v1/tools/ini-win-format/versions/1.0.0) and the supported scope below. Reuse `ini-win-format@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 `ini-win-format@1.0.0` for format windows initialization profile. 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

- format windows initialization profile
- write private profile section text
- canonical windows profile document
- stable initialization file formatting
- render profile sections and keys
- serialize windows profile without quotes
- emit lf private profile lines
- format preference section profile text

## Not supported

- look up a key in existing profile text
- keep enclosing quotation marks
- emit CRLF or a byte order mark

## Behavior

- Grammar getprivateprofilestring-pinned-1. Sections are emitted in caller order as [name] and a LF. Each key is name=value and a LF. No blank line, no space around =, and no added quotes.
- Names and values are not trimmed. Leading or trailing U+0020 or U+0009 on a name is padded_name. A trailing U+0020 on a value is trailing_blank. A value enclosed in one pair of ASCII quotes is enclosed_quotes, because retrieval would discard those marks.
- ASCII A-Z duplicates of a section or of a key inside one section are rejected. A bracket in a section name, or = or a bracket in a key name, is rejected. C0 controls other than U+0009, and U+007F, are rejected. U+0009 may appear inside a value or a name.
- bytes is the UTF-8 length of text. The same model always produces the same bytes. Limits are enforced on the model and on the JSON result.

## Input

- `sections` (array of object, required): max items 32

## Output

- `grammar` (constant "getprivateprofilestring-pinned-1", required)
- `text` (string, required): max length 8192
- `section_count` (integer, required): min 0; max 32
- `key_count` (integer, required): min 0; max 128
- `bytes` (integer, required): min 0; max 8192

## Limits

- max input bytes: 4096
- max sections: 32
- max keys: 128
- max name chars: 64
- max value chars: 512
- max output bytes: 6000
- max depth: 8
- max nodes: 1024

## Example

Request input:

```json
{
  "sections": [
    {
      "name": "section",
      "keys": [
        {
          "name": "key",
          "value": "string"
        }
      ]
    }
  ]
}
```

Response:

```json
{
  "result": {
    "grammar": "getprivateprofilestring-pinned-1",
    "text": "[section]\nkey=string\n",
    "section_count": 1,
    "key_count": 1,
    "bytes": 21
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "ini-win-format",
  "version": "1.0.0",
  "input": {
    "sections": [
      {
        "name": "section",
        "keys": [
          {
            "name": "key",
            "value": "string"
          }
        ]
      }
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/ini-win-format/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"sections":[{"name":"section","keys":[{"name":"key","value":"string"}]}]}'
```

The machine-readable contract is at [/v1/tools/ini-win-format/versions/1.0.0](/v1/tools/ini-win-format/versions/1.0.0).

### CLI

```sh
node cli.mjs run ini-win-format 1.0.0 --input input.json --base-url https://computefirst.net
```

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

## Related tools

- [Gitconfig format](/tools/gitconfig-format): Format git config sections as canonical text with escapes and subsections.
- [INI win parse](/tools/ini-win-parse): Retrieve a Windows profile string, or list section or key names, with pinned profile rules.
- [Toml10 format](/tools/toml10-format): Emit canonical TOML 1.0 source from a typed document tree.
- [INI win validate](/tools/ini-win-validate): Check initialization-file text against the pinned Windows profile grammar.
- [Systemd .env format](/tools/systemd-env-format): Format assignments into canonical systemd EnvironmentFile text, one quoting mode per value.
- [Gitconfig parse](/tools/gitconfig-parse): Parse git config text into ordered sections, subsections, and multivar entries.
