unfetch: Instructions file for Codex

AGENTS.md

unfetch AGENTS.md is an instructions file for Codex, OpenCode from guangtoutong/unfetch. It costs 4,330 tokens per session, scanned A, a copy of unfetch CLAUDE.md, MIT.

A project instruction document for unfetch, a download tool that supports web links, torrents, magnet links, and video sites. It describes the product role, architecture, and rules for its command-line and AI-tool interfaces.

In plain words
What is it for?
It is for guiding development of unfetch, including its Go download service, Rust desktop and command-line layer, local web API, and AI-tool integration.
Why use it?
It gives coding agents and contributors a shared understanding of how the project is organised and which design decisions they must preserve.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md; mentions Codex.

This is guangtoutong/unfetch's own configuration. It tells Codex and OpenCode how to work on unfetch itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unfetch configures →

Reuse

Borrowing it

Nothing to install: this file belongs to guangtoutong/unfetch. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/guangtoutong/unfetch/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/guangtoutong/unfetch

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unfetch AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/guangtoutong/unfetch/agents-md/github.svg)](https://agentmods.dev/instructions/guangtoutong/unfetch/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/guangtoutong/unfetch/agents-md"><img src="https://agentmods.dev/badge/instructions/guangtoutong/unfetch/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unfetch AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/guangtoutong/unfetch/agents-md"><img src="https://agentmods.dev/badge/instructions/guangtoutong/unfetch/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,330 This file is loaded in full into every session.
When invoked 4,330 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod 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.1 $0.04330 $0.04330
Opus 5.5 $0.01732 $0.01732
Sonnet 5.5 $0.00866 $0.00866
Haiku 4.5 $0.00433 $0.00433

Measured yesterday against content hash 1da8e7a72c48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unfetch AGENTS.md scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

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

1. **daemon 启动**:`unfetch daemon` 启动后 `curl http://127.0.0.1:19543/health` 返回 200
Origin

This is a copy

92% identical to unfetch CLAUDE.md — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

AGENTS.md · 429 lines

How it starts

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

unfetch — 开发指南

产品定位

unfetch 是一个专注于下载的工具,是 Unflick 生态的下载引擎层。

核心问题:Unflick 内置的视频下载能力很弱——它只是调用 yt-dlp 提取流媒体 URL 然后用 mpv 播放,并没有真正的下载管理:无断点续传、无多线程加速、无队列管理、无 BT/磁力链接支持。unfetch 填补这个缺口。

定位关系:

Unflick  →  播放(libmpv,本地文件 + 流媒体)
unfetch  →  获取(HTTP 多线程 + BT + 磁力 + ed2k + 1000+ 视频网站)

联动方式:unfetch 下载完成后,可一键调用 unflick play <file>;Unflick 中"另存为"按钮调用 unfetch add <url>。


架构决策

CLI/MCP First(继承自 Unflick)

每个功能必须先通过 CLI 和 MCP 可用,然后才考虑 GUI。

GUI 是可选的,daemon 是必须的。关掉 GUI 窗口不影响正在进行的下载任务。

双进程架构

Go daemon(下载引擎)  ←── REST API ──→  Rust/Tauri shell(GUI + CLI + MCP)
     ↑                                          ↑
     └── unfetch add <url>                      └── unfetch --mcp
          (CLI 直接调用 daemon API)                  (AI 工具)
  • Go daemon:负责所有下载逻辑(HTTP、BT、yt-dlp 集成)。以独立进程运行,暴露本地 REST API(默认端口 19543)。Go 二进制打包进 Tauri 的 resources 目录。
  • Rust/Tauri shell:负责 GUI 窗口、CLI 命令解析(clap)、MCP 服务器。所有操作都通过 REST API 转发给 Go daemon,自身不包含任何下载逻辑。

为什么用 Go 做 daemon,而不是纯 Rust?

  • go-ytdlp(Go 绑定)比 Rust 的 yt-dlp 集成成熟得多
  • anacrolix/torrent(Go BT 库)功能完整,是业界标准
  • Go 的 goroutine 天然适合并发下载任务管理
  • Unflick 已经用了 Rust,两个项目技术栈互补而不重复

技术栈

层 技术 说明
下载引擎 Go 1.23+ daemon 进程,REST API
BT 协议 anacrolix/torrent 支持 BT + 磁力链接
视频网站下载 go-ytdlp (go-ytdlp/go-ytdlp) 包装 yt-dlp 二进制
HTTP 下载 自研,基于 Go net/http 多线程分片 + 断点续传
ed2k 协议 go-ed2k 或调用 aMule CLI 可选,后期支持
GUI 框架 Tauri 2 + React 18 + TypeScript 与 Unflick 一致
前端状态 Zustand 与 Unflick 一致
前端样式 Tailwind CSS + Framer Motion 与 Unflick 一致
CLI 解析 clap 4(Rust) 与 Unflick 一致
MCP 服务器 Rust(JSON-RPC 2.0 over stdio) 与 Unflick 一致
配置持久化 JSON(~/.config/unfetch/config.json)
任务持久化 SQLite(Go 侧,~/.local/share/unfetch/tasks.db)
包管理(前端) pnpm 全局约定

目录结构

unfetch/
├── AGENTS.md
├── README.md
├── .gitignore
│
├── core/                          # Go daemon(下载引擎)
│   ├── go.mod
│   ├── go.sum
│   ├── main.go                    # daemon 入口,启动 HTTP 服务器
│   ├── api/
│   │   ├── router.go              # REST API 路由(chi 或 gin)
│   │   ├── tasks.go               # /tasks 端点
│   │   └── config.go              # /config 端点
│   ├── downloader/
│   │   ├── http.go                # 多线程 HTTP 下载(分片 + 续传)
│   │   ├── bt.go                  # BT + 磁力链接(anacrolix/torrent)
│   │   └── ytdlp.go               # yt-dlp 集成(go-ytdlp)
│   ├── queue/
│   │   ├── manager.go             # 任务队列(并发控制、优先级)
│   │   └── store.go               # SQLite 持久化
│   └── types/
│       └── task.go                # Task、Status、Config 数据结构
│
├── src/                           # React 前端
│   ├── App.tsx
│   ├── main.tsx
│   ├── index.css
│   ├── components/
│   │   ├── TaskList/
│   │   │   ├── TaskList.tsx       # 下载任务列表
│   │   │   └── TaskItem.tsx       # 单个任务(进度条、速度、ETA)
│   │   ├── AddTask/
│   │   │   └── AddTaskDialog.tsx  # 添加任务对话框(URL 输入 + 选项)
│   │   ├── Settings/
│   │   │   └── SettingsPanel.tsx
│   │   └── TitleBar.tsx
│   ├── stores/
│   │   ├── taskStore.ts           # 下载任务状态
│   │   └── settingsStore.ts
│   └── lib/
│       └── api.ts                 # 调用 daemon REST API 的封装
│
└── src-tauri/                     # Rust/Tauri shell
    ├── Cargo.toml
    ├── tauri.conf.json
    └── src/
        ├── main.rs                # 模式检测(GUI / CLI / MCP)
        ├── lib.rs
        ├── daemon/
        │   └── mod.rs             # 启动/检测 Go daemon 进程
        ├── cli/
        │   ├── mod.rs
        │   └── commands.rs        # clap 命令定义 → 调用 daemon REST API
        ├── mcp/
        │   ├── mod.rs
        │   ├── server.rs          # JSON-RPC 2.0 over stdio
        │   └── tools.rs           # MCP 工具定义
        └── gui/
            └── commands.rs        # Tauri commands(主要是代理给 daemon)

Read the full file on GitHub · 429 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. yesterday First seen · 429 lines · 4,330 tokens per session scan A 1da8e7a72c48

Subscribe to this mod's changes

unfetch AGENTS.md is an instructions file published in the GitHub repository guangtoutong/unfetch (1 stars, last pushed yesterday), licensed MIT. It adds 4,330 tokens to every session, about $0.0173 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 92% identical to unfetch CLAUDE.md, differing in 6 lines, and is treated as a copy.

Related

unfetch AGENTS.md compared with instructions from other repositories

unfetch AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
unfetch AGENTS.mdguangtoutong/unfetchInstructions file1yesterdayMITA4,330Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot