@@ -6,7 +6,6 @@ Configure cmux to use a separate Git identity for AI-generated commits, making i
66- Preventing (accidental) destructive actions
77- Enforcing review flow, e.g. preventing AI from merging into ` main ` while allowing humans
88
9-
109## Setup Overview
1110
12111 . Create a GitHub account for your agent (e.g., ` username-agent ` )
@@ -98,124 +97,3 @@ git config --global --add credential.helper '!gh auth git-credential'
9897```
9998
10099⚠️ ** Warning** : The "replace all" approach will disable platform keychain helpers and may break Git authentication for non-GitHub remotes (GitLab, Bitbucket, etc.).
101-
102- ### Authenticate with Your Token
103-
104- ``` bash
105- gh auth login --with-token <<< " your_token_here"
106- ```
107-
108- Or interactively:
109-
110- ``` bash
111- gh auth login
112- # Select: GitHub.com
113- # Select: HTTPS
114- # Select: Paste an authentication token
115- # Paste your token
116- ```
117-
118- ### Verify Configuration
119-
120- Check that authentication is working:
121-
122- ``` bash
123- # Check git config
124- git config --show-origin --get-all credential.helper
125-
126- # Check gh authentication
127- gh auth status
128-
129- # Test repository access
130- gh repo view owner/repo
131- ```
132-
133- ## Verification
134-
135- Create a test commit to verify the identity:
136-
137- ``` bash
138- echo " test" > test-identity.txt
139- git add test-identity.txt
140- git commit -m " 🤖 Test agent identity"
141- git log -1 --format=full
142- ```
143-
144- You should see your agent name and email as both author and committer:
145-
146- ```
147- commit abc123...
148- Author: Your Name (Agent) <yourname+ai@example.com>
149- Commit: Your Name (Agent) <yourname+ai@example.com>
150-
151- 🤖 Test agent identity
152- ```
153-
154- ## Troubleshooting
155-
156- ### Push Fails with "Repository not found"
157-
158- The token might not have access to the repository:
159-
160- - Verify the token has ` repo ` scope
161- - For private repos, ensure the agent account has access to the repository
162- - Try: ` gh repo view owner/repo ` to test access
163-
164- ### Push Uses Wrong Credentials
165-
166- System keychain might be overriding ` gh ` credentials:
167-
168- - Verify git credential config: ` git config --show-origin --get-all credential.helper `
169- - If you used ` gh auth setup-git ` , it should be properly scoped to GitHub
170- - If you manually configured, ensure the credential helper is either:
171- - Scoped: ` credential.https://github.com.helper `
172- - Or global with reset: empty helper ` "" ` comes before ` !gh auth git-credential `
173- - Clear keychain credentials if needed (macOS): Delete github.com entry from Keychain Access
174-
175- ### Author and Committer Differ
176-
177- Missing ` GIT_COMMITTER_* ` secrets:
178-
179- - Ensure all four secrets are set in Project Secrets: ` GIT_AUTHOR_NAME ` , ` GIT_AUTHOR_EMAIL ` , ` GIT_COMMITTER_NAME ` , ` GIT_COMMITTER_EMAIL `
180- - Click "Save" in the secrets modal
181- - Restart cmux to pick up the changes
182- - Test by running a git command via the agent and checking the commit
183-
184- ### Changes Don't Take Effect
185-
186- Secrets not being applied:
187-
188- - Verify the secrets are saved in the Project Secrets modal
189- - Restart cmux to ensure the config is reloaded
190- - Test with a simple bash command: ` echo $GIT_AUTHOR_NAME ` via the agent
191- - Ensure you're working in the correct project (secrets are project-scoped)
192-
193- ## Best Practices
194-
195- - ** Commit prefixes** : Use 🤖 emoji or ` [AI] ` prefix in commit messages
196- - ** Token security** : Never commit tokens to repositories
197- - ** Token rotation** : Rotate tokens periodically for security
198- - ** Repository access** : Only grant access to repositories the agent needs
199- - ** Documentation** : Update team docs about AI-generated commits
200-
201- ## Reverting to Personal Identity
202-
203- To switch back to your personal identity:
204-
205- ** For cmux projects:**
206-
207- 1 . Open the Project Secrets modal (🔒 icon)
208- 2 . Remove the four Git identity secrets
209- 3 . Click "Save"
210- 4 . Restart cmux
211-
212- Commits will now use your default Git identity from ` ~/.gitconfig ` .
213-
214- ** For GitHub authentication:**
215-
216- Switch to your personal GitHub account:
217-
218- ``` bash
219- # Switch to different GitHub account
220- gh auth switch
221- ```
0 commit comments