-
Notifications
You must be signed in to change notification settings - Fork 4
CLI Usage
Chris W edited this page Dec 9, 2024
·
1 revision
Goshot provides a powerful command-line interface for creating beautiful code screenshots. This guide covers how to use the CLI effectively.
# Create a screenshot of a code file
goshot main.go
# Create a screenshot and save it to a file
goshot main.go -o screenshot.png
# Create a screenshot and copy it to clipboard
goshot main.go -c
# Read from clipboard and create a screenshot
goshot --from-clipboard
-
Basic code screenshot with default settings:
goshot main.go
-
Custom theme and window style:
goshot main.go -t dracula -C windows
-
Custom background color and corner radius:
goshot main.go -b "#282a36" --corner-radius 8
-
Highlight specific lines:
goshot main.go --highlight-lines "5-8" --highlight-lines "10" --highlight-lines "15-20"
-
Show only specific line ranges:
goshot main.go --line-range "10-50"
-
Basic terminal output screenshot:
ls -la | goshot exec
-
Custom terminal dimensions:
ls -la | goshot exec -w 80 -H 24
-
Auto-sized terminal with custom padding:
ls -la | goshot exec -A --pad-left 2 --pad-right 2 --pad-top 1 --pad-bottom 1
-
Show command prompt:
ls -la | goshot exec -p --auto-title
-
Linear gradient:
goshot main.go \ --gradient-type linear \ --gradient-stops "#232323;0,#383838;100" \ --gradient-angle 45
-
Radial gradient:
goshot main.go \ --gradient-type radial \ --gradient-stops "#232323;0,#383838;100" \ --gradient-center-x 0.5 \ --gradient-center-y 0.5
-
Custom gradient with intensity:
goshot main.go \ --gradient-type spiral \ --gradient-stops "#232323;0,#383838;50,#444444;100" \ --gradient-intensity 8
-
macOS style with custom theme:
goshot main.go -C mac -T dark --window-title "My Code"
-
Windows style with custom corner radius:
goshot main.go -C windows --window-corner-radius 8
-
No window controls with light mode:
goshot main.go -L --no-window-controls
-
Custom padding:
goshot main.go --pad-horiz 40 --pad-vert 30 --line-pad 2
-
Code block padding:
goshot main.go \ --code-pad-left 20 \ --code-pad-right 20 \ --code-pad-top 10 \ --code-pad-bottom 10
-
Width constraints:
goshot main.go --min-width 800 --max-width 1200
-
Simple shadow:
goshot main.go --shadow-blur 10 --shadow-offset-y 4
-
Custom shadow:
goshot main.go \ --shadow-blur 15 \ --shadow-color "#00000066" \ --shadow-spread 5 \ --shadow-offset-x 0 \ --shadow-offset-y 8
-
Basic pattern redaction:
goshot config.yaml \ --redact \ --redact-pattern "password=.*" \ --redact-pattern "api_key=.*"
-
Blur redaction:
goshot config.yaml \ --redact \ --redact-style blur \ --redact-blur 5
-
Manual area redaction:
goshot screenshot.png \ --redact \ --redact-area "10,20,100,50" \ --redact-area "200,300,150,30"
# List available fonts
goshot fonts
# List syntax highlighting themes
goshot themes
# List supported languages
goshot languages
# Show version information
goshot version
-
-o, --output
: Output file path (default "code.png") -
-c, --to-clipboard
: Copy to clipboard -
--from-clipboard
: Read from clipboard -
-s, --to-stdout
: Write to stdout -
--auto-title
: Auto-set window title from filename/command
-
-C, --chrome
: Window chrome style (mac, windows, gnome) (default "mac") -
-T, --chrome-theme
: Chrome theme name -
-L, --light-mode
: Use light mode -
-t, --theme
: Syntax highlight theme (default "ayu-dark") -
-f, --font
: Font name (default "JetBrainsMonoNerdFont") -
--line-height
: Line height multiplier (default 1.0) -
-b, --background
: Background color (default "#ABB8C3") -
--corner-radius
: Image corner radius (default 10) -
--window-corner-radius
: Window corner radius (default 10) -
--line-range
: Line ranges to show (can specify multiple) -
--highlight-lines
: Lines to highlight (can specify multiple)
-
--line-pad
: Line padding (default 2) -
--pad-horiz
: Horizontal padding (default 20) -
--pad-vert
: Vertical padding (default 20) -
--code-pad-top
: Code top padding (default 10) -
--code-pad-bottom
: Code bottom padding (default 10) -
--code-pad-left
: Code left padding (default 10) -
--code-pad-right
: Code right padding (default 10) -
--line-number-pad
: Line number padding (default 10) -
--min-width
: Minimum width (default 0) -
--max-width
: Maximum width (default 0) -
--tab-width
: Tab width (default 4)
-
-w, --width
: Terminal width in cells (default 120) -
-H, --height
: Terminal height in cells (default 40) -
-A, --auto-size
: Auto-size terminal to content -
--pad-left
: Left padding in cells (default 1) -
--pad-right
: Right padding in cells (default 1) -
--pad-top
: Top padding in cells (default 1) -
--pad-bottom
: Bottom padding in cells (default 1) -
--cell-spacing
: Cell spacing (default 0) -
-p, --show-prompt
: Show command prompt -
-P, --prompt-template
: Custom prompt template
-
--gradient-type
: Type (linear, radial, angular, diamond, spiral, square, star) -
--gradient-stops
: Color stops (default "#232323;0,#383838;100") -
--gradient-angle
: Angle in degrees (default 45) -
--gradient-center-x
: Center X position (default 0.5) -
--gradient-center-y
: Center Y position (default 0.5) -
--gradient-intensity
: Intensity (default 5)
-
--shadow-blur
: Shadow blur radius (default 0) -
--shadow-color
: Shadow color (default "#00000033") -
--shadow-spread
: Shadow spread (default 0) -
--shadow-offset-x
: Shadow X offset (default 0) -
--shadow-offset-y
: Shadow Y offset (default 0)
-
--redact
: Enable redaction -
--redact-style
: Style (block or blur) (default "block") -
--redact-blur
: Blur radius (default 5) -
--redact-pattern
: Regex patterns to redact (can specify multiple) -
--redact-area
: Areas to redact as "x,y,width,height" (can specify multiple)
-
π€ Contributing
- Code of Conduct
- Development Workflow
- Project Structure
- Guidelines
- Testing
- Documentation