Auto-Updates
Keep documentation in sync automatically
PRO FEATURENever worry about outdated documentation again. CodeContext Pro's auto-update feature keeps your documentation perfectly synchronized with your code changes. Set it up once, and your docs will always be current.
Auto-Update Magic
Git Integration
Updates on every commit
Scheduled Updates
Run on your schedule
CI/CD Ready
Integrate with any pipeline
Update Triggers
Git Hooks
Automatically update documentation on git events:
Pre-commit Hook
Update docs before committing:
codecontext update --pre-commit
Post-commit Hook
Update after changes are committed:
codecontext update --post-commit
Setup: Run codecontext init --hooks
to install git hooks automatically
CI/CD Integration
Add CodeContext to your continuous integration pipeline:
GitHub Actions
name: Update Documentation on: push: branches: [main] jobs: update-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Update docs run: | npm install -g codecontext codecontext update - name: Commit changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add . git commit -m "docs: auto-update documentation" git push
Watch Mode
Keep CodeContext running in the background during development:
$ codecontext update --watch
Features:
- • Monitors file changes
- • Intelligent debouncing
- • Selective updates
- • Low resource usage
Configuration:
{ "watch": { "debounce": 2000, "ignore": ["*.test.js"], "paths": ["src/**"] } }
Auto-Update Configuration
Fine-tune auto-update behavior in your config:
{ "autoUpdate": { "enabled": true, "triggers": { "commit": true, "push": false, "merge": true, "tag": true }, "branches": ["main", "develop"], "files": { "readme": true, "changelog": true, "api": false }, "commitMessage": "docs: auto-update documentation [skip ci]", "author": { "name": "CodeContext Bot", "email": "bot@codecontext.io" } } }
Platform Integrations
GitLab CI
update-docs: script: - npm install -g codecontext - codecontext update only: - main
Jenkins
stage('Update Docs') { steps { sh 'npm install -g codecontext' sh 'codecontext update' } }
CircleCI
- run: name: Update Documentation command: | npm install -g codecontext codecontext update
Bitbucket Pipelines
- step: name: Update docs script: - npm install -g codecontext - codecontext update
Smart Update Features
Intelligent Updates
- Only updates changed sections
- Preserves custom content
- Detects breaking changes
- Skips unnecessary updates
Safety Features
- Automatic rollback on errors
- Validation before committing
- Conflict resolution
- Backup creation
Auto-Update Best Practices
- Test in development first: Enable auto-updates on feature branches before main
- Use skip markers: Add
[skip ci]
to avoid loops - Configure branch protection: Require PR reviews for doc changes
- Monitor usage: Check your update limits with
codecontext status
- Set up notifications: Get alerts for failed updates
Enable Auto-Updates
Quick Setup
1
Upgrade to Pro:
codecontext upgrade
2
Enable auto-updates:
codecontext config autoUpdate.enabled true
3
Install hooks:
codecontext init --hooks