fileterm AGENTS.md

An entry guide to the FileTerm codebase for coding agents. It explains the project's purpose, where its architecture and design documents live, and boundaries between Rust, Tauri, the user interface, shared types, and network protocols.

In plain words
What is it for?
Use it when starting work in FileTerm, especially for tasks crossing Rust commands, the Tauri bridge, React screens, shared packages, SSH/SFTP/FTP services, or project documentation.
Why use it?
It helps an agent find the relevant project rules and avoid changing the wrong layer or relying on outdated Electron code.

Instructions file for CodexOpenCode

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 instructions/st0ff3l/fileterm/agents-md
Clone the repo
git clone --depth 1 https://github.com/St0ff3l/fileterm

Made for: Codex, OpenCode.

Per session 3,403 This file is loaded in full into every session.
When invoked 3,403 The same file — it is already loaded in full.
Security scan A 0 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.03403 $0.03403
Opus 5 $0.01702 $0.01702
Sonnet 5 $0.00681 $0.00681
Haiku 4.5 $0.00340 $0.00340

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

Security

Grade A, and why

fileterm AGENTS.md scanned grade A with 0 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 185 lines

How it starts

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

FileTerm Agent Guide

本文件是智能体进入 FileTerm 仓库时的入口地图,不是完整手册。详细事实以 docs/ 为准;当代码、设计或计划变化时,优先更新对应文档,不要把所有知识继续堆进这里。

1. 项目定位

FileTerm 是面向开发者与运维场景的 Rust + Tauri 桌面远程工作台,围绕 SSH / SFTP / FTP 构建可日常使用的多标签桌面客户端。apps/electron 仅保留为历史代码参考,不再参与构建、测试或发布。

当前阶段:Tauri 主链路稳定与发行收口。质量门禁覆盖共享包与 Rust/Tauri,Windows 使用签名的 Tauri 应用内更新;macOS 继续检查后跳转 GitHub Release 下载。

2. 先读哪里

  • 架构地图:docs/architecture.md
  • 设计规范:docs/design.md
  • 路线图:docs/roadmap.md
  • 进行中计划:docs/plans/active/
  • 已完成计划:docs/plans/completed/
  • 架构决策:docs/decisions/
  • 质量与回归:docs/quality/
  • 已隐藏功能:docs/hidden-features.md
  • 功能草案:.agents/extensions/
  • 项目技能:.agents/skills/

如果任务只改一个小点,先读本文件和相关源码即可;如果任务跨 Rust commands / bridge / renderer / packages 多层,必须先看 docs/architecture.mddocs/plans/active/

3. 硬性边界

架构边界

  • packages/core 是领域模型的 single source of truth。
  • Renderer 不直接访问 SSH / SFTP / FTP protocol clients。
  • 所有系统能力必须走 Rust commands/events -> tauri-api.ts -> renderer
  • SSH/SFTP 与 FTP 在 controller/protocol 层保持分离,不做伪统一。
  • Transfer 进度统一进入 Rust transfer service,不在组件里零散维护。
  • 会话事件通过 Rust workspace runtime 的统一 event/channel 边界分发,不分散监听协议 worker。
  • 新状态优先进入 packages/core 定义类型,再下沉到服务层和 UI。
  • 新窗口能力先定义 IPC 边界,再做 renderer 交互。
  • 主题样式优先走 token -> theme vars -> component skins -> terminal colors

平台兼容边界

  • CWD 目录跟随:终端工作目录 (CWD) 变化通过底层会话流安全捕获,经 runtime 广播同步给文件管理器,严禁 UI 层轮询或直接探测平台路径。
  • POSIX CWD 注入门控supportsPosixShellSetup() 仅对 linux / busybox 返回 true。Windows / unknown 平台严禁注入 Linux shell CWD 脚本,采用 fail-closed 双重门控(detectPlatformAndSetupShell + injectShellSetup 各一道)。
  • CRLF 归一化:系统指标解析入口必须对远端输出做 replace(/\r\n?/g, '\n') 归一化,避免 'windows\r' 等污染导致平台误判。
  • Sudo 与 Root 状态同步:终端执行 sudo 或切换用户态需被底层 runtime 解析,双向同步到文件管理器权限模型。

UI 与公用组件边界

  • 语言名称使用本地自称:语言选择器中的语言名称必须保持该语言自己的写法(如 简体中文English한국어 / 조선어),不得根据当前界面语言翻译;新增语言时同样遵循此规则。
  • 下拉框统一走 DropdownSelect:所有表单与设置项的下拉菜单必须统一使用公用组件 <DropdownSelect>,严禁直写原始 HTML <select> 标签(确保 macOS 下包裹 ft-select-shell 外壳,Windows / Linux 下 100% 触发自绘 React Portal 弹出菜单)。
  • 下拉箭头随控件缩放DropdownSelect 的箭头必须由组件根据当前控件实际高度自适应(覆盖 macOS 原生外壳和 Windows/Linux 自绘触发器),业务组件不得写死一套箭头尺寸或覆盖共享计算;新增紧凑/表单尺寸时必须检查箭头与文字的垂直对齐。
  • 图标矢量就地化:所有按钮与视觉图标优先使用预置的离线 SVG 图标组件 <AppIcon />,严禁新增 <span className="material-symbols-outlined"> 依赖外部字体/WebFont 图标。
  • 二次确认弹窗统一:所有破坏性/危险操作(如删除、清空等)必须调用项目通用的 <ConfirmActionDialog> 确认弹窗组件,严禁在桌面 Webview 环境中使用原生 window.confirm()
  • 按钮尺寸高度规范:同一操作组/表单行内的按钮必须具有严格统一的高度(如 32px 紧凑型 / 36px 表单型)、边框半径与内边距,禁止主次按钮尺寸参差不齐。
  • 颜色语义边界--focus-outline 只用于焦点/选中/拖拽目标的描边或光环;文件相关操作使用 --folder-accent,实心主按钮使用 --button-primary-*,不要用描边色填充按钮。
  • 滚动条统一走公用组件:Renderer 中新增或改造的纵向滚动区域,默认必须复用 features/common/VerticalScrollbar.tsx,像终端区、文件区一样通过 scrollRef 绑定,并隐藏容器原生纵向滚动条;除非用户明确要求特殊行为,禁止在业务组件里单独绘制一套滚动条。横向滚动、第三方编辑器内部滚动和协议组件自带滚动可保留各自实现,但不得替代纵向公用滚动条。

Read the full file on GitHub · 185 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 · 185 lines · 3,403 tokens per session scan A 2677c366e71d

Subscribe to this mod's changes

fileterm AGENTS.md is an instructions file published in the GitHub repository St0ff3l/fileterm (297 stars, last pushed 2d ago), licensed MIT. It adds 3,403 tokens to every session, about $0.0170 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.