2025-10-21 Tue
- Experimenting with DevContainers and GitHub/Codespace
- learned that I can run GitHub/CLI/gh/auth/login inside a devcontainer and it will run me through the process of creating an ssh key inside the container and adding it to my github account. That's interesting for users that don't have git on their hose machine; they could conceivably just use git in the devcontainer, and as long as they had a github account and could go through the web flow, the auth would "just flow" for the devcontainer.
- #Example
node /workspace main v3.10.0 ? gh auth login ? What account do you want to log into? GitHub.com ? What is your preferred protocol for Git operations? SSH ? Generate a new SSH key to add to your GitHub account? Yes ? Enter a passphrase for your new SSH key (Optional) ? Title for your SSH key: GitHub CLI ? How would you like to authenticate GitHub CLI? Login with a web browser ! First copy your one-time code: XXXX-XXXX Press Enter to open github.com in your browser... ✓ Authentication complete. - gh config set -h github.com git_protocol ssh ✓ Configured git protocol ✓ Uploaded the SSH key to your GitHub account: /home/<user>/.ssh/id_ed12345
- #Example
- https://github.com/codespaces shows active codespaces
- learned that I can run GitHub/CLI/gh/auth/login inside a devcontainer and it will run me through the process of creating an ssh key inside the container and adding it to my github account. That's interesting for users that don't have git on their hose machine; they could conceivably just use git in the devcontainer, and as long as they had a github account and could go through the web flow, the auth would "just flow" for the devcontainer.