fk-refresh-urls

A command that renews expired Google Cloud Storage signed URLs for every scene and character reference image in a video. Signed URLs are temporary links used to access private files.

In plain words
What is it for?
Use it before reviewing a video or combining it with narration, especially when the media is accessed through URLs instead of local files.
Why use it?
It fixes broken media links after generated videos have been waiting for a while or when files must be downloaded later.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/crisng95/flowkit/fk-refresh-urls
Clone the repo
git clone --depth 1 https://github.com/crisng95/flowkit

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,129 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01129
Opus 5 $0.00000 $0.00564
Sonnet 5 $0.00000 $0.00226
Haiku 4.5 $0.00000 $0.00113

Measured 2d ago against content hash ee3358394373, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

fk-refresh-urls scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

PID=$(curl -s "http://127.0.0.1:8100/api/videos/${VID}" | python3 -c "import sys,json; print(json.load(sys.stdin)['project_id'])")

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://127.0.0.1:8100/api/flow/status
.claude/commands/fk-refresh-urls.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refresh expired GCS signed URLs for all scenes in a video (images, videos, upscale videos) and character reference images.

Usage: /fk-refresh-urls <video_id> [--project-id <PID>]

When to use

  • Before /fk-review-video if videos were generated hours ago (GCS signed URLs expire)
  • Before /fk-concat-fit-narrator if downloading from URLs instead of local files
  • After any long gap between generation and consumption of media URLs

Pre-flight

# Extension must be connected with flow key
curl -s http://127.0.0.1:8100/api/flow/status
# Must show: {"connected": true, "flow_key_present": true}
# If flow_key_present is false: open/refresh a Google Flow tab in Chrome

Step 1: Get project_id from video

VID="<video_id>"
PID=$(curl -s "http://127.0.0.1:8100/api/videos/${VID}" | python3 -c "import sys,json; print(json.load(sys.stdin)['project_id'])")
echo "Project: $PID"

Step 2: Bulk refresh via TRPC

This calls Google Flow's TRPC flow.getFlow endpoint, extracts ALL fresh signed URLs from the response, and updates scenes + characters in DB.

curl -s -X POST "http://127.0.0.1:8100/api/flow/refresh-urls/${PID}" | python3 -c "
import sys, json
r = json.load(sys.stdin)
print(f\"Refreshed: {r.get('refreshed', 0)} URLs (found {r.get('found', 0)} total)\")
if r.get('error'):
    print(f\"ERROR: {r['error']}\")
"

What gets updated:

  • horizontal_image_url / vertical_image_url — scene images
  • horizontal_video_url / vertical_video_url — scene videos (original)
  • horizontal_upscale_url / vertical_upscale_url — 4K upscaled videos
  • reference_image_url — character/entity reference images

The server matches each URL's media_id against *_media_id fields on scenes and characters, updating whichever orientation/type matches.

Step 3: Verify refresh worked

# Check a few scenes have valid URLs
curl -s "http://127.0.0.1:8100/api/scenes?video_id=${VID}" | python3 -c "
import sys, json
scenes = sorted(json.load(sys.stdin), key=lambda s: s['display_order'])

# Auto-detect orientation
ori = 'horizontal'
for s in scenes:
    if s.get('horizontal_video_status') == 'COMPLETED' and s.get('horizontal_video_url'):
        ori = 'horizontal'; break
    if s.get('vertical_video_status') == 'COMPLETED' and s.get('vertical_video_url'):
        ori = 'vertical'; break

ok = 0; expired = 0
for s in scenes:
    url = s.get(f'{ori}_video_url') or ''
    if url and 'Expires=' in url:
        import re, time
        m = re.search(r'Expires=(\d+)', url)
        if m and int(m.group(1)) > time.time():
            ok += 1
        else:
            expired += 1
    elif url:
        ok += 1
    else:
        expired += 1

print(f'Orientation: {ori.upper()}')
print(f'Valid URLs: {ok}/{len(scenes)}')
if expired:
    print(f'Still expired: {expired} — may need to open Flow tab in Chrome for flow key')
else:
    print('All URLs refreshed successfully!')
"

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 117 lines · 0 tokens per session scan C ee3358394373

Subscribe to this mod's changes

fk-refresh-urls is a command published in the GitHub repository crisng95/flowkit (620 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,129 tokens. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.