Skip to content
Projects

harryopo/tdsf-terminal-agent

View on GitHub

About

终端优先的 Linux AI 运维工作台:SSH/SFTP、真实命令回显、分级审批与一步一卡教学。Windows 桌面预稳定版。A terminal-first AI workbench for Linux operations.

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
0

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

TDSF Terminal Agent

An AI terminal workbench for Linux operations and hands-on learning

中文 · English

Download Windows x64 · v0.9.2 · Watch the demo · Run from source

Main branch CI Apache 2.0 license

TDSF Terminal Agent showing a Linux terminal, the SSH file tree, and the agent panel

Screenshot from a development build

Download and source

Installer · Windows x64 v0.9.2 includes local, WSL and SSH workspaces, basic agent workflows, and a compact offline knowledge library. This is a pre-stable release. The release notes list the shipped changes and the SHA-256 checksum. Release notes · Installation

Source · GitHub main is the basis for the operations, approval, and teaching features described below. The changelog tracks subsequent fixes and feature changes. Unreleased changes · Report an issue

Demo video

https://github.com/user-attachments/assets/098ef676-e903-4aeb-a0f9-24dfb33f9f5e

Watch the full-resolution video

Contents


What it is

TDSF brings the Linux terminal, file tree, editor, and operations agent into one workspace. Ask the agent to explain an error, troubleshoot a service, or guide you through a command one step at a time with actual terminal output.

Work in context Review execution Learn by doing
Connect a local, WSL, or SSH session and browse or edit files See the command in the terminal, decide whether to approve requests, and inspect the output Run one command card at a time, then explore the result

Core capabilities

Agent runtime

  • A single main agent driven by Strands Agents. The tool registry is the single source of truth for implementation, schema and policy, and a gate keeps the parameters the model sees identical to the ones the code accepts.
  • 25 registered tools (full catalog).
  • Observe mode removes write-capable tools from the schema — the model cannot call a tool it never received.
  • Provider retries are owned by one component, so a single 429 does not fan out into dozens of requests.

SSH server management

  • Pure-Rust SSH client (russh) with password and public-key authentication. Credentials live in the Windows credential store, never in the repository.
  • TOFU host-key verification: unknown hosts raise an approval prompt; a changed key raises a man-in-the-middle warning, with an option to clear that host's stale entries and re-trust after you verify it.
  • Multiple terminal tabs in one workspace each hold their own independent connection; closing a tab releases the session it exclusively owned.
  • SFTP browsing and editing, drag-and-drop upload from the file explorer, and a remote tree that follows the current session's working directory.
  • Local, remote and dynamic (SOCKS5) port forwarding.
  • A live server monitor (CPU, memory, disk, network, processes) collected over the SSH channel without occupying the agent.

Terminal, editor and everyday tooling

  • Local PTY / WSL / SSH terminals share one xterm.js render pool; split panes; per-workspace tab sets.
  • Command prediction: bundled spec index, carapace parameter completion, curated Chinese tldr descriptions and the remote shell's own command set. Parameter completion is throttled, so it does not spawn a process per keystroke. Static flags work without any install; to suggest branches, files and services that actually exist on the server, install the completion component there once from Settings → 通用 (General) → 远端补全组件.
  • CodeMirror 6 editor with LSP and remote file editing, snippets, and selection translation that resolves against the built-in dictionaries offline — the "AI 补全释义" button is what additionally asks your configured model for a richer explanation.

Local knowledge retrieval

  • Indexes documents already present in the local data directory or imported by you; the entry count depends on the machine.
  • Retrieval runs entirely locally: SQLite FTS5 keyword search plus sqlite-vec semantic search (fastembed / BGE-small-zh, 512 dimensions), fused with RRF.
  • Reasoning still uses the model provider you configure; knowledge retrieval itself sends nothing out.

Workspaces, sessions and memory

  • A workspace is the isolation unit: the agent only sees the environment of the workspace its conversation belongs to, so a command meant for host A cannot land on host B.
  • Conversations are isolated per workspace. Session summaries and successful troubleshooting cases can be stored locally with a workspace tag and recalled by later conversations in that workspace.

Four interaction modes

The UI offers four modes. Permissions are decided by three sidecar modes (observe / confirm / auto, defaulting to confirm); teaching is the observe permission set plus a teaching flag.

Mode What the agent may do Typical use
Observe Read-only analysis; write-capable tools are absent from the schema Production inspection
Confirm (default) Full toolset; recognised read-only queries run directly, anything unknown or state-changing goes through an approval card Day-to-day operations, human in the loop
Auto Low-risk (L0–L2) runs directly; L3/L4 still require approval Trusted environment
Teach Observe permissions plus the teaching flow; one command card at a time, nothing executed by the backend Classroom / self-paced learning

