Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

perf(hub): stop iPhone scroll crashes — GIFs to H.264 video, render-skip offscreen sections

yuhao949bab560107
diff --git a/docs/hub/assets/demos/arcgis-pro-live-bridge-demo-poster.jpg b/docs/hub/assets/demos/arcgis-pro-live-bridge-demo-poster.jpg
new file mode 100644
index 000000000..630096d19
Binary files /dev/null and b/docs/hub/assets/demos/arcgis-pro-live-bridge-demo-poster.jpg differ
diff --git a/docs/hub/assets/demos/arcgis-pro-live-bridge-demo.mp4 b/docs/hub/assets/demos/arcgis-pro-live-bridge-demo.mp4
new file mode 100644
index 000000000..8cb6454dd
Binary files /dev/null and b/docs/hub/assets/demos/arcgis-pro-live-bridge-demo.mp4 differ
diff --git a/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory-poster.jpg b/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory-poster.jpg
new file mode 100644
index 000000000..eb913258c
Binary files /dev/null and b/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory-poster.jpg differ
diff --git a/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory.mp4 b/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory.mp4
new file mode 100644
index 000000000..77a36d0d2
Binary files /dev/null and b/docs/hub/assets/demos/blender-orbital-relay-drone-preview-trajectory.mp4 differ
diff --git a/docs/hub/assets/demos/drawio-demo-poster.jpg b/docs/hub/assets/demos/drawio-demo-poster.jpg
new file mode 100644
index 000000000..0daa436dd
Binary files /dev/null and b/docs/hub/assets/demos/drawio-demo-poster.jpg differ
diff --git a/docs/hub/assets/demos/drawio-demo.mp4 b/docs/hub/assets/demos/drawio-demo.mp4
new file mode 100644
index 000000000..fd0025086
Binary files /dev/null and b/docs/hub/assets/demos/drawio-demo.mp4 differ
diff --git a/docs/hub/assets/demos/freecad-curiosity-preview-trajectory-poster.jpg b/docs/hub/assets/demos/freecad-curiosity-preview-trajectory-poster.jpg
new file mode 100644
index 000000000..4014f981f
Binary files /dev/null and b/docs/hub/assets/demos/freecad-curiosity-preview-trajectory-poster.jpg differ
diff --git a/docs/hub/assets/demos/freecad-curiosity-preview-trajectory.mp4 b/docs/hub/assets/demos/freecad-curiosity-preview-trajectory.mp4
new file mode 100644
index 000000000..40b1b1e45
Binary files /dev/null and b/docs/hub/assets/demos/freecad-curiosity-preview-trajectory.mp4 differ
diff --git a/docs/hub/assets/demos/slay-the-spire-ii-gameplay-poster.jpg b/docs/hub/assets/demos/slay-the-spire-ii-gameplay-poster.jpg
new file mode 100644
index 000000000..656083713
Binary files /dev/null and b/docs/hub/assets/demos/slay-the-spire-ii-gameplay-poster.jpg differ
diff --git a/docs/hub/assets/demos/slay-the-spire-ii-gameplay.mp4 b/docs/hub/assets/demos/slay-the-spire-ii-gameplay.mp4
new file mode 100644
index 000000000..8a0d50f82
Binary files /dev/null and b/docs/hub/assets/demos/slay-the-spire-ii-gameplay.mp4 differ
diff --git a/docs/hub/demos.html b/docs/hub/demos.html
index 63df160e7..5da779f94 100644
--- a/docs/hub/demos.html
+++ b/docs/hub/demos.html
@@ -171,7 +171,11 @@
/* ===================== Editorial gallery ===================== */
.editorial { max-width: 1100px; margin: 56px auto 0; padding: 0 22px; display: flex; flex-direction: column; gap: 64px; }
- .ed-row { display: grid; grid-template-columns: 1.22fr 1fr; gap: 40px; align-items: center; }
+ .ed-row { display: grid; grid-template-columns: 1.22fr 1fr; gap: 40px; align-items: center;
+ /* Skip layout+paint while far offscreen — a fast fling must not rasterize
+ every demo row at once (iOS Safari memory kill). Plain-length fallback
+ first: Safari 15.4–16 lacks the `auto` keyword. */
+ content-visibility: auto; contain-intrinsic-size: 900px; contain-intrinsic-size: auto 900px; }
/* grid items default to min-width:auto — media was pushing the page wider than phones */
.ed-row > * { min-width: 0; }
.ed-row:nth-child(even) .ed-media { order: 2; }
@@ -223,7 +227,8 @@
.media-chrome .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.media-stage { position: relative; cursor: zoom-in; display: block; }
- .media-stage img { display: block; width: 100%; height: auto; }
+ .media-stage:not([data-full]) { cursor: default; }
+ .media-stage img, .media-stage video { display: block; width: 100%; height: auto; }
.media-zoom { position: absolute; bottom: 10px; right: 10px; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
background: rgba(0,0,0,0.5); color: #fff; opacity: 0; transition: opacity .2s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.media-stage:hover .media-zoom { opacity: 1; }
@@ -479,26 +484,26 @@
title:'Curiosity Rover via Preview, Live Preview, and Trajectory',
blurb:'An agent incrementally assembles a Curiosity-inspired rover while publishing real FreeCAD preview bundles, refreshing a live preview session, and recording command-to-preview history for later replay.',
meta:[['Harness','cli-anything-freecad','code'],['Preview Stack','preview · live · trajectory'],['Artifact','Curiosity-style rover']],
- media:{type:'gif', src:'freecad-curiosity-preview-trajectory.gif', url:'cli-anything-freecad · preview live', live:true},
+ media:{type:'video', src:'freecad-curiosity-preview-trajectory.mp4', url:'cli-anything-freecad · preview live', live:true},
contrib:{name:'Core team', sub:'CLI-Anything'} },
{ id:'blender', app:'Blender', cat:'3D · Hard-surface', hue:28, glyph:'cube',
title:'Orbital Relay Drone via Preview, Live Preview, and Trajectory',
blurb:'An agent grows a hard-surface orbital relay drone under a real preview loop: each stage pushes new render-backed bundles, the live session tracks the current head, and the trajectory ties every command to its visual state.',
meta:[['Harness','cli-anything-blender','code'],['Preview Stack','preview · live · trajectory'],['Artifact','Orbital relay drone']],
- media:{type:'gif', src:'blender-orbital-relay-drone-preview-trajectory.gif', url:'cli-anything-blender · preview live', live:true},
+ media:{type:'video', src:'blender-orbital-relay-drone-preview-trajectory.mp4', url:'cli-anything-blender · preview live', live:true},
contrib:{name:'Core team', sub:'CLI-Anything'} },
{ id:'drawio', app:'Draw.io', cat:'Diagramming', hue:250, glyph:'diagram',
title:'HTTPS Handshake Diagram',
blurb:'An agent creates a full HTTPS connection lifecycle diagram from scratch — TCP three-way handshake, TLS negotiation, encrypted data exchange, and TCP four-way termination — entirely through CLI commands.',
meta:[['Harness','cli-anything-drawio','code'],['Time','~4 min'],['Artifact','.drawio + .png']],
- media:{type:'gif', src:'drawio-demo.gif', url:'cli-anything-drawio · build', live:true},
+ media:{type:'video', src:'drawio-demo.mp4', url:'cli-anything-drawio · build', live:true},
artifact:{label:'Final artifact', src:'drawio-https-handshake.png', alt:'HTTPS handshake sequence diagram'},
contrib:{name:'@zhangxilong-43', url:'https://github.com/zhangxilong-43'} },
{ id:'sts2', app:'Slay the Spire II', cat:'Games', hue:350, glyph:'game',
title:'Game Automation',
blurb:'An agent plays through a Slay the Spire II run using the CLI harness — reading game state, selecting cards, choosing paths, and making strategic decisions in real-time.',
meta:[['Harness','cli-anything-slay-the-spire-ii','code'],['Artifact','Automated gameplay session']],
- media:{type:'gif', src:'slay-the-spire-ii-gameplay.gif', url:'cli-anything-slay-the-spire-ii', live:true},
+ media:{type:'video', src:'slay-the-spire-ii-gameplay.mp4', url:'cli-anything-slay-the-spire-ii', live:true},
contrib:{name:'@TianyuFan0504', url:'https://github.com/TianyuFan0504'} },
{ id:'videocaptioner', app:'VideoCaptioner', cat:'Video', hue:280, glyph:'video',
title:'Auto-Generated Subtitles',
@@ -510,7 +515,7 @@
title:'Live Agent Cartography via the MCP Bridge',
blurb:'An agent drives a live, open ArcGIS Pro session through an MCP bridge — reading the project, zooming to feature layers, running geoprocessing, and exporting layouts — each step executing inside Pro as you watch.',
meta:[['Harness','arcgis-pro','code'],['Mode','live-Pro MCP bridge'],['Artifact','Agent-driven map navigation']],
- media:{type:'gif', src:'arcgis-pro-live-bridge-demo.gif', url:'arcgis-pro · MCP bridge', live:true},
+ media:{type:'video', src:'arcgis-pro-live-bridge-demo.mp4', url:'arcgis-pro · MCP bridge', live:true},
contrib:{name:'@Jasper0122', url:'https://github.com/Jasper0122'} },
];
// Install command per demo (CLI-Hub registry names) — parallel info on each card.
@@ -551,6 +556,12 @@
<div class="media-stage" data-full="${A+m.a.src}"><span class="ba-label">${m.a.label}</span><img loading="lazy" src="${A+m.a.src}" alt="${id} before"><span class="media-zoom">${ZOOM}</span></div>
<div class="media-stage" data-full="${A+m.b.src}"><span class="ba-label">${m.b.label}</span><img loading="lazy" src="${A+m.b.src}" alt="${id} after"><span class="media-zoom">${ZOOM}</span></div></div></div>`;
}
+ if (m.type === 'video') {
+ // H.264 video instead of animated GIF: hardware-decoded, no frame cache —
+ // multi-hundred-MB GIF decodes were killing the page on iPhones.
+ const poster = A + m.src.replace(/\.mp4$/, '-poster.jpg');
+ return `<div class="media">${chrome}<div class="media-stage"><video class="lazy-vid" muted loop playsinline preload="none" poster="${poster}" src="${A+m.src}" aria-label="${id} demo"></video></div></div>`;
+ }
return `<div class="media">${chrome}<div class="media-stage" data-full="${A+m.src}"><img loading="lazy" src="${A+m.src}" alt="${id} demo"><span class="media-zoom">${ZOOM}</span></div></div>`;
}
function artifact(d) {
@@ -584,6 +595,35 @@
document.querySelectorAll('.reveal').forEach(el => io.observe(el));
})();
+ // Demo videos: play near the viewport; pause offscreen; beyond 1200px drop the
+ // src entirely so the media pipeline is fully released (poster stays visible).
+ (function () {
+ const vids = document.querySelectorAll('video.lazy-vid');
+ if (!vids.length) return;
+ const start = (v) => {
+ if (!v.getAttribute('src') && v.dataset.src) { v.setAttribute('src', v.dataset.src); v.load(); }
+ v.muted = true; const p = v.play(); if (p) p.catch(() => {});
+ };
+ if (!('IntersectionObserver' in window)) { vids.forEach(start); return; }
+ const near = new IntersectionObserver((entries) => {
+ entries.forEach((en) => {
+ if (en.isIntersecting) start(en.target);
+ else if (!en.target.paused) en.target.pause();
+ });
+ }, { rootMargin: '200px 0px' });
+ const far = new IntersectionObserver((entries) => {
+ entries.forEach((en) => {
+ const v = en.target;
+ if (!en.isIntersecting && v.getAttribute('src')) {
+ v.dataset.src = v.getAttribute('src');
+ if (!v.paused) v.pause();
+ v.removeAttribute('src'); v.load();
+ }
+ });
+ }, { rootMargin: '1200px 0px' });
+ vids.forEach(v => { near.observe(v); far.observe(v); });
+ })();
+
// lightbox
const lb = document.getElementById('lightbox'), lbImg = document.getElementById('lb-img');
document.addEventListener('click', (e) => {
diff --git a/docs/hub/index.html b/docs/hub/index.html
index 127f869d5..01420f640 100644
--- a/docs/hub/index.html
+++ b/docs/hub/index.html
@@ -424,6 +424,25 @@
@media (max-width: 560px) { .deck-arrow-btn { display: none; } .deck-separator { display: none; } }
/* ===================== Deck stage ===================== */
+ /* ── Render-skip for offscreen page regions ──
+ content-visibility:auto lets the engine skip layout+paint for sections far
+ from the viewport, so a fast fling doesn't rasterize ~30k px of cards at
+ once (the iOS Safari tab-kill scenario). JS measurement inside a skipped
+ subtree (masonry offsetHeight) still works: layout APIs force layout, only
+ paint stays skipped. contain-intrinsic-size uses the `auto` keyword so the
+ placeholder snaps to the real size after first render; the px values are
+ only the pre-render estimate. Engines without support just ignore this. */
+ /* Each rule sets a plain-length fallback first: Safari 15.4–16 supports
+ content-visibility but not the `auto` keyword here, and would otherwise
+ drop the whole declaration and give skipped sections no height. */
+ .demos-teaser, .marketplace-prelude, .matrices, .deck-stage, .footer { content-visibility: auto; }
+ .demos-teaser { contain-intrinsic-size: 1000px; contain-intrinsic-size: auto 1000px; }
+ .marketplace-prelude { contain-intrinsic-size: 220px; contain-intrinsic-size: auto 220px; }
+ .matrices { contain-intrinsic-size: 900px; contain-intrinsic-size: auto 900px; }
+ .deck-stage { contain-intrinsic-size: 9500px; contain-intrinsic-size: auto 9500px; }
+ @media (max-width: 640px) { .deck-stage { contain-intrinsic-size: 28000px; contain-intrinsic-size: auto 28000px; } }
+ .footer { contain-intrinsic-size: 320px; contain-intrinsic-size: auto 320px; }
+
.deck-stage { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.deck-viewport { overflow: hidden; touch-action: pan-y; cursor: grab; }
.deck-viewport.dragging { cursor: grabbing; }
@@ -919,7 +938,7 @@
.dt-chrome .lv { display: inline-flex; align-items: center; gap: 4px; font-size: 0.56rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.dt-chrome .lv i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent); animation: dtpulse 1.6s infinite; }
@keyframes dtpulse { 0%,100%{opacity:1} 50%{opacity:.35} }
- .dt-media img { display: block; width: 100%; height: 170px; object-fit: cover; }
+ .dt-media img, .dt-media video { display: block; width: 100%; height: 170px; object-fit: cover; }
.dposter .dt-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 13px;
color: hsl(var(--ch) var(--tint-s) 74%); }
[data-theme="light"] .dposter .dt-cat { color: hsl(var(--ch) calc(var(--tint-s) + 12%) 36%); }
@@ -1115,7 +1134,7 @@
<a class="dposter" href="demos.html#freecad" style="--ch:210">
<div class="dt-media">
<div class="dt-chrome"><span class="dts"><i></i><i></i><i></i></span><span class="u">cli-anything-freecad · preview live</span><span class="lv"><i></i>live</span></div>
- <img loading="lazy" src="assets/demos/freecad-curiosity-preview-trajectory.gif" alt="FreeCAD Curiosity rover demo">
+ <video class="lazy-vid" muted loop playsinline preload="none" poster="assets/demos/freecad-curiosity-preview-trajectory-poster.jpg" src="assets/demos/freecad-curiosity-preview-trajectory.mp4" aria-label="FreeCAD Curiosity rover demo"></video>
</div>
<span class="dt-cat"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2 3 7v10l9 5 9-5V7z"/><path d="M3 7l9 5 9-5"/><path d="M12 12v10"/></svg>3D / CAD</span>
<h3><span class="ap">FreeCAD</span> — Curiosity Rover</h3>
@@ -1126,7 +1145,7 @@
<a class="dposter" href="demos.html#blender" style="--ch:28">
<div class="dt-media">
<div class="dt-chrome"><span class="dts"><i></i><i></i><i></i></span><span class="u">cli-anything-blender · preview live</span><span class="lv"><i></i>live</span></div>
- <img loading="lazy" src="assets/demos/blender-orbital-relay-drone-preview-trajectory.gif" alt="Blender orbital relay drone demo">
+ <video class="lazy-vid" muted loop playsinline preload="none" poster="assets/demos/blender-orbital-relay-drone-preview-trajectory-poster.jpg" src="assets/demos/blender-orbital-relay-drone-preview-trajectory.mp4" aria-label="Blender orbital relay drone demo"></video>
</div>
<span class="dt-cat"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2 3 7v10l9 5 9-5V7z"/><path d="M3 7l9 5 9-5"/><path d="M12 12v10"/></svg>3D · Hard-surface</span>
<h3><span class="ap">Blender</span> — Orbital Relay Drone</h3>
@@ -1137,7 +1156,7 @@
<a class="dposter" href="demos.html#drawio" style="--ch:250">
<div class="dt-media">
<div class="dt-chrome"><span class="dts"><i></i><i></i><i></i></span><span class="u">cli-anything-drawio · build</span><span class="lv"><i></i>live</span></div>
- <img loading="lazy" src="assets/demos/drawio-demo.gif" alt="Draw.io HTTPS handshake diagram demo">
+ <video class="lazy-vid" muted loop playsinline preload="none" poster="assets/demos/drawio-demo-poster.jpg" src="assets/demos/drawio-demo.mp4" aria-label="Draw.io HTTPS handshake diagram demo"></video>
</div>
<span class="dt-cat"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="5" rx="1"/><rect x="14" y="16" width="7" height="5" rx="1"/><path d="M6.5 8v4a2 2 0 0 0 2 2h9"/></svg>Diagramming</span>
<h3><span class="ap">Draw.io</span> — HTTPS Handshake</h3>
@@ -1483,6 +1502,38 @@
window.addEventListener('resize', () => { if (window.innerWidth > 860) setOpen(false); });
})();
+ // ── Demo videos: play near the viewport, tear down far from it ──
+ // Demos ship as H.264 <video> (hardware-decoded, a few MB) instead of animated GIF
+ // (hundreds of MB of decoded frames — the iOS Safari tab-kill culprit). preload="none"
+ // keeps them free until scrolled near. Two rings: within 200px play/pause; beyond
+ // 1200px drop the src entirely so the media pipeline is fully released (poster stays).
+ (function () {
+ const vids = document.querySelectorAll('video.lazy-vid');
+ if (!vids.length) return;
+ const start = (v) => {
+ if (!v.getAttribute('src') && v.dataset.src) { v.setAttribute('src', v.dataset.src); v.load(); }
+ v.muted = true; const p = v.play(); if (p) p.catch(() => {});
+ };
+ if (!('IntersectionObserver' in window)) { vids.forEach(start); return; }
+ const near = new IntersectionObserver((entries) => {
+ entries.forEach((en) => {
+ if (en.isIntersecting) start(en.target);
+ else if (!en.target.paused) en.target.pause();
+ });
+ }, { rootMargin: '200px 0px' });
+ const far = new IntersectionObserver((entries) => {
+ entries.forEach((en) => {
+ const v = en.target;
+ if (!en.isIntersecting && v.getAttribute('src')) {
+ v.dataset.src = v.getAttribute('src');
+ if (!v.paused) v.pause();
+ v.removeAttribute('src'); v.load();
+ }
+ });
+ }, { rootMargin: '1200px 0px' });
+ vids.forEach(v => { near.observe(v); far.observe(v); });
+ })();
+
const REPO = 'https://github.com/HKUDS/CLI-Anything';
const GITHUB_REPO_API = 'https://api.github.com/repos/HKUDS/CLI-Anything';
const GITHUB_STARS_BADGE_API = 'https://img.shields.io/github/stars/HKUDS/CLI-Anything.json';