{"id":"systemd-env-parse","version":"1.0.0","description":"Parse a systemd EnvironmentFile into assignments, a last-wins map, and duplicate keys.","supported_operations":["parse systemd environment file","read systemd EnvironmentFile assignments","systemd environmentfile quoting rules","find duplicate keys in a systemd environment file","unescape a systemd environmentfile value","systemd env file comment and continuation","last assignment wins in a systemd environment file"],"unsupported_operations":["join a later quoted piece onto an EnvironmentFile value","expand dollar variables or percent specifiers in an EnvironmentFile","open an EnvironmentFile path or honor a leading dash"],"semantics":["One value mode is chosen from the first character after = that is not a space or tab. A quote selects that quote mode. Any other character, including a backslash, selects unquoted mode.","In unquoted mode, quote characters stay quote characters. A backslash keeps the next character, so \\\\ is one backslash and \\n is the letter n. A backslash and a following line break are both dropped and no space is inserted.","After a closing quote, only spaces and tabs may remain before the line break. Other trailing text is invalid_input. This subset does not read another piece after the closer.","CR, LF, and CRLF are physical line breaks. A break at the end of the text does not open another line. Inside quotes, the break characters stay in the value. assignments keeps source order. variables maps each key to its last value. duplicate_keys lists keys seen more than once, ordered by the first line.","Empty lines, lines with no =, and lines whose first non-space character is # or ; are ignored. A comment does not swallow the next line. Invalid names reject the whole input. There is no specifier expansion."],"limits":{"max_input_bytes":4096,"max_assignments":128,"max_physical_lines":256,"max_value_bytes":4096,"max_key_chars":128,"max_continuations":32,"max_output_bytes":65536},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","maxLength":4096,"description":"EnvironmentFile text. Maximum 4096 UTF-8 bytes, checked in run()."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["assignments","variables","duplicate_keys"],"properties":{"assignments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value","line"],"properties":{"key":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"value":{"type":"string"},"line":{"type":"integer","minimum":1}}}},"variables":{"type":"object","additionalProperties":{"type":"string"}},"duplicate_keys":{"type":"array","items":{"type":"string"}}}},"examples":[{"input":{"text":"NAME=Ada\nCITY=Tel Aviv\n"},"output":{"assignments":[{"key":"NAME","value":"Ada","line":1},{"key":"CITY","value":"Tel Aviv","line":2}],"variables":{"NAME":"Ada","CITY":"Tel Aviv"},"duplicate_keys":[]}},{"input":{"text":"PATH=\\\\\n"},"output":{"assignments":[{"key":"PATH","value":"\\","line":1}],"variables":{"PATH":"\\"},"duplicate_keys":[]}},{"input":{"text":"# c\nA=\"x y\"\nA=z\n"},"output":{"assignments":[{"key":"A","value":"x y","line":2},{"key":"A","value":"z","line":3}],"variables":{"A":"z"},"duplicate_keys":["A"]}}],"execute_url":"/v1/tools/systemd-env-parse/versions/1.0.0/execute"}