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 }
[[commands.source]]
id = "src"
kind = "manual"
url = "https://raw.githubusercontent.com/codesnap-rs/codesnap/HEAD/cli/src/main.rs"
revision = "HEAD 2026-10-27"
evidence = """
from_file: Option<String>,
output: String,
execute: Vec<String>,
range: Option<String>,
has_line_number: bool,
language: Option<String>,
code_theme: Option<String>,
title: Option<String>,
background: Option<String>,
scale_factor: Option<u8>,
config: Option<String>,
/// - clipboard: Copy the snapshot to clipboard
/// - file path: Save the snapshot to the file path
README: codesnap -f ./code_snippet.hs -o "./output.png"
clap derives each long flag from the field name in kebab-case, short flags as declared:
--from-file -f, --output -o, --range, --language -l, --code-theme, --has-line-number, --title, --background, --scale-factor, --config
"""
[[commands.field]]
id = "from_file"
label = "Source file"
type = "path"
option = ["--from-file", "-f"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["src"]
[[commands.field]]
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"]
[[commands.field]]
id = "range"
label = "Line range"
description = "For example 3:5, 3: or :5."
type = "string"
option = ["--range"]
sources = ["src"]
[[commands.field]]
id = "language"
label = "Language"
type = "string"
option = ["--language", "-l"]
sources = ["src"]
[[commands.field]]
id = "code_theme"
label = "Code theme"
type = "string"
option = ["--code-theme"]
sources = ["src"]
[[commands.field]]
id = "has_line_number"
label = "Show line numbers"
type = "boolean"
option = ["--has-line-number"]
sources = ["src"]
[[commands.field]]
id = "title"
label = "Window title"
type = "string"
option = ["--title"]
sources = ["src"]
[[commands.field]]
id = "background"
label = "Background colour"
type = "string"
option = ["--background"]
sources = ["src"]
[[commands.field]]
id = "scale_factor"
label = "Scale factor"
type = "integer"
option = ["--scale-factor"]
sources = ["src"]
[[commands.field]]
id = "config"
label = "Config file"
type = "path"
option = ["--config"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["src"]
[[commands.task]]
id = "file-snapshot"
label = "Snapshot a file"
fields = ["from_file", "output", "range", "has_line_number", "language"]
required = ["from_file", "output"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["from_file", "output", "range", "has_line_number"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["language", "code_theme", "title", "background", "scale_factor", "config"]