@@ -635,39 +635,39 @@ def _load_alias_file(file_path: str) -> list[dict]:
635635 "-c" ,
636636 required = True ,
637637 type = click .Path (exists = True ),
638- help = "Config YAML path " ,
638+ help = "Path to YAML configuration file " ,
639639)
640640@click .option (
641641 "--canonical" ,
642642 required = False ,
643643 default = None ,
644- help = "Canonical email address " ,
644+ help = "Primary/canonical email for this developer identity " ,
645645)
646646@click .option (
647647 "--alias" ,
648648 "aliases" ,
649649 multiple = True ,
650- help = "Alias email or name (repeatable)" ,
650+ help = "Email or name to map to canonical (repeatable, e.g. --alias [email protected] --alias 'Jane Smith' )" , 651651)
652652@click .option (
653653 "--from-file" ,
654654 "from_file" ,
655655 required = False ,
656656 default = None ,
657657 type = click .Path (exists = True ),
658- help = "YAML/ JSON file with batch alias mappings" ,
658+ help = "YAML or JSON file with batch alias mappings (see format below) " ,
659659)
660660@click .option (
661661 "--apply" ,
662662 is_flag = True ,
663663 default = False ,
664- help = "After writing config, rerun identity resolution to propagate to historical commits " ,
664+ help = "Trigger identity re- resolution after updating config (propagates to cached data) " ,
665665)
666666@click .option (
667667 "--dry-run" ,
668668 is_flag = True ,
669669 default = False ,
670- help = "Print what would be done without making changes " ,
670+ help = "Show what would be changed without writing to config " ,
671671)
672672def add_alias_command (
673673 config : str ,
@@ -677,18 +677,66 @@ def add_alias_command(
677677 apply : bool ,
678678 dry_run : bool ,
679679) -> None :
680- """Add known alias mappings to config non-interactively.
680+ """Add alias mappings to config non-interactively.
681+
682+ Maps one or more alias emails/names to a canonical developer identity
683+ in analysis.identity.manual_mappings. Supports single mappings via
684+ --canonical/--alias flags, or bulk import via --from-file.
685+
686+ \b
687+ USAGE MODES:
681688
682- Use --canonical + --alias for a single mapping, or --from-file for batch.
689+ Single mapping (--canonical + --alias):
690+ Adds or updates one developer's alias list. Multiple --alias
691+ flags may be provided to add several aliases at once.
692+
693+ Batch import (--from-file):
694+ Reads a YAML or JSON file containing multiple mappings.
695+ Mutually exclusive with --canonical.
683696
684697 \b
685- Examples:
698+ FILE FORMATS (--from-file):
699+
700+ GFA native YAML (developer_aliases list):
701+ developer_aliases:
702+ 703+ aliases:
704+ 705+ - "John Doe"
706+ 707+ aliases:
708+ 709+
710+ Flat YAML list:
711+ 712+ 686713
687- # Single alias
688- gfa add-alias -c config.yaml -- canonical [email protected] --alias [email protected] --alias "John Doe" 714+ JSON array:
715+ [{" canonical": " [email protected] ", "aliases": [" [email protected] "]}] 689716
690- # Batch from YAML file
717+ \b
718+ EXAMPLES:
719+
720+ # Add single alias
721+ gfa add-alias -c config.yaml --canonical [email protected] --alias [email protected] 722+
723+ # Add multiple aliases at once
724+ gfa add-alias -c config.yaml --canonical [email protected] \\ 725+ --alias [email protected] --alias "John Doe" 726+
727+ # Preview without writing
728+ gfa add-alias -c config.yaml --canonical [email protected] \\ 729+ --alias [email protected] --dry-run 730+
731+ # Batch import from file
691732 gfa add-alias -c config.yaml --from-file aliases.yaml
733+
734+ \b
735+ NOTE:
736+ Existing canonical entries are merged (not replaced). Duplicate
737+ aliases are silently skipped. Use --dry-run to preview changes.
738+ After updating config, run 'gfa identities --apply' to propagate
739+ changes to cached data (or use --apply when that flag is wired).
692740 """
693741 # Validate args
694742 if not from_file and not canonical :
0 commit comments