IWE Rename
Rename a document and update all references to it across the knowledge base.
Usage
iwe rename <OLD_KEY> <NEW_KEY> [OPTIONS]Arguments
| Argument | Description |
|---|---|
<OLD_KEY> | Current document key |
<NEW_KEY> | New document key |
Options
| Flag | Description |
|---|---|
--dry-run | Preview changes without writing to disk |
--quiet | Suppress progress output |
--keys | Print affected document keys (one per line) |
How It Works
The rename command performs a safe document rename with full reference tracking:
- Renames the document file - Moves the document from old key to new key
- Updates inclusion links - All inclusion links pointing to the old key are updated
- Updates inline links - All inline references to the old key are updated
- Maintains integrity - Ensures no broken references after renaming
Output Modes
Default Output
Shows progress and summary:
$ iwe rename old-document new-document
Renaming 'old-document' to 'new-document'
Updated 3 document(s)Dry Run (--dry-run)
Preview what would happen without making changes:
$ iwe rename old-document new-document --dry-run
Would rename 'old-document' to 'new-document'
Would update 3 document(s)
index
overview
related-topicKeys Output (--keys)
Print affected document keys for scripting:
$ iwe rename old-document new-document --keys
old-document
new-document
index
overview
related-topicQuiet Mode (--quiet)
Suppress all output except errors:
$ iwe rename old-document new-document --quietExamples
# Basic rename
iwe rename my-note renamed-note
# Preview changes first
iwe rename old-key new-key --dry-run
# Get affected keys for processing
iwe rename document new-document --keys
# Silent rename (for scripts)
iwe rename doc new-doc --quietUse Cases
Reorganizing Knowledge Base
Rename documents to follow a new naming convention:
# Check what would be affected
iwe rename user-auth authentication --dry-run
# Perform the rename
iwe rename user-auth authenticationMoving to Subdirectories
Move a document into a subdirectory:
# Move from root to subdirectory
iwe rename config settings/configScripting
Use with other commands for batch operations:
# Get list of affected documents for further processing
iwe rename old-api api-v2 --keys | while read key; do
echo "Affected: $key"
doneError Handling
The command fails with an error if:
- The source document does not exist
- The target key already exists
- There are filesystem permission issues
Technical Notes
- References include both inclusion links and inline links
- The operation is atomic - either all changes succeed or none are applied
- Directory structure is preserved when renaming with path components