codecontext update

Regenerate documentation with latest code changes

The update command analyzes your codebase and regenerates documentation to reflect recent changes. It intelligently merges updates while preserving your custom content.

$ codecontext update

Options

--watch, -w

Continuously watch for file changes and auto-update documentation

PRO
$ codecontext update --watch

--force, -f

Force regeneration of all documentation files, ignoring cache

$ codecontext update --force

--files, -f

Update only specific documentation files

$ codecontext update --files readme,changelog

How Updates Work

1

Analyze Changes

CodeContext scans your codebase for changes since the last update

2

Generate New Content

AI analyzes the changes and generates updated documentation

3

Smart Merge

Updates are intelligently merged, preserving your custom sections

4

Save & Report

Files are updated and you get a summary of changes

Watch ModePRO

Pro users can enable watch mode to automatically update documentation as they code:

$ codecontext update --watch
🔍 Watching for changes...
✓ Detected: src/api/users.ts modified
✓ Updating README.md...
✅ Documentation updated successfully!
📊 Time saved: ~30 minutes ($50 value)

Benefits:

  • • Real-time documentation updates
  • • Never forget to update docs
  • • Perfect for rapid development

Configurable:

  • • Debounce time
  • • Ignore patterns
  • • Update frequency

Preserving Custom Content

Smart Updates

CodeContext preserves your custom content during updates. Use these markers:

<!-- CUSTOM-SECTION-START -->
Your custom content here...
This won&apos;t be overwritten!
<!-- CUSTOM-SECTION-END -->

Common Use Cases

After Adding New Features

Update docs to include your new functionality:

$ codecontext update

Before Release

Ensure docs are current before tagging a release:

$ codecontext update --force

During Development (Pro)

Keep docs always in sync while coding:

$ codecontext update --watch

Troubleshooting

Updates are overwriting my custom content

Make sure to wrap custom content in CUSTOM-SECTION markers. Also ensure you're not using --force flag unless necessary.

No changes detected

CodeContext uses git to detect changes. Make sure you've committed your changes or use --force to regenerate everything.

Update is taking too long

For large projects, updates can take time. Use --files flag to update only specific documentation files.

Related Commands

);