{
  "slug": "code-language-detect",
  "name": "gizza-ai/code-language-detect",
  "version": "0.1.0",
  "title": "Code language detector — identify snippets locally — gizza.ai",
  "description": "Detect the likely programming language of a pasted code snippet with ranked alternatives, confidence and explainable signals.",
  "tags": [
    "code language detector",
    "programming language",
    "snippet",
    "syntax",
    "heuristic",
    "linguist"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/code-language-detect/",
    "markdown": "https://gizza.ai/tools/code-language-detect/index.md",
    "descriptor": "https://gizza.ai/tools/code-language-detect/tool.json",
    "deep_link_example": "https://gizza.ai/tools/code-language-detect/?code=Paste%20code%20here%2C%20for%20example%3A%0Afn%20main%28%29%20%7B%0A%20%20%20%20let%20mut%20count%20%3D%200%3B%0A%20%20%20%20println%21%28%22%7Bcount%7D%22%29%3B%0A%7D&filename=main.rs&candidates=rust%2Cpython%2Cjavascript&top_k=3&common_only=true&explain=true&output=report"
  },
  "cli": "gizza tool code-language-detect 'Paste code here, for example:\nfn main() {\n    let mut count = 0;\n    println!(\"{count}\");\n}'",
  "tool": {
    "description": "Detect the likely programming language of a pasted source-code snippet using deterministic weighted signals, optional filename/shebang hints, a common-language filter, ranked alternatives, confidence, and evidence. Runs locally with no network or ML model.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "candidates": {
          "default": "",
          "description": "Optional comma-separated allowlist of language ids to consider, such as rust,python,javascript. Leave empty to consider every built-in language.",
          "type": "string"
        },
        "code": {
          "description": "The source-code snippet to identify. Paste at least three to five lines for the most reliable result.",
          "type": "string"
        },
        "common_only": {
          "default": false,
          "description": "Only consider common mainstream languages. Useful for short snippets where niche-language signals can otherwise win.",
          "type": "boolean"
        },
        "explain": {
          "default": true,
          "description": "Include the weighted signals that explain the top detection.",
          "type": "boolean"
        },
        "filename": {
          "default": "",
          "description": "Optional filename hint such as main.rs, Dockerfile, package.json, or styles.css. Extensions and special filenames add a strong score bonus.",
          "type": "string"
        },
        "output": {
          "default": "report",
          "description": "Output format: readable report, structured JSON, or just the top language id.",
          "enum": [
            "report",
            "json",
            "language"
          ],
          "type": "string"
        },
        "top_k": {
          "default": 3,
          "description": "Number of ranked candidate languages to show. Use 0 to list every language with a positive score.",
          "maximum": 30,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "code"
      ],
      "type": "object"
    }
  }
}