You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Templates can include default header and footer configurations. User options always override template defaults:
// Template has header.backgroundColor set, but user can override itshellfie(output,{template: myTemplate,header: {backgroundColor: "#000000"},// overrides template default});
Options
shellfie(input,{template?: "macos",// 'macos' | 'windows' | 'minimal' | Templatetitle?: "my-terminal",// window titlewidth?: 80,// SVG width in pixels (auto-detected if not set)height?: 400,// SVG height in pixels (auto-detected if not set)padding?: 16,// number | [v, h] | [top, right, bottom, left]controls?: true,// show window control buttonscontrolsPosition?: "left",// 'left' (macOS) or 'right' (Windows)fontSize?: 14,// font size in pixelslineHeight?: 1.4,// line height multiplierfontFamily?: "'SF Mono', Monaco, monospace",// font stackcustomGlyphs?: true,// pixel-perfect box drawing charactersembedFont?: true,// embed default font as base64 (async only)customFont?: {// use your own fontdata: base64FontData,// base64-encoded font dataformat: "woff2",// 'woff2' | 'woff' | 'ttf'},theme?: customTheme,// custom color theme or see themes belowlanguage?: "typescript",// syntax highlighting: 'auto' | language | falsewatermark?: "Generated by shellfie",// string or WatermarkConfig (see Watermarks below)header?: {// header configurationbackgroundColor?: "#2d2d2d",// title bar background colorheight?: 40,// title bar height in pixelsborder?: true,// show bottom borderborderColor?: "#1a1a1a",// border colorborderWidth?: 1,// border width in pixels},footer?: {// footer configurationbackgroundColor?: "#2d2d2d",// footer background colorheight?: 30,// footer height in pixelsborder?: true,// show top borderborderColor?: "#1a1a1a",// border colorborderWidth?: 1,// border width in pixels},});
Watermarks
Add a watermark to the bottom-right corner of your SVG:
// Simple string (supports ANSI codes)shellfie(output,{watermark: "\x1b[90mGenerated by shellfie\x1b[0m",});// Full configurationshellfie(output,{watermark: {content: "powered by shellfie",style: {padding: 16,// number | [v, h] | [top, right, bottom, left]margin: [0,8],opacity: 0.8,},},});
Watermark Options
Option
Type
Description
content
string
Text (with ANSI) or SVG markup
type
'text' | 'markup'
Auto-detected: markup if starts with SVG element
style
WatermarkStyle
CSS-like positioning and appearance
WatermarkStyle
Supports CSS shorthand notation for padding and margin:
Note: Standard CSS properties like border don't work in SVG. Use SVG-specific properties (stroke, stroke-width) or markup watermarks for complex styling.
SVG Markup Watermarks
For advanced watermarks, use raw SVG markup:
shellfie(output,{watermark: {content: ` <a href="https://github.com/tool3/shellfie"> <rect width="100" height="20" rx="3" fill="#333"/> <text x="50" y="14" text-anchor="middle" fill="#fff">shellfie</text> </a> `,// type auto-detected as 'markup' since content starts with '<a'},});
The markup is wrapped in a <g> element positioned at the bottom-right, with font-family, font-size, and fill inherited from the theme.
Font Embedding
For portable SVGs that render identically everywhere:
The font gets base64-encoded directly into the SVG. No external requests, no CORS issues, no "why does this look different on their machine" debugging sessions.