diff --git a/src/cli.ts b/src/cli.ts index 2bd21b20..afb5d813 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,3 +1,12 @@ +/** + * @fileoverview Claudeman CLI command definitions + * + * Defines all CLI commands and subcommands for managing Claude sessions, + * tasks, Ralph loops, and the web server. + * + * @module cli + */ + import { Command } from 'commander'; import chalk from 'chalk'; import { getSessionManager } from './session-manager.js'; diff --git a/src/index.ts b/src/index.ts index 8a19053a..afcb6528 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,12 @@ #!/usr/bin/env node +/** + * @fileoverview Claudeman CLI entry point + * + * This is the main executable entry point for the Claudeman CLI. + * It sets up global error handlers and invokes the CLI parser. + * + * @module index + */ import { program } from './cli.js'; diff --git a/src/templates/claude-md.ts b/src/templates/claude-md.ts index 573fbe8a..5a6c4ea7 100644 --- a/src/templates/claude-md.ts +++ b/src/templates/claude-md.ts @@ -1,5 +1,26 @@ +/** + * @fileoverview CLAUDE.md template generation + * + * Generates CLAUDE.md configuration files for new Claudeman projects. + * Supports custom templates with placeholder substitution. + * + * @module templates/claude-md + */ + import { existsSync, readFileSync } from 'node:fs'; +/** + * Generates a CLAUDE.md configuration file for a new project. + * + * Supports custom templates via `templatePath`. If provided and the file exists, + * placeholders ([PROJECT_NAME], [PROJECT_DESCRIPTION], [DATE]) are replaced. + * Falls back to the default template if custom template is unavailable. + * + * @param caseName - The project/case name to use in the template + * @param description - Optional project description (defaults to "A new project") + * @param templatePath - Optional path to a custom template file + * @returns The generated CLAUDE.md content + */ export function generateClaudeMd(caseName: string, description: string = '', templatePath?: string): string { const date = new Date().toISOString().split('T')[0]; diff --git a/src/web/server.ts b/src/web/server.ts index 322b0700..b61c70a2 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -1,3 +1,15 @@ +/** + * @fileoverview Claudeman web server and REST API + * + * Provides a Fastify-based web server with: + * - REST API for session management, respawn control, and monitoring + * - Server-Sent Events (SSE) for real-time updates at /api/events + * - Static file serving for the web UI + * - 60fps terminal streaming with batched updates + * + * @module web/server + */ + import Fastify, { FastifyInstance, FastifyReply } from 'fastify'; import fastifyStatic from '@fastify/static'; import { join, dirname } from 'node:path';