Back to articles
Generate Beautiful READMEs from Your Code Automatically
How-ToTools

Generate Beautiful READMEs from Your Code Automatically

via Dev.to TutorialAlex

Good READMEs get GitHub stars. Bad READMEs get closed tabs. But writing documentation after building a project feels like writing an essay after finishing the exam. The motivation is gone. Here's how to generate a complete README from your code in one command. The Script Create scripts/generate-readme.sh : #!/bin/bash # Collect project context PACKAGE = $( cat package.json 2>/dev/null || echo "No package.json" ) STRUCTURE = $( find . -type f -not -path './node_modules/*' -not -path './.git/*' | head -50 ) ENTRY = $( cat src/index.ts 2>/dev/null || cat index.js 2>/dev/null || echo "No entry file" ) EXAMPLES = $( ls examples/ 2>/dev/null || echo "No examples directory" ) # Generate README curl -s https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY " \ -H "anthropic-version: 2023-06-01" \ -d "{ \" model \" : \" claude-sonnet-4-20250514 \" , \" max_tokens \" : 2048, \" messages \" : [{ \" role \" : \" user \" , \" content \" : \"

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles