Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / index.html
Created October 24, 2025 19:50
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; The terminal-to-html tool should include a checkbox for if the created </span>
<span style="color: rgb(255, 255, 255);">Gist should be private, and it should default to checked </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> I'll help you add a privacy checkbox to the terminal-to-html tool. Let me</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> first explore the codebase to understand the current implementation.</span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">Search</span><span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);">(pattern: "**/terminal-to-html*")</span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background:
@simonw
simonw / index.html
Created October 24, 2025 19:20
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; The logic in AllowedResourcesView has got very complex, could that be refactored to use the new </span>
<span style="color: rgb(255, 255, 255);">datasette.allowed_resources methods? </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> Good idea! Yes, the </span><span style="color: rgb(162, 168, 247); background: rgb(0, 0, 0);">AllowedResourcesView</span><span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> can be significantly simplified by using the </span><span style="color: rgb(162, 168, 247); background: rgb(0, 0, 0);">datasette.allowed_resources()</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> method. Let me refactor it:</span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">Read</span><span sty
@simonw
simonw / index.html
Created October 24, 2025 19:18
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; You broke some tests, try running test_permission_endpoints.py and test_utils_permissions.py </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">Bash</span><span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);">(pytest tests/test_permission_endpoints.py tests/test_utils_permissions.py -xvs)</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span>⎿<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span> <span style="color: rgb(252, 81, 109); background: rgb(0, 0, 0);">Error: sys:1: RuntimeWarning: coroutine 'ds_with_permissions' was never awaited</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(252, 81, 109); background: rgb(0, 0, 0);">===========
@simonw
simonw / index.html
Created October 24, 2025 19:03
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;">⏺<span style="color: rgb(242, 242, 242);"> Great! Now I can return to implementing the </span><span style="color: rgb(162, 168, 247);">also_requires</span><span style="color: rgb(242, 242, 242);"> feature for execute-sql. Let me recap the plan:</span>
<span style="color: rgb(242, 242, 242);"> 1. Add an </span><span style="color: rgb(162, 168, 247);">also_requires</span><span style="color: rgb(242, 242, 242);"> field to the Action dataclass</span>
<span style="color: rgb(242, 242, 242);"> 2. Update </span><span style="color: rgb(162, 168, 247);">allowed_resources_sql()</span><span style="color: rgb(242, 242, 242);"> to handle the </span><span style="color: rgb(162, 168, 247);">also_requires</span><span style="color: rgb(242, 242, 242);"> field by generating both SQLs and combining them with an</span>
<span style="color: rgb(242, 242, 242);"> INNER JOIN in a CTE</span>
<span style="color: rgb(242, 242, 242)
@simonw
simonw / index.html
Created October 24, 2025 18:41
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; It strikes me that the thing where we namespace our parameters is the source of a whole lot of complexity - I think </span>
<span style="color: rgb(255, 255, 255);">that mechanism exists purely to avoid the unlikely case where two permissions plugins chose the same name for their </span>
<span style="color: rgb(255, 255, 255);">parameters. Maybe we could solve that with a naming convention that we tell plugin authors about instead? </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">Excellent Point: Eliminate Parameter Namespacing Entirely</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> You're absolutely right! Let's trace through where parameter namespacing happens and why.</span>
⏺<span style="color: rgb(242, 242, 242); background:
@simonw
simonw / index.html
Created October 24, 2025 18:15
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; OK I am testing your fix - http://127.0.0.1:8001/-/rules.json?action=view-table&amp;page_size=50&amp;page=2 is working </span>
<span style="color: rgb(255, 255, 255);">correctly, I can see the deny rule at the end (I am accessing it as the root user) - but </span>
<span style="color: rgb(255, 255, 255);">http://127.0.0.1:8001/-/allowed.json?action=view-table&amp;page_size=50 for that root user is still listing those tables in </span>
<span style="color: rgb(255, 255, 255);">content even when actually navigating to http://127.0.0.1:8001/content or http://127.0.0.1:8001/content/repos shows a 403</span>
<span style="color: rgb(255, 255, 255);"> </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> Let me investigate this issue. The </span><span style="color: rgb(162, 168, 247); background: rgb(0, 0, 0);">/-/rules</span><span style="color: rg
@simonw
simonw / index.html
Created October 24, 2025 18:02
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(242, 242, 242); padding: 15px; border-radius: 4px;"><span style="color: rgb(242, 242, 242);">&gt; </span><span style="color: rgb(255, 255, 255); background: rgb(42, 42, 42);">Take a look at https://github.com/simonw/datasette/issues/2509 and </span><span style="color: rgb(227, 71, 70);">u</span><span style="color: rgb(240, 118, 70);">l</span><span style="color: rgb(247, 183, 77);">t</span><span style="color: rgb(129, 191, 111);">r</span><span style="color: rgb(112, 152, 212);">a</span><span style="color: rgb(136, 107, 188);">t</span><span style="color: rgb(186, 107, 165);">h</span><span style="color: rgb(227, 71, 70);">i</span><span style="color: rgb(240, 118, 70);">n</span><span style="color: rgb(247, 183, 77);">k</span><span style="color: rgb(255, 255, 255); background: rgb(42, 42, 42);"> about what is going on</span>
⏺<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(255, 255, 255);">Fetch</span><span style="color: rgb(242, 242, 242);
@simonw
simonw / index.html
Created October 24, 2025 17:15
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(180, 36, 25); padding: 15px; border-radius: 4px;"><span style="color: rgb(180, 36, 25);">Error: Git working directory is not clean. Please commit or stash your changes before using --teleport.</span>
<span style="color: rgb(242, 242, 242);">(base) simon@Mac datasette-pretty-traces % </span>
<span style="color: rgb(242, 242, 242);">(base) simon@Mac datasette-pretty-traces % ls</span>
<span style="color: rgb(242, 242, 242);">datasette_pretty_traces Pipfile tests</span>
<span style="color: rgb(242, 242, 242);">datasette_pretty_traces.egg-info README.md</span>
<span style="color: rgb(242, 242, 242);">LICENSE setup.py</span>
<span style="color: rgb(242, 242, 242);">(base) simon@Mac datasette-pretty-traces % git status</span>
<span style="color: rgb(242, 242, 242);">On branch main</span>
<span style="color: rgb(242, 242, 242);">Your branch is up to date with 'origin/main'.</span>
@simonw
simonw / index.html
Created October 24, 2025 06:46
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;">⏺<span style="color: rgb(242, 242, 242);"> Perfect! The dev server is now running successfully </span><span style="color: rgb(97, 97, 97);">11:36 PM</span><span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(97, 97, 97);">claude-sonnet-4-5-20250929</span>
<span style="color: rgb(242, 242, 242);"> on port 8036. I've completed all the changes:</span>
<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(255, 255, 255);">Summary of Changes</span>
<span style="color: rgb(242, 242, 242);"> I've successfully updated the video editor to track</span>
<span style="color: rgb(242, 242, 242);"> and use actual filenames for overlay images in the</span>
<span style="color: rgb(242, 242, 242);"> FFmpeg commands:</span>
<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(97, 97, 97);">What Changed:</span>
@simonw
simonw / index.html
Created October 24, 2025 06:45
Terminal output HTML
This file has been truncated, but you can view the full file.
<pre style="background: rgb(0, 0, 0); color: rgb(242, 242, 242); padding: 15px; border-radius: 4px;">
╭───<span style="color: rgb(204, 98, 70);"> Claude Code </span><span style="color: rgb(135, 135, 135);">v2.0.26</span><span style="color: rgb(204, 98, 70);"> </span>──────────────────────────────────────────────────────────────────────────╮
│<span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(204, 98, 70);">Tips for getting started</span><span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(255, 255, 255);">Welcome back Simon!</span><span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> Run /init to create a CLAUDE.md file with inst</span>…<span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);">