{
  "id": "codesnap",
  "name": "CodeSnap",
  "homepage": "https://github.com/codesnap-rs/codesnap",
  "description": "A pure Rust tool to generate beautiful code snapshots.",
  "executables": [
    "codesnap"
  ],
  "dotfiles": {
    "paths": [
      "~/.codesnap/config.json"
    ],
    "exclude": [],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "Create a code snapshot",
    "description": "Render a file or a command's output to a PNG/SVG snapshot. Colours, fonts, line highlighting, image/clipboard input and the ascii type are not modelled.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "src",
        "kind": "manual",
        "url": "https://raw.githubusercontent.com/codesnap-rs/codesnap/HEAD/cli/src/main.rs",
        "revision": "HEAD 2026-10-27",
        "evidence": "    #[arg(short = 'f', long)]\n    from_file: Option<String>,\n    #[arg(short, long)]\n    output: String,\n    #[arg(long, short, num_args=1..)]\n    execute: Vec<String>,\n    #[arg(long)]\n    range: Option<String>,\n    #[arg(long, default_value = \"false\")]\n    has_line_number: bool,\n    #[arg(long, short)]\n    language: Option<String>,\n    #[arg(long)]\n    code_theme: Option<String>,\n    #[arg(long)]\n    title: Option<String>,\n    #[arg(long)]\n    background: Option<String>,\n    #[arg(long)]\n    scale_factor: Option<u8>,\n    #[arg(long)]\n    config: Option<String>,\n/// - clipboard: Copy the snapshot to clipboard\n/// - file path: Save the snapshot to the file path\nREADME: codesnap -f ./code_snippet.hs -o \"./output.png\"\nclap derives each long flag from the field name in kebab-case, short flags as declared:\n--from-file -f, --output -o, --range, --language -l, --code-theme, --has-line-number, --title, --background, --scale-factor, --config\n"
      }
    ],
    "field": [
      {
        "id": "from_file",
        "label": "Source file",
        "type": "path",
        "option": [
          "--from-file",
          "-f"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "src"
        ]
      },
      {
        "id": "output",
        "label": "Output",
        "description": "A .png or .svg path, a directory, or the word clipboard.",
        "type": "string",
        "option": [
          "--output",
          "-o"
        ],
        "suggestions": [
          {
            "value": "clipboard",
            "label": "Copy to clipboard"
          }
        ],
        "effect": "overwrite",
        "sources": [
          "src"
        ]
      },
      {
        "id": "range",
        "label": "Line range",
        "description": "For example 3:5, 3: or :5.",
        "type": "string",
        "option": [
          "--range"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "language",
        "label": "Language",
        "type": "string",
        "option": [
          "--language",
          "-l"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "code_theme",
        "label": "Code theme",
        "type": "string",
        "option": [
          "--code-theme"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "has_line_number",
        "label": "Show line numbers",
        "type": "boolean",
        "option": [
          "--has-line-number"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "title",
        "label": "Window title",
        "type": "string",
        "option": [
          "--title"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "background",
        "label": "Background colour",
        "type": "string",
        "option": [
          "--background"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "scale_factor",
        "label": "Scale factor",
        "type": "integer",
        "option": [
          "--scale-factor"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "config",
        "label": "Config file",
        "type": "path",
        "option": [
          "--config"
        ],
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "src"
        ]
      }
    ],
    "task": [
      {
        "id": "file-snapshot",
        "label": "Snapshot a file",
        "fields": [
          "from_file",
          "output",
          "range",
          "has_line_number",
          "language"
        ],
        "required": [
          "from_file",
          "output"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "from_file",
          "output",
          "range",
          "has_line_number"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "language",
          "code_theme",
          "title",
          "background",
          "scale_factor",
          "config"
        ]
      }
    ]
  }
}
