A simple CLI tool to quickly create and initialize GitHub repositories.
- 🚀 Create private GitHub repositories with a single command
- 🔑 Secure PAT storage using machine-specific encryption
- 📝 Automatic README initialization
- 🔄 Git setup and initial commit
- 🔒 Uses GitHub CLI under the hood for secure authentication
- First, ensure you have the GitHub CLI installed through Homebrew
- Clone this repository to your local machine
- Build the project using Swift
- Copy the built binary to your local bin directory
Simply run mr
followed by your desired repository name:
mr <repository-name>
On first run, you'll be prompted to enter a GitHub Personal Access Token (PAT). The token will be securely stored for future use.
- Visit: https://github.com/settings/tokens
- Click "Generate new token" (classic)
- Give it a name (e.g., "mr-tool")
- Select scopes: 'repo' and 'workflow'
- Click "Generate token"
- Copy the generated token when prompted by mr
The token should start with ghp_
and contain only letters and numbers.
When creating a new repository, you'll see:
🔑 Setting up authentication...
📦 Creating repository 'my-new-project' on GitHub...
📝 Creating initial commit...
🚀 Pushing to GitHub...
✅ Successfully created repository 'my-new-project'!
Local path: /Users/you/my-new-project
GitHub URL: https://github.com/yourusername/my-new-project
- PATs are encrypted using AES-GCM with a machine-specific key
- Machine-specific key is derived from:
- Linux:
/etc/machine-id
- macOS: IOPlatformUUID
- Linux:
- Encrypted tokens are stored in
~/.mr_token
- File permissions are set to 600 (user read/write only)
- Token can only be decrypted on the same machine it was encrypted on
- macOS or Linux
- GitHub CLI
- Swift 5.5 or later
- Xcode Command Line Tools
- Invalid token format: Will prompt for correct format
- Authentication failure: Removes stored token and requests new one
- Maximum retry attempts: 3 tries before failing
- Network issues: Displays detailed error messages
- Permission issues: Ensures correct file permissions
Built with:
- Swift
- CryptoKit for encryption
- GitHub CLI for repository operations
- Foundation for file operations
- All repositories are created as private by default
- Initial commit includes a basic README.md
- Uses environment variables for GitHub CLI authentication
- Automatically sets up git remote and pushes initial commit