A Python-based CLI tool that automates the setup of development environments across multiple version control systems.
- Creates standardized directory structures for different VCS providers
- Configures SSH keys and config files
- Sets up Git configurations at both global and repository levels
- Supports multiple accounts and organizations
- Works across different operating systems (Windows, macOS, Linux)
- GitHub
- Azure DevOps
- Bitbucket
- GitLab
- SourceForge
profile_setup.py
- Update
create_ssh_config_fileto check for a default entry at the top, example of a valid default is:
Host *
IdentitiesOnly yes
IgnoreUnknown UseKeychainFurther reading here.
- Update functions that generate/update
.gitconfigentries to have specific handling fordev.azure.com:
BEFORE
- [email protected]:contoso/
AFTER
- [email protected]:v3/contoso/.ssh/config
- Fix
Hostkey being generated incorrectly, it needs to include the {Organisation} if applicable -
BEFORE
- john-doe.dev.azure.com
AFTER
- contoso.john-doe.dev.azure.com- Fix
dev.azure.comomittingssh.from theHostNamekey - e.g:
BEFORE
- Hostname dev.azure.com
AFTER
- Hostname ssh.dev.azure.com~/.gitconfig
- Update template so that azure entries get the
:v3appended to their URL- This applies to both
url(:v3) ANDinsteadOfkeys
- This applies to both
urlshould ensure it is generated like {org}.{account}.{vcs}- Write tests for
configentries - e.g duplicate handling
The tool creates the following directory structure:
~/
├── src/
│ ├── github.com/
│ │ ├── personal-account/
│ │ └── organization-name/
│ │ └── org-account/
│ └── dev.azure.com/
│ └── organization-name/
│ └── org-account/
└── .ssh/
├── config
└── github.com/
└── account-name/
├── account-name_rsa
└── account-name_rsa.pub
- Python 3.9+
- SSH client (
ssh-keygencommand available) - Git
- Clone the repository:
git clone https://github.com/yourusername/dev-environment-builder.git
cd dev-environment-builder- (Optional) Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # Unix
venv\Scripts\activate # Windows- Run the script:
python profile_setup.py- Follow the interactive prompts to:
- Configure VCS providers
- Add organizations
- Add accounts
- Generate SSH keys
- Set up Git configurations
Located at templates/ssh/config
- Configures SSH settings for each VCS/account combination
Located in templates/gitconfig/
top/- Global Git configurationsaccount/- Repository-level Git configurations
The tool automatically sets appropriate permissions:
- SSH private keys:
600(owner read/write only) - SSH public keys:
644(owner read/write, others read) - SSH config:
600 - Git config:
644
dev-environment-builder/
├── profile_setup.py
├── templates/
│ ├── gitconfig/
│ │ ├── account/
│ │ └── top/
│ └── ssh/
└── README.md
- Add the VCS name to
VERSION_CONTROL_SYSTEMS - Create appropriate templates in:
templates/gitconfig/account/{vcs}/usertemplates/gitconfig/top/{vcs}/standardtemplates/gitconfig/top/{vcs}/organisation
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request