A modern macOS application for creating private mirrors of GitHub repositories.
PrivateFork/
├── PrivateFork.xcworkspace/ # Open this file in Xcode
├── PrivateFork.xcodeproj/ # Main Xcode project
├── PrivateFork/ # App target (main implementation)
│ ├── Application/ # App lifecycle and main entry
│ │ ├── PrivateForkApp.swift # SwiftUI app entry point
│ │ ├── AppLauncher.swift # App launch logic
│ │ └── main.swift # CLI mode entry point
│ ├── Controllers/ # CLI controller logic
│ ├── Models/ # Data models and types
│ ├── Services/ # Business logic services
│ ├── ViewModels/ # MVVM view models
│ ├── Views/ # SwiftUI views
│ ├── Utilities/ # Helper utilities
│ └── Assets.xcassets/ # App-level assets
├── PrivateForkTests/ # Unit and integration tests
├── PrivateForkUITests/ # UI automation tests
├── Config/ # XCConfig build settings
└── docs/ # Documentation
- GUI Mode: Full SwiftUI interface for interactive use
- CLI Mode: Command-line interface for automation and scripting
- Smart mode detection based on launch context
- Clean separation between UI and business logic
- Dependency injection for testability
- Mock services for testing
Core business logic is organized into services:
- KeychainService: Secure credential storage
- GitHubService: GitHub API integration
- GitService: Git operations and repository management
- PrivateForkOrchestrator: Coordinates the fork creation workflow
# Build the project
xcodebuild -workspace PrivateFork.xcworkspace -scheme PrivateFork build
# Run tests
xcodebuild -workspace PrivateFork.xcworkspace -scheme PrivateFork test
# Run SwiftLint
swiftlintBuild settings are managed through XCConfig files in Config/:
Config/Shared.xcconfig- Common settings (bundle ID, versions, deployment target)Config/Debug.xcconfig- Debug-specific settingsConfig/Release.xcconfig- Release-specific settingsConfig/Tests.xcconfig- Test-specific settings
The app is sandboxed by default with basic file access. Edit Config/PrivateFork.entitlements to add capabilities:
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<!-- Add other entitlements as needed -->Launch the app normally to use the graphical interface:
- Configure GitHub credentials in the app
- Enter a repository URL
- Select a local directory
- Create the private fork
Use command-line arguments for automation:
# Create a private fork via CLI
./PrivateFork create-fork \
--url "https://github.com/owner/repo" \
--path "/path/to/local/directory"The project includes comprehensive test coverage:
- Unit Tests: Service and model testing with mocks
- Integration Tests: End-to-end workflow testing
- UI Tests: Automated interface testing
Run tests using:
xcodebuild -workspace PrivateFork.xcworkspace -scheme PrivateFork testThe project uses SwiftLint for code quality enforcement. Configuration is in .swiftlint.yml.
SwiftUI-based interface with proper macOS window behavior and controls.
Secure storage of GitHub credentials using macOS Keychain Services.
Sandbox-compliant file operations with user-selected directory access.