How turtlethom/fcd works
fcd is a CLI for saving directory shortcuts and selecting them to obtain a path for navigation. Its main workflow loads user configuration, presents saved shortcuts in an interactive menu, and prints the selected path; separate commands manage shortcuts and themes. The graph also captures path validation and menu rendering. Command files for branch, print, colors list, and completion are present and documented, but their implementations were not sampled, so their internal behavior is not inferred.
Main entry points: root.go Command router · config.go Config lifecycle · main.go Program entry · colors.go Theme commands
Components 19
CLI entry
- Program entry
main.go - Command router
cmd/root.go - Shell completion
cmd/completion.go
Shortcut management
- Config lifecycle
internal/config.go - User config
- Home path check
internal/utils.go - Add shortcut
cmd/add.go - Remove shortcut
cmd/remove.go - Clear shortcuts
cmd/clear.go - Branch navigation
cmd/branch.go - Print shortcuts
cmd/print.go
Interactive navigation
- Menu setup
cmd/root.go - Menu interaction
internal/model.go - Menu rendering
internal/styles.go
Theme settings
- Theme commands
cmd/colors.go - Set theme
cmd/colors_set.go - List colors
cmd/colors_list.go
Other components
- Shell user
- Terminal
Connections 31
- Shell user → Program entry: invokes
- Program entry → Config lifecycle: loads config
- Program entry → Command router: sets config
- Command router → Config lifecycle: uses config
- Config lifecycle → User config: reads / writes
- Add shortcut → Config lifecycle: adds shortcut
- Config lifecycle → Home path check: validates path
- Add shortcut → User config: saves config
- Remove shortcut → Config lifecycle: updates shortcuts
- Remove shortcut → User config: saves config
- Clear shortcuts → Config lifecycle: clears shortcuts
- Clear shortcuts → User config: saves config
- Command router → Add shortcut: dispatches
- Command router → Remove shortcut: dispatches
- Command router → Clear shortcuts: dispatches
- Command router → Branch navigation: dispatches
- Command router → Print shortcuts: dispatches
- Command router → Shell completion: dispatches
- Command router → Theme commands: dispatches
- Theme commands → Set theme: dispatches
- Theme commands → List colors: dispatches
- Set theme → Config lifecycle: updates colors
- Set theme → User config: saves config
- Command router → Menu setup: starts menu
- Menu setup → Config lifecycle: reads shortcuts
- Menu setup → Menu rendering: creates styles
- Menu setup → Menu interaction: runs model
- Menu setup → Terminal: runs UI
- Menu interaction → Terminal: renders menu
- Menu setup → Terminal: prints selection
- Shell user → Terminal: chooses shortcut