In teaching mode, explanations follow a fixed section contract (concepts and principles → path breakdown → design philosophy → worked examples → pitfalls → exercise). Each action becomes a command card; the command reaches the visible terminal only when you press Run, and the lesson continues after the real output returns.

Tool catalog (25)

Group Tools
Execution and observation ssh_command · get_terminal_output · suggest_command · python_run · ask_user
Remote files read_remote_file · write_remote_file
Operations service_manage · package_manage · firewall_manage · security_audit · performance_analyze · network_diagnose · inspect_processes · analyze_logs
Evidence and review assess_confidence · search_history · config_diff · backup_restore · todo_write
Knowledge and skills knowledge_search · knowledge_get_doc · skill_invoke · save_skill
Sessions ssh_list_sessions

Teaching mode is not a 26th tool: it intercepts the tools above and returns a structured single-step command card, which the terminal then really executes.

Safety boundary

The latest remote-file approval, Python risk-classification and SSH forwarding-isolation fixes are not yet included in existing installers. See unreleased changes.

  • Impact levels: current classification emits L0 / L2 / L3 / L4 (L1 is kept for compatibility); unknown commands fail closed, and compound commands are assessed segment by segment.
  • Hard denylist: catastrophic operations are blocked outright, with no "approve anyway" path.
  • Reading credentials requires consent: commands such as cat ~/.ssh/id_rsa or head /etc/shadow are raised to L3 approval on both the SSH and Python paths — the credential path list has exactly one owner shared by both channels.
  • Per-session FIFO: the next approval card is not shown until the previous command has returned from SSH.
  • Circuit breaker: up to 50 tool calls per turn; three consecutive failures for one tool trips the breaker.
  • Exit codes reported honestly: read-only / low-risk commands may be marked completed with a non-zero code, while retaining the actual exit_code, stderr and an explanation. State-changing failures remain errors; missing exit codes are indeterminate, not invented successes.
  • Output redaction filters known credential patterns before they enter model context and logs; the configured API key is no longer written to disk in plaintext. Redaction is not a confidentiality guarantee: review attachments and output before sending.
  • No silent channel switches: a write operation is never moved to the background because "no terminal is visible" — only read-only commands may be rerouted, and the reroute is stated in the payload.

Risk classification and approval are not an OS sandbox. Local python_run uses a Python subprocess; setting its working directory does not restrict all filesystem or network access. Execution retains the current account's permissions.

Architecture

React 19 frontend   (agent panel, terminals, workspaces, editor)
      │  Tauri invoke / events
      ▼
Rust shell          (PTY · SSH · SFTP · tunnels · human-typing engine · sidecar supervisor)
      │  JSON-RPC over stdio
      ▼
Python sidecar      (Strands agent · tool registry · approvals · knowledge · evidence)
Layer Stack
Desktop shell Tauri 2 (Rust)
Frontend React 19 · TypeScript · Vite · Tailwind CSS v4 · zustand · xterm.js · CodeMirror 6
SSH / PTY russh · russh-sftp · portable-pty · keyring
Agent runtime Python sidecar with Strands Agents (DeepSeek, Zhipu, Qwen, Moonshot, Doubao, Ollama, custom OpenAI-compatible endpoints)
Knowledge SQLite FTS5 + sqlite-vec (512-dim) + RRF

Installation (Windows x64)

The shipping artifact is a Windows x64 NSIS installer (per-user install, no administrator rights required).

  1. Download TDSF.Terminal.Agent_<version>_x64-setup.exe from Releases and find its SHA-256 in the corresponding release notes.

  2. Verify the checksum before running it:

    Get-FileHash '.\TDSF.Terminal.Agent_<version>_x64-setup.exe' -Algorithm SHA256
    
  3. Run the installer. It fetches the Microsoft WebView2 bootstrapper only when WebView2 is missing.

  4. Open Settings → Models, add an API key for a model provider, then create a workspace (local, WSL or SSH).

The installer is not Authenticode-signed yet, so SmartScreen may show an unknown-publisher warning on first run; verify the SHA-256 checksum before continuing.

Automatic updates

