### Development Setup and Execution Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Guides users through cloning the repository, installing dependencies, and running the project in development mode or building it for production. Includes examples for testing the built version. ```bash git clone https://github.com/yourusername/oh-my-logo.git cd oh-my-logo npm install # Development mode npm run dev -- "TEST" sunset --filled # Build npm run build # Test the built version node dist/index.js "HELLO" matrix --filled ``` -------------------------------- ### CLI Tool Usage Examples Source: https://github.com/shinshin86/oh-my-logo/blob/main/CLAUDE.md Provides examples of how to use the oh-my-logo tool directly from the command line. This includes examples for both direct npx usage and after a global installation. ```bash # Direct CLI usage npx oh-my-logo "HELLO" sunset --filled # After global install oh-my-logo "WORLD" fire -d horizontal ``` -------------------------------- ### Install Deno Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Provides commands to install Deno on macOS, Linux, and Windows using curl, PowerShell, or package managers like Homebrew and Chocolatey. ```bash # macOS/Linux curl -fsSL https://deno.land/install.sh | sh # Windows irm https://deno.land/install.ps1 | iex # Or using package managers brew install deno # macOS choco install deno # Windows ``` -------------------------------- ### Run Basic oh-my-logo Deno Example Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Executes the basic Deno example script for oh-my-logo. Requires environment and read permissions to access necessary resources like font files. ```bash deno run --allow-env --allow-read examples/basic.ts ``` -------------------------------- ### Run Advanced oh-my-logo Deno Example Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Executes the advanced Deno example script for oh-my-logo, demonstrating custom palettes, gradients, and fonts. Requires environment and read permissions. ```bash deno run --allow-env --allow-read examples/advanced.ts ``` -------------------------------- ### Build Project for oh-my-logo Examples Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Builds the oh-my-logo project to generate JavaScript files in the 'dist/' directory, which are then used by the Deno examples. This is a prerequisite for running any of the provided scripts. ```bash # From the project root directory npm run build ``` -------------------------------- ### Run Error Handling oh-my-logo Deno Example Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Executes the error handling example for oh-my-logo in Deno. Demonstrates how to catch and report errors, such as invalid palette names. Requires environment and read permissions. ```bash deno run --allow-env --allow-read examples/error-handling.ts ``` -------------------------------- ### Run Filled Character oh-my-logo Deno Example Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Executes the filled character rendering example with oh-my-logo in Deno. May require write permissions in addition to environment and read permissions for certain rendering operations. ```bash deno run --allow-env --allow-read --allow-write examples/filled.ts ``` -------------------------------- ### Development Setup Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Instructions for setting up the development environment for Oh My Logo. ```APIDOC ## Development Setup ### Description Instructions for setting up the development environment for Oh My Logo. ### Method Development Commands ### Endpoint N/A ### Steps 1. **Clone the repository:** ```bash git clone https://github.com/yourusername/oh-my-logo.git cd oh-my-logo ``` 2. **Install dependencies:** ```bash npm install ``` 3. **Run in development mode:** ```bash npm run dev -- "TEST" sunset --filled ``` 4. **Build the project:** ```bash npm run build ``` 5. **Test the built version:** ```bash node dist/index.js "HELLO" matrix --filled ``` ``` -------------------------------- ### Deno Permissions for oh-my-logo Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Explains the necessary Deno permission flags required for running oh-my-logo examples. '--allow-env' and '--allow-read' are generally needed, while '--allow-write' might be required for specific features like filled character rendering. ```bash # Example: Basic usage deno run --allow-env --allow-read examples/basic.ts # Example: Filled characters (may need write permission) deno run --allow-env --allow-read --allow-write examples/filled.ts ``` -------------------------------- ### Run Rainbow Animation oh-my-logo Deno Example Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Executes the rainbow animation example for oh-my-logo in Deno, featuring cycling colors, fonts, and progressive text display. Requires environment and read permissions. The $'...' syntax is used to interpret escape sequences like \n. ```bash deno run --allow-env --allow-read examples/rainbow.ts $'YOUR\nTEXT' ``` -------------------------------- ### Import oh-my-logo Library in Deno Source: https://github.com/shinshin86/oh-my-logo/blob/main/examples/README.md Demonstrates the standard way to import the oh-my-logo library functions and constants within a Deno TypeScript file. It uses a relative path import from the 'dist/lib.js' file, assuming the example script is in the 'examples/' subdirectory. ```typescript import { render, renderFilled, PALETTES } from "../dist/lib.js"; ``` -------------------------------- ### Generate Basic ASCII Art Logo with CLI Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Creates a basic ASCII art logo from the provided text using the default settings. This is the simplest way to get started with oh-my-logo. ```bash npx oh-my-logo "HELLO WORLD" ``` -------------------------------- ### CLI Testing Commands Source: https://github.com/shinshin86/oh-my-logo/blob/main/CLAUDE.md Demonstrates various ways to test the command-line interface (CLI) of the oh-my-logo tool. These examples cover basic functionality, filled rendering, gradient directions, and listing available palettes. ```bash # Test basic functionality node dist/index.js "HELLO" sunset # Test filled rendering node dist/index.js "LOGO" fire --filled # Test gradient directions node dist/index.js "TEXT" ocean -d horizontal node dist/index.js "TEXT" ocean -d diagonal # List all palettes node dist/index.js "" --list-palettes ``` -------------------------------- ### TypeScript Usage with Library Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Provides an example of using the oh-my-logo library with TypeScript, including type definitions for options. ```typescript import { render, RenderOptions, PaletteName } from 'oh-my-logo'; const options: RenderOptions = { palette: 'ocean' as PaletteName, direction: 'vertical', font: 'Standard' }; const typedLogo = await render('TYPESCRIPT', options); console.log(typedLogo); ``` -------------------------------- ### Oh My Logo CLI Usage Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Examples of how to use the Oh My Logo command-line interface for generating various ASCII art styles. ```APIDOC ## Oh My Logo CLI Usage ### Description Examples of how to use the Oh My Logo command-line interface for generating various ASCII art styles. ### Method CLI Command ### Endpoint N/A ### Parameters #### Command Line Arguments - **text** (string) - Required - The text to render as ASCII art. - **palette** (string) - Optional - The color palette to use (e.g., 'purple', 'gold', 'forest'). - **-f, --font** (string) - Optional - The figlet font to use (e.g., 'Big'). - **--filled** - Optional - Renders filled block characters. - **--no-color** - Optional - Disables color output. - **--gallery** - Optional - Displays text in all available palettes. ### Request Example ```bash npx oh-my-logo "RETRO" purple -f "Big" ``` ### Response #### Success Response ASCII art rendered to the console. #### Response Example ``` ____ _ __ __ _____ _ | __ ) / \ | \/ | | ____| / \ | _ \ / _ \ | |\/ | | |__ / _ \ | |_) / ___ \| | | | | ___| / ___ \ |____/_/ \_\_| |_| |_____/_/ \_\ ``` ``` -------------------------------- ### Library API: Rendering ASCII Art with Options Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Provides a TypeScript example of using the `render` function from the oh-my-logo library to generate ASCII art. It shows how to specify text, color palette, font, and gradient direction. ```typescript async function render(text: string, options?: RenderOptions): Promise // Example usage: const asciiArt = await render('Hello World', { palette: 'sunset', font: 'Standard', direction: 'vertical' }); ``` -------------------------------- ### Type-Safe Logo Rendering with TypeScript in oh-my-logo Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Demonstrates how to use TypeScript types like RenderOptions and RenderInkOptions for type-safe logo rendering. It shows examples of configuring palettes, fonts, and directions, along with type validation for palettes and block fonts. This ensures compile-time checks for correct usage. ```typescript import { render, renderFilled, type RenderOptions, type RenderInkOptions, type PaletteName, type BlockFont, type Fonts } from 'oh-my-logo'; // Type-safe render options const asciiOptions: RenderOptions = { palette: 'sunset', // PaletteName or string[] font: 'Standard', // Fonts (figlet font name) direction: 'horizontal' // 'vertical' | 'horizontal' | 'diagonal' }; const logo = await render('TYPED', asciiOptions); // Type-safe filled render options const filledOptions: RenderInkOptions = { palette: ['#ff0000', '#00ff00'], // PaletteName or string[] font: 'chrome', // BlockFont type letterSpacing: 2 // number (0 or greater) }; await renderFilled('TYPED', filledOptions); // Using PaletteName type for validation const validPalette: PaletteName = 'ocean'; // const invalidPalette: PaletteName = 'invalid'; // TypeScript error! // BlockFont options for filled mode const blockFonts: BlockFont[] = [ '3d', 'block', 'chrome', 'grid', 'huge', 'pallet', 'shade', 'simple', 'simple3d', 'simpleBlock', 'slick', 'tiny' ]; // Direction type type GradientDirection = RenderOptions['direction']; const directions: GradientDirection[] = ['vertical', 'horizontal', 'diagonal']; // Creating a typed configuration object interface LogoConfig { text: string; options: RenderOptions; } const configs: LogoConfig[] = [ { text: 'FIRE', options: { palette: 'fire', direction: 'horizontal' } }, { text: 'OCEAN', options: { palette: 'ocean', direction: 'vertical' } }, { text: 'CUSTOM', options: { palette: ['#000', '#fff'], direction: 'diagonal' } } ]; for (const config of configs) { const result = await render(config.text, config.options); console.log(result); } ``` -------------------------------- ### Oh-My-Logo Palette Module: Accessing and Resolving Palettes (TypeScript) Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Shows how to use the Palette module in TypeScript to get palette names, default colors, resolve specific palettes by name, and access palette definitions directly. It also demonstrates type-safe usage of palette names. ```typescript import { PALETTES, resolvePalette, getPaletteNames, getDefaultPalette, getPalettePreview, type PaletteName } from 'oh-my-logo'; // Get all palette names const names = getPaletteNames(); console.log(names); // Output: ['grad-blue', 'sunset', 'dawn', 'nebula', 'mono', 'ocean', 'fire', 'forest', 'gold', 'purple', 'mint', 'coral', 'matrix'] // Get the default palette colors const defaultColors = getDefaultPalette(); console.log(defaultColors); // Output: ['#4ea8ff', '#7f88ff'] // Resolve a palette by name (returns copy of colors array) const sunsetColors = resolvePalette('sunset'); console.log(sunsetColors); // Output: ['#ff9966', '#ff5e62', '#ffa34e'] // Returns null for unknown palettes const unknown = resolvePalette('nonexistent'); console.log(unknown); // Output: null // Get a preview string for a palette const preview = getPalettePreview('fire'); console.log(preview); // Output: '#ff0844 → #ffb199' // Direct access to palette definitions console.log(PALETTES.matrix); // ['#00ff41', '#008f11'] console.log(PALETTES.gold); // ['#f7971e', '#ffd200'] console.log(PALETTES.nebula); // ['#654ea3', '#eaafc8'] // Type-safe palette name usage const paletteName: PaletteName = 'ocean'; const colors = PALETTES[paletteName]; ``` -------------------------------- ### Oh-My-Logo resolveColors Utility Function (TypeScript) Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Demonstrates the `resolveColors` utility function in TypeScript, which normalizes palette input by accepting either a built-in palette name or a custom color array. Includes examples of its use in validation before rendering. ```typescript import { resolveColors, render } from 'oh-my-logo'; // Resolve a built-in palette name const sunsetColors = resolveColors('sunset'); console.log(sunsetColors); // Output: ['#ff9966', '#ff5e62', '#ffa34e'] // Pass through custom color arrays unchanged const customColors = resolveColors(['#ff0000', '#00ff00', '#0000ff']); console.log(customColors); // Output: ['#ff0000', '#00ff00', '#0000ff'] // Error handling for unknown palettes try { resolveColors('nonexistent'); } catch (error) { console.error(error.message); // Output: Unknown palette: nonexistent } // Using in validation before rendering function safeRender(text: string, palette: string | string[]) { try { const colors = resolveColors(palette); return render(text, { palette: colors }); } catch (error) { console.warn(`Invalid palette, using default: ${error.message}`); return render(text); // Uses default palette } } await safeRender('SAFE', 'sunset'); // Works with built-in await safeRender('SAFE', ['#fff', '#000']); // Works with custom await safeRender('SAFE', 'invalid'); // Falls back to default ``` -------------------------------- ### CLI: Gallery Mode for Previewing Palettes Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Illustrates how to use the `--gallery` option to preview text across all available color palettes. This includes options for filled characters and custom fonts. ```bash # Display text in all available palettes npx oh-my-logo "PREVIEW" --gallery # Gallery with filled characters npx oh-my-logo "COLORS" --gallery --filled # Compare multi-line text across all palettes npx oh-my-logo "MY\nLOGO" --gallery # Gallery with custom font npx oh-my-logo "STYLES" --gallery -f Big ``` -------------------------------- ### Testing Suite with Vitest Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Details how to run the project's test suite using Vitest, including options for watch mode, coverage reports, UI mode, and running specific test files. Lists the structure of the test files. ```bash # Run all tests in watch mode npm run test # Run tests once (CI mode) npm run test:coverage # Run tests with UI npm run test:ui # Run specific test file npm test -- src/__tests__/cli.test.ts ``` -------------------------------- ### CLI Usage for oh-my-logo (Bash) Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Demonstrates the command-line interface for oh-my-logo, allowing quick logo generation directly in the terminal. Covers basic usage, palette selection, filled mode, gradient directions, multi-line text, custom fonts, shadow styles, letter spacing, gradient reversal, and custom color palettes via JSON. ```bash # Basic usage with default blue gradient npx oh-my-logo "HELLO WORLD" # With a specific color palette npx oh-my-logo "STARTUP" sunset # Filled block characters mode npx oh-my-logo "YOUR LOGO" fire --filled # Different gradient directions npx oh-my-logo "GRADIENT" ocean -d vertical # Top to bottom (default) npx oh-my-logo "GRADIENT" ocean -d horizontal # Left to right npx oh-my-logo "GRADIENT" ocean -d diagonal # Diagonal effect # Multi-line text (use \n for newlines) npx oh-my-logo "MY\nCOMPANY" sunset # Custom font (figlet fonts) npx oh-my-logo "RETRO" purple -f "Big" # Shadow styles for filled mode npx oh-my-logo "STYLE" fire --filled --block-font block npx oh-my-logo "STYLE" fire --filled --block-font chrome npx oh-my-logo "STYLE" fire --filled --block-font shade npx oh-my-logo "STYLE" fire --filled --block-font simpleBlock # Letter spacing for filled mode npx oh-my-logo "WIDE" ocean --filled --letter-spacing 5 npx oh-my-logo "TIGHT" ocean --filled --letter-spacing 0 # Reverse gradient colors npx oh-my-logo "REVERSE" sunset --reverse-gradient npx oh-my-logo "REVERSE" sunset --filled --reverse-gradient # Custom colors via JSON array npx oh-my-logo "CUSTOM" --palette-colors '["#00ff00","#ffa500","#ff0000"]' ``` -------------------------------- ### Testing Suite Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Information on how to run and understand the test suite for Oh My Logo. ```APIDOC ## Testing Suite ### Description Information on how to run and understand the test suite for Oh My Logo. ### Method Testing Commands ### Endpoint N/A ### Running Tests - **Run all tests in watch mode:** ```bash npm run test ``` - **Run tests once (CI mode) and get coverage:** ```bash npm run test:coverage ``` - **Run tests with UI:** ```bash npm run test:ui ``` - **Run a specific test file:** ```bash npm test -- src/__tests__/cli.test.ts ``` ### Test Suite Structure Tests are located in `src/__tests__/` and cover: - `cli.test.ts`: CLI command line behavior. - `lib.test.ts`: Library API functions. - `palettes.test.ts`: Color palette system. - `renderer.test.ts`: ASCII art rendering. - `utils/`: Utility function tests. ### Terminal Stability Testing Verify `--filled` mode cleanup with: ```bash ./scripts/test-filled-mode.sh ``` This script runs extensive tests to ensure terminal display integrity after repeated use of the `--filled` mode. ``` -------------------------------- ### List Available Color Palettes Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Displays all available color palettes for generating logos. This command helps users discover and choose from predefined color schemes. ```bash npx oh-my-logo "" --list-palettes ``` -------------------------------- ### Basic CLI Usage with Custom Font and Color Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Demonstrates how to use the oh-my-logo CLI to generate ASCII art with a specified font and color. This is the most straightforward way to create a custom logo. ```bash npx oh-my-logo "RETRO" purple -f "Big" ``` -------------------------------- ### Accessing Palette Information with Library Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Shows how to retrieve available palette names and specific palette color details using the library's utility functions. ```javascript import { PALETTES, getPaletteNames } from 'oh-my-logo'; // Access palette information console.log('Available palettes:', getPaletteNames()); console.log('Sunset colors:', PALETTES.sunset); ``` -------------------------------- ### Oh-My-Logo CLI: Color Control and Output Options Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Illustrates forcing color output in scripts or pipes, disabling color for plain text output, listing available palettes, and using gallery mode to render text in all palettes. ```bash npx oh-my-logo "DEPLOY SUCCESS" forest --color npx oh-my-logo "LOG ENTRY" --no-color npx oh-my-logo "" --list-palettes npx oh-my-logo "PREVIEW" --gallery npx oh-my-logo "COLORS" --gallery --filled ``` -------------------------------- ### CLI: Reading Input from Stdin and Using Color Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Shows how to pipe text into oh-my-logo via standard input and apply a specific color palette. This is useful for dynamic logo generation in scripts. ```bash # Read from stdin echo "DYNAMIC LOGO" | npx oh-my-logo - gold --filled # Force colors in scripts npx oh-my-logo "DEPLOY SUCCESS" forest --color # Plain text output npx oh-my-logo "LOG ENTRY" --no-color ``` -------------------------------- ### Programmatic Library Usage Source: https://github.com/shinshin86/oh-my-logo/blob/main/CLAUDE.md Shows how to use the oh-my-logo project as a programmatic library in TypeScript. It demonstrates importing `render` and `renderFilled` functions for generating ASCII art and filled logos, respectively. ```typescript import { render, renderFilled, PALETTES } from 'oh-my-logo'; // ASCII art rendering const logo = await render('HELLO WORLD', { palette: 'sunset', direction: 'horizontal', font: 'Standard' }); console.log(logo); // Filled block rendering await renderFilled('AWESOME', { palette: 'fire' }); ``` -------------------------------- ### Custom Color Palettes and Fonts with Library Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Demonstrates rendering an ASCII art logo with custom colors, font, and gradient direction using the library's `render` function. ```javascript import { render } from 'oh-my-logo'; // Using custom colors const customLogo = await render('MY BRAND', { palette: ['#ff0000', '#00ff00', '#0000ff'], font: 'Big', direction: 'diagonal' }); console.log(customLogo); ``` -------------------------------- ### Provide Custom Color Palettes via CLI Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Enables the use of custom color gradients for logos by providing a list of colors. Supports both JSON array format and simple comma-separated notation. ```bash # JSON array (double quotes recommended) npx oh-my-logo "MY LOGO" --palette-colors '["#00ff00","#ffa500","#ff0000"]' # Simple comma-separated notation (wrap each color in quotes) npx oh-my-logo "MY LOGO" --palette-colors "'#00ff00', '#ffa500', '#ff0000'" ``` -------------------------------- ### Palette Functions Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Information about accessing and using color palettes within the Oh My Logo library. ```APIDOC ## Palette Functions ### Description Information about accessing and using color palettes within the Oh My Logo library. ### Method Palette Accessors ### Endpoint N/A (Library Functions/Constants) ### Available Palette Functions/Constants - **`PALETTES`** (object): Contains all built-in color palettes. - **`resolvePalette(name)`** (function): Get palette colors by name. Returns `string[]`. - **`getPaletteNames()`** (function): Get an array of all available palette names. Returns `PaletteName[]`. - **`getDefaultPalette()`** (function): Get the default palette colors. Returns `string[]`. - **`getPalettePreview(name)`** (function): Get a preview string of palette colors. Returns `string`. ### Request Example ```typescript import { PALETTES, getPaletteNames } from 'oh-my-logo'; const paletteNames = getPaletteNames(); console.log('Available palettes:', paletteNames); const sunsetPalette = PALETTES['sunset']; console.log('Sunset palette:', sunsetPalette); ``` ### Response #### Success Response Access to palette data and functions. #### Response Example ```json { "available palettes": [ "grad-blue", "sunset", "dawn", "nebula", "ocean", "fire", "forest", "gold", "purple", "mint", "coral", "matrix", "mono" ], "Sunset palette": [ "#FF4E50", "#FC913A", "#F9D427", "#EDE574", "#A9FF7E" ] } ``` ``` -------------------------------- ### Basic Logo Generation Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Renders a given text as an ASCII logo using the default blue gradient. Supports multi-line text using newline characters. ```bash # Simple logo with default blue gradient npx oh-my-logo "STARTUP" # Multi-line company logo npx oh-my-logo "MY\nCOMPANY" sunset # Matrix-style hacker text npx oh-my-logo "HACK THE PLANET" matrix --filled ``` -------------------------------- ### Core Functions API Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Documentation for the core rendering functions available in the Oh My Logo library. ```APIDOC ## Core Functions API ### Description Documentation for the core rendering functions available in the Oh My Logo library. ### Method `render(text, options?)` ### Endpoint N/A (Library Function) ### Parameters #### Function Parameters - **text** (string) - Required - Text to display. - **options** (object) - Optional - Configuration for rendering. - **options.palette** (PaletteName | string[]) - Optional - Color palette name or custom colors. - **options.font** (string) - Optional - Figlet font name (default: 'Standard'). - **options.direction** ('vertical' | 'horizontal' | 'diagonal') - Optional - Gradient direction. ### Request Example ```typescript import { render } from 'oh-my-logo'; async function generateLogo() { const logo = await render('Hello World', { palette: 'sunset', font: 'Big', direction: 'vertical' }); console.log(logo); } generateLogo(); ``` ### Response #### Success Response `Promise` - The colored ASCII art as a string. #### Response Example ``` // Returns a promise that resolves to the ASCII art string ``` ### Method `renderFilled(text, options?)` ### Endpoint N/A (Library Function) ### Parameters #### Function Parameters - **text** (string) - Required - Text to display. - **options** (object) - Optional - Configuration for rendering. - **options.palette** (PaletteName | string[]) - Optional - Color palette name or custom colors. - **options.font** (BlockFont) - Optional - Shadow style ('block' | 'chrome' | 'shade' | 'simpleBlock' | '3d'). - **options.letterSpacing** (number) - Optional - Integer number of spaces between characters (0 or greater, default: 1). ### Request Example ```typescript import { renderFilled } from 'oh-my-logo'; async function generateFilledLogo() { await renderFilled('Filled Logo', { palette: ['#ff0000', '#00ff00'], font: 'block', letterSpacing: 2 }); } generateFilledLogo(); ``` ### Response #### Success Response `Promise` - Renders directly to stdout. #### Response Example ``` // Renders directly to the console, no return value. ``` ``` -------------------------------- ### Filled Logos with Custom Shadow Style (Library) Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Shows how to render filled ASCII art logos with custom shadow styles by specifying the `font` option in `renderFilled`. ```javascript import { renderFilled } from 'oh-my-logo'; // Filled with custom shadow style await renderFilled('SHADOW', { palette: 'sunset', font: 'shade' // Use dotted shadow effect }); ``` -------------------------------- ### Oh-My-Logo CLI: Custom Colors and Pipeline Input Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Demonstrates how to use the Oh-My-Logo CLI to generate logos with custom color palettes specified as a comma-separated string. It also shows support for pipeline input via stdin. ```bash npx oh-my-logo "CUSTOM" --palette-colors "'#00ff00', '#ffa500', '#ff0000'" echo "DYNAMIC LOGO" | npx oh-my-logo - gold --filled ``` -------------------------------- ### Using Custom Fonts with Figlet Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Demonstrates how to list available Figlet fonts, which can then be used with the `oh-my-logo` command via the `-f` or `--font` option for custom ASCII art styles. ```bash # List available fonts (depends on your figlet installation) figlet -f ``` -------------------------------- ### Customize Shadow Styles for Filled Logos (CLI) Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Allows customization of shadow styles for filled ASCII art logos. Different `--block-font` options provide distinct shadow appearances, from box-drawing to dotted. ```bash # Box-drawing shadows (default) npx oh-my-logo "STYLE" fire --filled --block-font block # Minimal sleek shadows npx oh-my-logo "STYLE" fire --filled --block-font chrome # Dotted/shaded shadows npx oh-my-logo "STYLE" fire --filled --block-font shade ``` -------------------------------- ### Adding New Color Palettes Source: https://github.com/shinshin86/oh-my-logo/blob/main/CLAUDE.md Illustrates how to add a new custom color palette to the project. This involves defining a new entry in the `PALETTES` object in `src/palettes.ts` with an array of hex color values. ```typescript 'my-palette': ['#color1', '#color2', '#color3'] ``` -------------------------------- ### Render Outlined ASCII Art Logos (TypeScript) Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Generates traditional outlined ASCII art with gradient colors using the `render` function. Accepts text and optional configuration for palette, font, and gradient direction. Returns a Promise resolving to the colored ASCII art string. Supports built-in and custom palettes, multi-line text, and provides access to palette information. ```typescript import { render, PALETTES, getPaletteNames } from 'oh-my-logo'; // Basic usage with default settings (grad-blue palette, vertical gradient) const simpleLogo = await render('HELLO'); console.log(simpleLogo); // Using a built-in palette with horizontal gradient const sunsetLogo = await render('STARTUP', { palette: 'sunset', direction: 'horizontal' }); console.log(sunsetLogo); // Using custom hex colors with diagonal gradient const customLogo = await render('BRAND', { palette: ['#ff0080', '#8000ff', '#0080ff'], direction: 'diagonal', font: 'Big' }); console.log(customLogo); // Multi-line text support const multiLine = await render('OH\nMY\nLOGO', { palette: 'fire', direction: 'vertical' }); console.log(multiLine); // Access palette information console.log('Available palettes:', getPaletteNames()); // Output: ['grad-blue', 'sunset', 'dawn', 'nebula', 'mono', 'ocean', 'fire', 'forest', 'gold', 'purple', 'mint', 'coral', 'matrix'] console.log('Sunset colors:', PALETTES.sunset); // Output: ['#ff9966', '#ff5e62', '#ffa34e'] ``` -------------------------------- ### Customizing Shadow Styles in Filled Mode Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Allows customization of shadow characters in filled mode using the `--block-font` option. Several styles like `block`, `chrome`, `shade`, and `simpleBlock` are available. ```bash # Try different shadow styles npx oh-my-logo "SHADOW" sunset --filled --block-font block npx oh-my-logo "SHADOW" sunset --filled --block-font chrome npx oh-my-logo "SHADOW" sunset --filled --block-font shade npx oh-my-logo "SHADOW" sunset --filled --block-font simpleBlock ``` -------------------------------- ### Library API: Rendering Filled Block Characters Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Demonstrates the use of the `renderFilled` function for creating ASCII art with filled block characters. This function allows customization of text, palette, font style, and letter spacing. ```typescript async function renderFilled(text: string, options?: RenderInkOptions): Promise // Example usage: await renderFilled('Filled Logo', { palette: ['#ff0000', '#00ff00'], // Custom palette font: 'block', letterSpacing: 2 }); ``` -------------------------------- ### Filled Rendering Mode Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Generates logos using filled block characters instead of outlined ASCII art. This mode offers different shadow styles for enhanced visual appearance. ```bash # Filled block characters npx oh-my-logo "CODE" fire --filled # Filled with different shadow styles npx oh-my-logo "CODE" fire --filled --block-font chrome # Minimal box shadows npx oh-my-logo "CODE" fire --filled --block-font shade # Dotted shadow effect npx oh-my-logo "CODE" fire --filled --block-font simpleBlock # Simple ASCII shadows ``` -------------------------------- ### Basic ASCII Art Rendering with Library Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Renders a basic ASCII art logo using the `render` function from the oh-my-logo library. Allows specifying palette and gradient direction. ```javascript import { render } from 'oh-my-logo'; // Basic ASCII art rendering const logo = await render('HELLO WORLD', { palette: 'sunset', direction: 'horizontal' }); console.log(logo); ``` -------------------------------- ### Filled Block Characters Rendering with Library Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Renders an ASCII art logo using filled block characters with the `renderFilled` function. Requires specifying the text and optionally a palette. ```javascript import { renderFilled } from 'oh-my-logo'; // Filled block characters await renderFilled('AWESOME', { palette: 'fire' }); ``` -------------------------------- ### Filled Logos with Letter Spacing (Library) Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Demonstrates controlling letter spacing for filled ASCII art logos using the `letterSpacing` option in the `renderFilled` function. ```javascript import { renderFilled } from 'oh-my-logo'; // Filled with wide letter spacing await renderFilled('WIDE', { palette: 'fire', letterSpacing: 3 }); ``` -------------------------------- ### Terminal Stability Stress Test Script Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Explains the purpose and execution of the `./scripts/test-filled-mode.sh` script, designed to stress-test the `--filled` mode's terminal cleanup capabilities across various fonts and palettes. ```bash # Run terminal stability stress test ./scripts/test-filled-mode.sh ``` -------------------------------- ### Handle Errors with Custom Classes in TypeScript Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Demonstrates how to use custom error classes like PaletteError, InputError, and FontError provided by oh-my-logo. It shows patterns for catching specific errors, implementing fallbacks, and ensuring robust rendering by handling potential exceptions during logo generation. ```typescript import { render, renderFilled } from 'oh-my-logo'; // Handling palette errors async function renderWithPaletteValidation(text: string, palette: string) { try { return await render(text, { palette }); } catch (error) { if (error.message.includes('Unknown palette')) { console.error(`Palette "${palette}" not found, using default`); return await render(text); } throw error; } } // Handling font errors async function renderWithFontFallback(text: string, font: string) { try { return await render(text, { font, palette: 'sunset' }); } catch (error) { if (error.message.includes('font')) { console.warn(`Font "${font}" not available, using Standard`); return await render(text, { font: 'Standard', palette: 'sunset' }); } throw error; } } // Handling input validation for filled mode async function safeRenderFilled(text: string, letterSpacing?: number) { try { await renderFilled(text, { letterSpacing }); } catch (error) { if (error.message.includes('Letter spacing must be 0 or greater')) { console.warn('Invalid letter spacing, using default'); await renderFilled(text); } else { throw error; } } } // Comprehensive error handling pattern async function robustRender(text: string, options = {}) { try { return await render(text, options); } catch (error) { console.error(`Render failed: ${error.message}`); // Fallback cascade try { return await render(text, { palette: 'grad-blue' }); } catch (fallbackError) { return await render('LOGO'); // Ultimate fallback } } } ``` -------------------------------- ### Generate Filled ASCII Art Logo with CLI Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Generates an ASCII art logo using filled block characters instead of outlined ones. This option provides a more solid appearance for the logo. ```bash npx oh-my-logo "YOUR LOGO" sunset --filled ``` -------------------------------- ### Render Filled Block Character Logos (TypeScript) Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Creates solid block character logos using React and Ink components via the `renderFilled` function. It renders directly to stdout and returns a Promise that resolves when rendering is complete. Supports custom fonts (shadow styles), letter spacing, and all palette options, including custom hex colors. ```typescript import { renderFilled } from 'oh-my-logo'; // Basic filled character rendering await renderFilled('LOGO'); // With color palette await renderFilled('AWESOME', { palette: 'fire' }); // Using custom colors await renderFilled('NEON', { palette: ['#ff00ff', '#00ffff', '#ffff00'] }); // Different shadow styles (block fonts) await renderFilled('SHADOW', { palette: 'sunset', font: 'block' // Default - box-drawing shadows ╔═╗ }); await renderFilled('CHROME', { palette: 'ocean', font: 'chrome' // Minimal sleek shadows ╦═╩ }); await renderFilled('SHADE', { palette: 'matrix', font: 'shade' // Dotted shadow effect ░█░ }); await renderFilled('SIMPLE', { palette: 'gold', font: 'simpleBlock' // Basic ASCII shadows _| }); // Custom letter spacing (0 or greater) await renderFilled('WIDE', { palette: 'coral', letterSpacing: 5 // Wide spacing between characters }); await renderFilled('TIGHT', { palette: 'mint', letterSpacing: 0 // No spacing (touching characters) }); ``` -------------------------------- ### Manage ANSI Colors and TTY Detection in TypeScript Source: https://context7.com/shinshin86/oh-my-logo/llms.txt Utilizes stdout utilities from oh-my-logo to determine if color output is appropriate based on environment variables, CLI flags, and terminal capabilities. It also provides a function to strip ANSI color codes for plain text output. ```typescript import { shouldUseColor, stripAnsiCodes } from 'oh-my-logo/dist/utils/stdout.js'; import { render } from 'oh-my-logo'; // Check if colors should be used const useColors = shouldUseColor(); console.log(`Color output: ${useColors}`); // Force color output const forceColors = shouldUseColor({ forceColor: true }); console.log(`Forced colors: ${forceColors}`); // Always true // Disable colors const noColors = shouldUseColor({ noColor: true }); console.log(`No colors: ${noColors}`); // Always false // Environment variables respected: // - NO_COLOR: Disables colors when set // - FORCE_COLOR: Enables colors when set // - CI + COLORTERM/TERM_PROGRAM: Enables colors in CI environments // - Falls back to process.stdout.isTTY detection // Strip ANSI codes from colored output const coloredLogo = await render('HELLO', { palette: 'sunset' }); const plainLogo = stripAnsiCodes(coloredLogo); // Use in pipelines or logging async function renderForOutput(text: string, options = {}) { const logo = await render(text, options); if (shouldUseColor()) { return logo; // Keep colors for terminal } return stripAnsiCodes(logo); // Strip for files/pipes } // Example: conditional coloring for different outputs const logo = await render('PIPELINE', { palette: 'matrix' }); if (process.stdout.isTTY) { console.log(logo); // Colored output to terminal } else { console.log(stripAnsiCodes(logo)); // Plain text to pipe/file } ``` -------------------------------- ### Reverse Gradients for Unique Effects (CLI) Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Applies a reversed color gradient to the ASCII art logo. This option can be combined with both outlined and filled modes for unique visual outcomes. ```bash # Reverse any color palette npx oh-my-logo "REVERSE" sunset --reverse-gradient # Works with filled mode too npx oh-my-logo "REVERSE" sunset --filled --reverse-gradient ``` -------------------------------- ### Add New Color Palette in TypeScript Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md This snippet demonstrates how to add a new color palette to the `src/palettes.ts` file. It involves defining a new key-value pair within the `PALETTES` object, where the key is the palette name and the value is an array of color hex codes. Ensure the format matches existing palettes. ```typescript export const PALETTES = { // ... existing palettes 'my-palette': ['#ff0000', '#00ff00', '#0000ff'], } as const; ``` -------------------------------- ### Letter Spacing Control Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Adjusts the spacing between characters in filled mode logos using the `--letter-spacing` option. Accepts integer values, where 0 means no spacing. ```bash # Default spacing (1 space) npx oh-my-logo "HI" --filled # Output: ██╗ ██╗ # Wide spacing (3 spaces) npx oh-my-logo "HI" --filled --letter-spacing 3 # Output: ██╗ ██╗ # No spacing (touching) npx oh-my-logo "HI" --filled --letter-spacing 0 # Output: ██╗██╗ # Note: Decimals are truncated (3.7 becomes 3) npx oh-my-logo "HI" --filled --letter-spacing 3.7 # Uses 3 spaces ``` -------------------------------- ### Control Letter Spacing for Filled Logos (CLI) Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Adjusts the spacing between characters in filled ASCII art logos. This feature is useful for controlling the visual density and aesthetic of the logo. ```bash # Wide spacing (5 spaces between letters) npx oh-my-logo "WIDE" ocean --filled --letter-spacing 5 # Tight spacing (no spaces) npx oh-my-logo "TIGHT" ocean --filled --letter-spacing 0 ``` -------------------------------- ### Run Filled Mode Stress Test Script Source: https://github.com/shinshin86/oh-my-logo/blob/main/scripts/README.md Executes a shell script designed to stress test the terminal cleanup functionality of the '--filled' mode in oh-my-logo. It builds the project, runs multiple renders with different fonts and color palettes, and checks for terminal corruption. ```bash #!/bin/bash # Build the project npm run build # Define iterations and fonts ITERATIONS=5 FONTS=11 # Loop for stress testing for ((i=1; i<=ITERATIONS; i++)); do for ((j=1; j<=FONTS; j++)); do echo "Running iteration $i, font $j..." ./dist/cli.js --filled --font $j --color random done done # Display verification text echo "Verification text:" echo "ASCII: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()_+-=[]{};':\",./<>?" echo "Unicode: αβγδεζηθικλμνξοπρστυφχψω ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" echo "Japanese: あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" echo "Box Drawing: ┌─┐ ├─┤ └─┘ ╔═╗ ║ ║ ╚═╝ ╒═╕ ╞═╡ ╘═╛" echo "Test complete. Check for any terminal corruption." ``` -------------------------------- ### Gradient Direction Control Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Specifies the direction of the color gradient using the `-d` or `--direction` option. Supported directions are `vertical` (default), `horizontal`, and `diagonal`. ```bash # Vertical gradient (default) npx oh-my-logo "LOGO" ocean # Horizontal gradient npx oh-my-logo "LOGO" ocean -d horizontal # Diagonal gradient npx oh-my-logo "LOGO" ocean -d diagonal ``` -------------------------------- ### Reverse Gradient Effect Source: https://github.com/shinshin86/oh-my-logo/blob/main/README.md Reverses the direction of the color gradient for any chosen palette, creating unique visual effects. This option works with both outlined and filled modes. ```bash # Normal sunset gradient (red → orange) npx oh-my-logo "GRADIENT" sunset # Reversed sunset gradient (orange → red) npx oh-my-logo "GRADIENT" sunset --reverse-gradient # Works with filled mode too npx oh-my-logo "GRADIENT" sunset --filled --reverse-gradient ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.