--log --log-failed
```
--
**This session's workflow was 90% AI-driven** using these exact commands ๐
--
**`gh` is the API bridge** between AI agents and GitHub โ no browser, no GUI, no CAPTCHA ๐ฏ
---
### ๐ The Productivity Multiplier
$$ \text{Output} = \text{AI Speed} \times \text{CI Safety} \times \text{Git Control} $$
.mermaid[
graph TB
subgraph "Without Git + CI + gh"
A1["๐ค AI writes code"]
A2["๐ฑ Manual review"]
A3["๐ Bugs reach users"]
A4["โฑ๏ธ Hours to fix"]
A1 --> A2 --> A3 --> A4
end
style A2 fill:#fadbd8
style A3 fill:#e74c3c
]
.mermaid[
graph TB
subgraph "With Git + CI + gh"
B1["๐ค AI writes code"]
B2["โ๏ธ CI tests instantly"]
B3["๐ gh alerts on failure"]
B4["๐ git revert + fix"]
B5["โ
Ship with confidence"]
B1 --> B2 --> B3 --> B4 --> B5
end
style B2 fill:#d5f5e3
style B3 fill:#f9e79f
style B5 fill:#d5f5e3
]
---
### ๐งญ The Triangle: Human ยท AI ยท Tooling
.mermaid[
graph LR
H["๐จโ๐ป Human\n(Review, approve, direct)"] --> T
A["๐ค AI Agent\n(Write, commit, PR)"] --> T
T["๐ ๏ธ Git + gh + CI\n(Track, test, deploy)"] --> H
T --> A
style H fill:#a9cce3
style A fill:#d4e6f1
style T fill:#7fb3d8
]
--
**Git** is the ledger ๐ โ every AI action is recorded, reversible, auditable
**CI** is the gatekeeper ๐ง โ AI output must pass tests before shipping
**`gh`** is the remote control ๐ก โ AI agents operate GitHub programmatically
--
> **"AI doesn't replace version control. It makes version control more important."**
---
### ๐ AI-Era Truths
.font-sm.mb-xs[
| AI Capability | What It Needs From You | Tool |
|---------------|----------------------|------|
| ๐ง Generate code | ๐งช Verify it compiles | CI build |
| ๐ Hallucinate APIs | ๐ Catch undefined symbols | CI lint + test |
| ๐ Scale to 21 repos | ๐ค Automate every step | git + gh scripting |
| ๐ Cross-platform blind | โ
Test everywhere | Matrix CI |
| โฉ Fast iteration | ๐ Audit trail | git log + blame |
| ๐ค Agent autonomy | ๐ก Remote control API | gh CLI |
]
**The more AI you use, the more you need these tools.** Not less. ๐
---
class: nord-light, middle, center
## ๐ The Dev Loop
---
### ๐ฌ Real Example: CI Catches a Bug
**Step 1:** Push changes to CI config + source docs ๐
```bash
git add include/ && git commit -m "docs: add equations"
git add .github/ && git commit -m "ci: enable graphviz"
git push
```
**Step 2:** Check CI status with `gh` ๐
```bash
gh run list --repo luk036/digraphx-cpp --limit 5
```
```text
COMPLETED failure push dev docs: enable graphviz Ubuntu โ
COMPLETED failure push dev docs: enable graphviz Windows โ
COMPLETED failure push dev docs: enable graphviz MacOS โ
```
**All 4 runners failed** โ ๐จ something is wrong!
---
### ๐ต๏ธ Step 3: Investigate with `gh run view`
```bash
gh run view --repo luk036/digraphx-cpp --log | tail -30
```
```text
/home/runner/.../neg_cycle.hpp:38:4:
error: stray '@' in program
38 | * @verbatim
| ^
```
**Root cause:** A Doxygen `@verbatim` tag ended up **outside** `/** */` comment block.
The compiler sees `@` as a stray character in C++ code ๐ฅ
```cpp
/**
* @dot ... @enddot
*/
* โ ๐ฉ not in comment!
* @verbatim โ "stray '@'"
*/
```
---
### ๐ ๏ธ Step 4: Fix & Recommit
**One-line fix:** remove the orphaned lines ๐
```bash
# Edit the file โ delete 22 orphaned lines
git add include/digraphx/neg_cycle.hpp
git commit -m "fix: close orphaned Doxygen comment block"
git push
```
--
**Step 5:** Verify fix with `gh` ๐
```bash
gh run list --repo luk036/digraphx-cpp --limit 3
```
```text
IN_PROGRESS push dev fix: orphaned Doxygen comment Ubuntu
QUEUED push dev fix: orphaned Doxygen comment Windows
QUEUED push dev fix: orphaned Doxygen comment MacOS
```
**New CI runs triggered automatically** โ no manual retry needed โ
---
### โฑ๏ธ The Full Cycle: 5 Minutes
.mermaid[
graph LR
A["๐ git push"] --> B["โณ CI runs (2 min)"]
B --> C["๐ gh run list"]
C --> D{"โ All failed?"}
D -->|"Yes"| E["๐ gh run view --log"]
E --> F["๐ Identify bug"]
F --> G["โ๏ธ Fix (1 edit)"]
G --> H["๐ git commit"]
H --> I["๐ git push"]
I --> J["โ
New CI triggers"]
J --> B
D -->|"No / Partial"| K["๐ Merge & deploy"]
style A fill:#d4e6f1
style C fill:#f9e79f
style E fill:#fadbd8
style G fill:#d5f5e3
style K fill:#d5f5e3
]
**From `git push` to fix deployed:** under 5 minutes โก
**Key enablers:** `gh run list` + `gh run view` = debug without browser ๐ฏ
---
### ๐ค Automation Patterns
Patterns for managing **multiple open-source repos**:
```powershell
# Pattern 1: Batch status check
foreach ($repo in $repos) {
Push-Location $repo
git status --porcelain
Pop-Location
}
# Pattern 2: Batch commit + push
foreach ($repo in $repos) {
Push-Location $repo
git add -A && git commit -m "$msg" && git push
Pop-Location
}
# Pattern 3: Batch CI check
foreach ($repo in $repos) {
gh run list --repo "org/$repo" --limit 2
}
```
**Parallel execution** (3 batches ร 7 repos) = 3ร faster than sequential ๐
---
### ๐ง Best Practices Summary
.font-sm.mb-xs[
| Practice | Why |
|----------|-----|
| **Atomic commits** | Revert, cherry-pick, bisect all work |
| **Split config vs code** | Different revert cadence |
| **Always check CI** | `gh run list` before merging |
| **Fix CI first** | Red builds = broken contract |
| **Batch when >1 repo** | Script it, parallelize it |
| **Use `gh` not browser** | Stay in terminal, stay in flow |
| **Fast-forward merge** | Clean linear history |
| **Descriptive commit msgs** | `git log` tells the story |
]
---
count: false
class: nord-dark, middle, center
### ๐ Key Takeaways
**1๏ธโฃ Git** โ atomic commits, branch strategy, clean merges ๐ฒ
**2๏ธโฃ gh CLI** โ `gh run list` + `gh run view` + `gh pr` = browser-free dev flow ๐ป
**3๏ธโฃ CI** โ safety net that catches bugs before users see them โ๏ธ
**4๏ธโฃ The Loop** โ Code โ Commit โ Push โ CI โ Fix โ Merge โ **Ship** ๐
**5๏ธโฃ Automate** โ batch scripts + parallel execution for multi-repo workflows ๐ค
---
count: false
class: nord-dark, middle, center
# ๐ Thank You! ๐
### Open-source Dev Flow: Git + gh + CI
**Slides**: `luk036.github.io/idea/git-gh-ci-remark.html`
**Tools**: `git` ยท `gh` ยท GitHub Actions
**Q&A** ๐ค