{
  "slug": "string-literal-extractor",
  "name": "gizza-ai/string-literal-extractor",
  "version": "0.1.0",
  "title": "String Literal Extractor — gizza.ai",
  "description": "Extract every string literal from pasted source code, skipping comments, with quote, length, and dedupe filters and list/JSON/CSV output.",
  "tags": [
    "strings",
    "code",
    "extract",
    "i18n",
    "parser"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/string-literal-extractor/",
    "markdown": "https://gizza.ai/tools/string-literal-extractor/index.md",
    "descriptor": "https://gizza.ai/tools/string-literal-extractor/tool.json",
    "deep_link_example": "https://gizza.ai/tools/string-literal-extractor/?code=const%20greeting%20%3D%20%22Hello%2C%20world%22%3B%0A%2F%2F%20%22this%20comment%20is%20skipped%22%0Aconst%20name%20%3D%20%27gizza%27%3B%0Aconst%20tpl%20%3D%20%60id-%24%7Bx%7D%60%3B&language=auto&quotes=all&format=list&decode_escapes=true&unique=true&min_length=0&line_numbers=true"
  },
  "cli": "gizza tool string-literal-extractor \"const greeting = \\\"Hello, world\\\";\n// \\\"this comment is skipped\\\"\nconst name = 'gizza';\nconst tpl = \\`id-\\${x}\\`;\"",
  "tool": {
    "description": "Pull every string literal out of a block of source code with a language-aware tokenizer that skips strings inside line and block comments, treats single quotes as character literals where the language does (C, Java, Rust, Go, C#), and understands Python triple-quoted strings, Go raw backticks, and Rust raw strings. Filter by quote style, drop duplicates, filter by minimum length, optionally decode escape sequences, and return the results as a plain list, JSON, or CSV — each literal carrying its source line and column. Set 'language' to auto to guess Python vs a generic C/JS profile.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "description": "The source code to scan for string literals. Paste a snippet or a whole file; only strings outside comments are extracted.",
          "type": "string"
        },
        "decode_escapes": {
          "default": false,
          "description": "Decode escape sequences (\\n, \\t, \\xNN, \\uXXXX, …) into their actual characters instead of leaving them literal. Ignored for raw strings.",
          "type": "boolean"
        },
        "format": {
          "default": "list",
          "description": "Output shape: a plain list of the values, JSON objects with line/column/quote/value, or CSV rows with those columns.",
          "enum": [
            "list",
            "json",
            "csv"
          ],
          "type": "string"
        },
        "language": {
          "default": "auto",
          "description": "Language whose string/comment/escape rules to apply. 'auto' guesses Python vs a generic C/JS profile from the code.",
          "enum": [
            "auto",
            "python",
            "javascript",
            "typescript",
            "java",
            "csharp",
            "c",
            "cpp",
            "go",
            "rust",
            "php",
            "ruby",
            "shell"
          ],
          "type": "string"
        },
        "line_numbers": {
          "default": false,
          "description": "Append the source line as [Ln] to each value in list output.",
          "type": "boolean"
        },
        "min_length": {
          "default": 0,
          "description": "Skip literals shorter than this many characters. 0 keeps every string.",
          "minimum": 0,
          "type": "integer"
        },
        "quotes": {
          "default": "all",
          "description": "Which quote style to keep: all, or only double-quoted, single-quoted, or backtick/template literals.",
          "enum": [
            "all",
            "double",
            "single",
            "backtick"
          ],
          "type": "string"
        },
        "unique": {
          "default": false,
          "description": "Drop duplicate values, keeping the first occurrence of each.",
          "type": "boolean"
        }
      },
      "required": [
        "code"
      ],
      "type": "object"
    }
  }
}