Guides
Link Update and Validation
How to validate, fix, and update links in your installed Knowledge Base content.
Automatically validate, fix, and update links in your installed Knowledge Base content when your project structure changes or links become broken.
Quick Start
Use Cases
1. Project Structure Changes
When you move or rename directories:
2. Repository Migration
After moving your project to a different location:
3. Link Validation
Check for broken links in installed KB:
4. Path Normalization
Standardize link formats across KB:
Command Reference
Basic Syntax
Options
| Option | Description | Default |
|---|---|---|
--relative | Convert all links to relative paths | Implicit default |
--absolute | Convert all links to absolute paths | - |
--dry-run | Preview changes without modifying files | false |
--log-level <level> | Set logging level (trace, debug, info, warn, error). Use --log-level debug for detailed logs | info |
Examples
Default behavior (relative paths):
Explicit relative conversion:
Convert to absolute paths:
Preview without changes:
Detailed logging:
How It Works
Processing Workflow
- Detection: Locates installed KB content in
.pair/directory - Validation: Checks all markdown links against current file system
- Fixing: Repairs broken links where possible
- Adjustment: Updates paths for moved projects
- Conversion: Applies relative/absolute path transformation
- Summary: Reports all changes and remaining issues
Link Types Supported
- Relative paths:
./docs/file.md,../guide.md - Absolute paths:
/absolute/path/to/file.md - External URLs:
https://example.com(skipped) - Mailto links:
mailto:email@example.com(skipped) - Anchors:
#section-title(preserved)
File Safety
- Backup: Automatic backup before modifications (
.pair/backups/) - Atomic writes: Prevents partial updates
- Rollback: Automatic restore on critical errors
- Dry-run: Preview changes safely
Output Format
Summary Report
Dry-Run Output
Common Scenarios
After Installing KB Content
Moving Project Directory
Checking Link Health
Standardizing Link Format
Troubleshooting
"No KB installed" Error
Problem: Command reports no Knowledge Base found.
Solution:
Permission Errors
Problem: Cannot write to files.
Solution:
Broken Links Remain
Problem: Some links still broken after update.
Solution:
Root Detection Fails
Problem: Cannot determine project root.
Solution:
Integration with Other Commands
Complete Workflow
CI/CD Integration
Best Practices
- Use dry-run first: Always preview changes with
--dry-run - Commit before updating: Create a checkpoint before running
- Choose consistent format: Stick to relative or absolute across project
- Run after structural changes: Update links when moving files/folders
- Check verbose output: Use
--verboseto understand changes - Validate in CI: Add link validation to your CI pipeline