Skip to content

Latest commit

 

History

History
78 lines (58 loc) · 2.2 KB

File metadata and controls

78 lines (58 loc) · 2.2 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

ccsay is a joke CLI tool that displays text in ASCII art similar to cowsay. It renders text using block-style Unicode characters in orange color (ANSI escape code). By default, it displays "CLAUDE CODE" but accepts custom text as command-line arguments. It supports color customization and help options.

Development Setup

This project uses Bun as the JavaScript runtime. Ensure Bun is installed:

curl -fsSL https://bun.sh/install | bash
source ~/.bashrc

Common Commands

# Install dependencies
bun install

# Run in development
bun run dev
bun run src/index.ts "YOUR TEXT"
bun run src/index.ts --help  # Show help

# Run tests
bun test
bun test --watch

# Lint and format
bun run lint          # Check for issues
bun run lint:fix      # Fix auto-fixable issues
bun run format        # Format code

# Build standalone binary
bun run build         # Creates bin/ccsay-standalone

Project Structure

ccsay/
├── src/
│   ├── index.ts      # CLI entry point
│   └── fonts.ts      # ASCII art font definitions
├── test/
│   ├── fonts.test.ts # Font tests
│   └── index.test.ts # CLI tests
├── biome.json        # Formatter/linter config
├── vitest.config.ts  # Test runner config
└── package.json      # Project configuration

Technology Stack

  • Runtime: Bun (fast JavaScript runtime)
  • Language: TypeScript
  • Formatter/Linter: Biome (fast, unified toolchain)
  • Test Runner: Vitest
  • Build: Bun's built-in compiler for standalone executables

Architecture

The project consists of two main modules:

  1. fonts.ts: Contains the BLOCK_FONT dictionary mapping characters to 6-line ASCII art arrays
  2. index.ts: CLI interface that processes arguments, handles help flags, and outputs colored ASCII art

Testing

Tests are written using Vitest and cover:

  • Font character availability (A-Z, 0-9, punctuation)
  • Text-to-ASCII conversion logic
  • CLI argument parsing (color flags, help flags)
  • Help functionality and output formatting
  • Edge cases (empty strings, unknown characters)