codecontext generate

Create additional documentation files for your project

The generate command creates new documentation files beyond the default README and CHANGELOG. Perfect for adding contribution guidelines, security policies, and more.

$ codecontext generate [type]

Available Documentation Types

readme

Project README with installation, usage, and API reference

$ codecontext generate readme

Creates: README.md

changelog

CHANGELOG from git history

$ codecontext generate changelog

Creates: CHANGELOG.md

contributing

Contribution guidelines

$ codecontext generate contributing

Creates: CONTRIBUTING.md

api

API documentation

$ codecontext generate api

Creates: API.md

Examples

Generate Contributing Guidelines

Create a comprehensive guide for contributors:

$ codecontext generate contributing

CONTRIBUTING.md will include:

  • • How to report bugs and request features
  • • Development setup instructions
  • • Code style guidelines
  • • Pull request process
  • • Testing requirements

Generate API Documentation

Automatically document your API endpoints:

$ codecontext generate api

API.md will include:

  • • Endpoint documentation
  • • Request/response examples
  • • Authentication details
  • • Error codes and handling
  • • Rate limiting information

Best Practices

  • Generate early: Add contribution guidelines before accepting PRs
  • Keep it updated: Run update on generated files too
  • Customize after: Generated files are starting points - edit them!
  • Link from README: Reference new docs in your main README

Common Questions

Can I generate multiple files at once?

Currently, you need to run the command once for each file type. Pro users can use scripts to automate multiple generations.

Will it overwrite existing files?

No, by default CodeContext won't overwrite existing files. Use the --force flag to overwrite.

Can I create custom documentation types?

Pro users can create custom templates in .codecontext/templates/ and generate documentation from them.

Related Commands

);