From 0.9.0 an installed release discovers new versions on its own:

  • One check about 8 seconds after start-up, then at most once per day. The check only retrieves the release manifest from GitHub and uploads no local data.
  • When an update exists, a chip appears in the status bar. No modal dialog interrupts you.
  • Downloading and installing both need an explicit click, and the dialog states the package size first (it is a full installer, not a delta).
  • Update packages are minisign-signed and verified before installation; the private signing key is not shipped with the installer.
  • Installation is refused while an approval is waiting or a turn is still running, and your session is left untouched. A normal install closes things down in order: cancel the turn → disconnect this window's SSH sessions → close terminals → stop language servers → stop the sidecar.

Development

The development setup uses Node.js 24, as in CI, and the pinned pnpm 11.24.0. Use Rust 1.90 or later and Python 3.11 or later. The sidecar Python range is in src-tauri/sidecar/pyproject.toml and the agent runtime pin is in src-tauri/sidecar/STRANDS_RUNTIME_VERSION.

pnpm install --frozen-lockfile
pnpm tauri:dev

On Windows you can also double-click 启动.bat in the repository root. The development build uses a different application identifier and data directory, so it never overwrites released settings or sessions.

Command Purpose
pnpm typecheck / pnpm lint Type and static checks
pnpm test Frontend unit tests (vitest)
pnpm test:python Sidecar tests (pytest: agent, tools, safety policy, knowledge)
cargo test (in src-tauri/) Rust side: PTY / SSH / filesystem / system boundaries
pnpm probe:ui Real-window UI gate: control hit areas, clipping and alignment measured over CDP
pnpm probe:dialog / probe:ssh / probe:ipc Dialog geometry, SSH session reaping, IPC method allowlist
pnpm check:release-version Verifies the five version declarations match
pnpm build:win Version check → sidecar packaging and smoke test → NSIS installer

Release flow: push a v* tag → CI builds the signed installer and update manifest into a draft release → you verify, then publish. The manifest only resolves published releases, so clients cannot see it before you click publish.

Repository layout

src/                React frontend (modules/ by feature: ai, terminal, ssh, explorer, editor…)
src-tauri/
  src/              Rust shell: pty / ssh / sftp / tunnel / lsp / sidecar supervisor
  sidecar/          Python agent runtime (strands_backend/ + tools/ + knowledge/)
  sidecar/tests/    pytest suite
  capabilities/     Tauri permission sets
  tauri.*.conf.json release / dev / per-platform configuration
scripts/            build and data-generation scripts; probe/ holds the real-window gates
website/            promo page (deployed to GitHub Pages)
assets/             logo sources and the README screenshot banner
.github/workflows/  CI (frontend / Python / Rust on three platforms) · release · Pages

Promo site maintenance

Live: https://harryopo.github.io/tdsf-terminal-agent/ (English: /en/).

  • Source location: the website/ directory at the repository root — part of this repository, unrelated to src/ or src-tauri/.
    • index.html — Chinese home page (/)
    • en/index.html — English home page (/en/)
    • style.css, script.js — shared by both pages
    • assets/ — logo, hero product shot product-hero.png, demo video video/demo.mp4 and its poster video/poster.png
  • Deployment: .github/workflows/pages.yml uploads the whole website/ directory to GitHub Pages on a push to main that touches website/** — there is no build step. The repository's Settings → Pages source must be "GitHub Actions". Changes usually go live within 1–3 minutes (CDN cache).
  • Local preview: open website/index.html directly (relative paths work), or run npx serve website and visit / and /en/.
  • What triggers a deploy: only files under website/. Changes to src/ or src-tauri/ never affect the promo page.
  • Asset requirements: hero shot around 2178×1340; the demo video must be encoded with -movflags +faststart (otherwise browsers wait for the whole file before playing); crop the poster to 16:9.
  • Keep both languages in sync: the two pages are structurally identical — update them together.
  • Note: if you have several worktrees or branches, the website/ inside them may not be what is live. Trust main; verify with git show origin/main:website/index.html.

Privacy and data

Network uses include your configured model service, SSH hosts you add, GitHub update checks and downloads, and the WebView2 bootstrapper when needed. Webpage previews and user-initiated knowledge imports or crawling also access selected websites or sources; see PRIVACY.md.

Conversations, workspace configuration and the knowledge base stay in the local data directory. Your model provider can receive the conversation, the selected workspace context and the tool results needed to answer — review terminal output and attachments before sending sensitive information to a cloud model. See PRIVACY.md for details.

Uninstalling does not delete workspaces, skills or application data you created; remove those directories and saved credentials manually when a complete local reset is required.

License and origin

TDSF builds on the open-source Terax AI v0.8.6 terminal and adds SSH workspaces, an operations agent with visible execution, and a Linux teaching workflow. The project is licensed under Apache-2.0. Terax AI v0.8.6 · NOTICE · LICENSE

Explore related projects

Loading…