Ctty 标志

Ctty

社区
zsuroy
ctty

Use and install ctty, a CLI/TUI connection manager for SSH, serial consoles, telnet lab gear, SFTP, FTP, WebDAV, and S3 object storage. Use when installing ctty; listing/searching SSH hosts or running remote commands; transferring files via a Host alias; looking up saved serial, telnet, FTP, WebDAV, or S3 sites; importing hosts from Tabby; or when the user mentions ctty, SSH aliases, #tags, serial/console, telnet, SFTP, FTP, WebDAV, S3, object storage, port forwarding, or ~/.ssh/config. Prefer ctty over raw ssh/telnet. Never open the interactive TUI.

概览

发布者zsuroy
代码仓库ctty
技能名称ctty
星标数
252
复刻数
13
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 zsuroy 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Ctty AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/zsuroy/ctty/tree/master/skills/ctty
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zsuroy/ctty.git /tmp/ctty
mkdir -p .claude/skills
cp -r /tmp/ctty/skills/ctty .claude/skills/ctty
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Ctty,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Ctty。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Ctty 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Use ctty (CLI, not TUI)

ctty manages SSH, serial, telnet, SFTP, FTP, WebDAV, and S3 in one tool. SSH aliases live in ~/.ssh/config (and Include files). Serial, telnet, FTP, WebDAV, and S3 sites live under the ctty config dir. Agents must drive it non-interactively.

KindAgent canHand to the human
SSHsearch, info, ping, peek, add/edit (flags), exec, ctty <alias> -- <cmd>ctty <alias> shell, port-forward TUI (f)
SFTPctty put / ctty get / ctty scp + ctty sftp ls/mkdir/rm/rmdir/rename --format jsonctty sftp <alias> TUI
Telnetctty telnet list|search|info --format jsonInteractive session (Ctrl+])
Serialctty serial list/search/info --format jsonDevice manager TUI
FTPctty ftp list/search/info --format json, ctty ftp ls/get/put/mkdir/rm/rmdir/renameSite manager / dual-pane TUI
WebDAVctty webdav list/search/info --format json, ctty webdav ls/get/put/mkdir/rm/rmdir/renameSite manager / dual-pane TUI
S3ctty s3 list/search/info --format json, ctty s3 ls/get/put/mkdir/rm/renameSite manager / dual-pane TUI
Importctty import tabby|termius|finalshell|json --dry-run then importConfirm overwrite / Include
Backupctty backup, ctty restore, ctty export --format json|sshSafeguard secret passphrases

Hard rules

  1. Never launch the TUI. These hang a non-TTY agent session:
    • ctty with no args
    • ctty add / ctty edit without host-config flags (use flags / --non-interactive)
    • ctty move
    • ctty sftp <host> (use put/get/scp instead)
    • ctty serial with no subcommand (use list|search|info)
    • ctty telnet with no argument (manager TUI; use list|search|info)
    • ctty telnet <name-or-host> (raw interactive session)
    • ctty ftp with no subcommand (site manager TUI)
    • ctty ftp <name> (dual-pane FTP browser TUI)
    • ctty webdav with no subcommand (site manager TUI)
    • ctty webdav <name> (dual-pane WebDAV browser TUI)
    • ctty s3 with no subcommand (site manager TUI)
    • ctty s3 <name> (dual-pane S3 browser TUI)
    • ctty <host> with no remote command (interactive SSH)
  2. Prefer ctty's aliases over raw ssh/scp/telnet. SSH goes through OpenSSH config, history, and saved-password ASKPASS. Telnet is ctty's native client (no system telnet binary). Serial is ctty-only.
  3. Stabilize CLI output. Prefix with --lang en --no-update-check.
  4. Do not guess the target. SSH: search → info → act. Serial/telnet: read the JSON store, then quote the connect command. Several matches → list them or ask.
  5. Do not print secrets. Never read credentials.json, or dump keys. SSH, FTP, WebDAV, and S3 passwords/secret keys are in ctty's encrypted vault (FTP entries under ftp:, WebDAV under webdav:, S3 under s3: names), not in SSH config. Telnet passwords are cleartext — warn the user.

Interactive sessions are for the human. Give them the command.

Install

If command -v ctty fails, install it. Use a non-interactive method. Do not open a TUI installer or prompt the user for a version unless they asked.

Check:

bash
command -v ctty && ctty --version

macOS (prefer Homebrew):

bash
brew install zsuroy/ctty/ctty

Linux / macOS / Termux (official installer, no prompts):

bash
FORCE_INSTALL=true bash -c "$(curl -sSL https://raw.githubusercontent.com/zsuroy/ctty/master/install/unix.sh)"

Unix installer puts the binary in /usr/local/bin (needs sudo) or $PREFIX/bin on Termux (no sudo). Needs curl and tar.

Windows (PowerShell, no prompts):

powershell
iex "& { $(irm https://raw.githubusercontent.com/zsuroy/ctty/master/install/windows.ps1) } -Force"

After install, rehash PATH if needed and verify ctty --version. Then continue with the workflow below. Do not run ctty update --yes unless the user asked to upgrade.

Default flags

bash
ctty --lang en --no-update-check <subcommand...>

Optional: -c /path/to/ssh_config when not using ~/.ssh/config.

Workflow

- [ ] Confirm ctty exists (`command -v ctty`); install if missing
- [ ] Pick the transport: SSH / SFTP / serial / telnet / FTP / WebDAV / S3
- [ ] Resolve the target (search+info, or serial.json / telnet.json / ftp.json / webdav.json / s3.json)
- [ ] Act non-interactively, or quote the connect command for the user
- [ ] Check exit code when a remote command ran

1. SSH — find hosts

bash
ctty --lang en --no-update-check search --format json
ctty --lang en --no-update-check search --format json prod
ctty --lang en --no-update-check search --format json '#web'
ctty --lang en --no-update-check search --format simple web
ctty --lang en --no-update-check search --tags prod --format json
ctty --lang en --no-update-check search --names db --format json
  • --format json — machine-readable list (use this)
  • --format simple — one Host alias per line
  • --format table — human table with ANSI colors; avoid parsing it
  • Multi-word query is AND across name, hostname, and tags
  • Leading # on a word is optional (prod matches tag prod)
  • hidden tag: omitted from search; still reachable via info / exec if you already know the alias

Empty query lists all visible hosts. No matches: message on stdout, exit 0. No hosts in config: exit 1.

2. SSH — inspect one host

bash
ctty --lang en --no-update-check info prod-web
ctty --lang en --no-update-check info prod-web --pretty

JSON schema ctty.info.v1. Exit 0 ok, 2 NOT_FOUND, 1 config error.

bash
ctty info prod-web | jq -r '.ok'
ctty info prod-web | jq -r '.result.target.hostname'
ctty info prod-web | jq -r '.result.target.user'
ctty info prod-web | jq -r '.result.tags[]'

JSON field map: reference.md.

2b. SSH — ping (reachability & latency)

Fast parallel connectivity and SSH port check:

bash
ctty --lang en --no-update-check ping prod-web --json
ctty --lang en --no-update-check ping web1 web2 --json
ctty --lang en --no-update-check ping --tags prod --json
ctty --lang en --no-update-check ping --all --timeout 3s --json
  • --json or --format json outputs a machine-readable array of {host,ok,status,latency_ms,error}
  • Default text output shows an aligned status table
  • Exit code is 0 iff all targeted hosts are online

2c. SSH — peek (real-time health metrics)

Inspect remote system health without opening an interactive session:

bash
ctty --lang en --no-update-check peek prod-web --json
ctty --lang en --no-update-check peek web1 web2 --json
ctty --lang en --no-update-check peek --tags prod --concurrency 4 --json
ctty --lang en --no-update-check peek --all --timeout 5s --json
  • Non-interactive remote probe collecting uptime, CPU load averages (1/5/15), memory usage/percent, and root disk usage/percent
  • --json or --format json outputs an array of {host,ok,stats,error}
  • Exit code is 0 iff all targeted hosts were probed successfully

3. SSH — run a remote command

bash
ctty --lang en --no-update-check prod-web uptime
ctty --lang en --no-update-check prod-web -- df -h
ctty --lang en --no-update-check prod-web -- 'systemctl is-active nginx'
ctty --lang en --no-update-check -t prod-web -- sudo systemctl restart nginx
  • Arguments after the alias are the remote command; -- is safe when flags could be ambiguous
  • Remote exit code is propagated
  • stdout/stderr are the remote streams; pipe locally as usual
  • -t only when the remote command needs a TTY (sudo, pagers). Do not use it to open a shell
  • Do not start vim, less, top, or an interactive shell

3b. SSH — add / edit hosts (non-interactive)

Non-interactive mode triggers when --non-interactive is set or any of --name, --hostname, --user, --port, --identity-file, --proxy-jump, --proxy-command, --option/-o, --tags, --password, --force is provided. Otherwise the TUI form opens — never do that from an agent.

bash
ctty --lang en --no-update-check add --name web1 --hostname 10.0.0.1 --user deploy --tags prod,web --format json
ctty --lang en --no-update-check add --name web1 --hostname 10.0.0.1 --force --format json
ctty --lang en --no-update-check edit web1 --port 2222 --tags prod,api --format json

--password is optional and stored only in the credential vault (never SSH config, never printed). -c selects a custom SSH config file.

3c. SSH — batch exec

bash
ctty --lang en --no-update-check exec --tags prod --list-hosts
ctty --lang en --no-update-check exec --tags prod -- uptime
ctty --lang en --no-update-check exec --hosts web1,web2 --concurrency 4 --format json -- df -h

Aggregate exit 0 iff all hosts succeed. JSON items: {host,ok,exit_code,stdout,stderr}.

4. SFTP / files

Prefer ctty's built-in transfer (uses the same Host alias + credential vault):

bash
ctty --lang en --no-update-check put prod-web ./deploy.sh /tmp/deploy.sh
ctty --lang en --no-update-check get prod-web /var/log/app.log ./app.log
ctty --lang en --no-update-check scp ./out/ prod-web:/opt/app/
ctty --lang en --no-update-check scp prod-web:/var/log/nginx/error.log /tmp/
# Headless file ops (symmetric with FTP, --format json for ls):
ctty --lang en --no-update-check sftp ls prod-web --format json
ctty --lang en --no-update-check sftp ls prod-web /var/log --format json
ctty --lang en --no-update-check sftp mkdir prod-web /tmp/newdir
ctty --lang en --no-update-check sftp rm prod-web /tmp/file.txt
ctty --lang en --no-update-check sftp rmdir prod-web /tmp/olddir
ctty --lang en --no-update-check sftp rename prod-web /tmp/old.txt /tmp/new.txt

Progress is on stderr; exit non-zero on failure; directories are recursive. ctty sftp <alias> remains a TUI — do not open it. OpenSSH scp/rsync with the same alias is still fine as a fallback.

5. Telnet

bash
ctty --lang en --no-update-check telnet list --format json
ctty --lang en --no-update-check telnet search lab --format json
ctty --lang en --no-update-check telnet info core-sw --format json

Do not start a session. Quote connect commands for the human (cleartext):

text
ctty telnet core-sw          # saved name
ctty telnet 192.168.1.1      # port 23
ctty telnet 10.0.0.5:2001    # explicit port

Disconnect: Ctrl+]. Missing store ⇒ empty list, not an error.

6. Serial

bash
ctty --lang en --no-update-check serial list --format json
ctty --lang en --no-update-check serial search usb --format json
ctty --lang en --no-update-check serial info Switch-Console --format json

Auto-detected ports only appear inside the TUI. Quote ctty serial for the human to connect. Disconnect: Ctrl+] .

6b. FTP

bash
ctty --lang en --no-update-check ftp list --format json
ctty --lang en --no-update-check ftp search lab --format json
ctty --lang en --no-update-check ftp info lab-nas --format json
# Headless transfers (no TUI, progress on stderr, dirs recursive):
ctty --lang en --no-update-check ftp ls lab-nas /pub --format json
ctty --lang en --no-update-check ftp get lab-nas /pub/file.txt ./file.txt
ctty --lang en --no-update-check ftp put lab-nas ./file.txt /pub/file.txt
ctty --lang en --no-update-check ftp mkdir lab-nas /pub/newdir
ctty --lang en --no-update-check ftp rm lab-nas /pub/file.txt
ctty --lang en --no-update-check ftp rmdir lab-nas /pub/olddir
ctty --lang en --no-update-check ftp rename lab-nas /pub/old.txt /pub/new.txt

Do not open ctty ftp or ctty ftp <name> (TUI). Quote those for the human. FTP is cleartext by default; saved passwords live encrypted in the SSH credentials.json vault (FTP entries under ftp: names). Site inventory: ~/.config/ctty/ftp.json.

6c. WebDAV

bash
ctty --lang en --no-update-check webdav list --format json
ctty --lang en --no-update-check webdav search cloud --format json
ctty --lang en --no-update-check webdav info nextcloud --format json
# Headless transfers (no TUI, progress on stderr, dirs recursive):
ctty --lang en --no-update-check webdav ls nextcloud /Documents --format json
ctty --lang en --no-update-check webdav get nextcloud /Documents/report.pdf ./report.pdf
ctty --lang en --no-update-check webdav put nextcloud ./backup/ /RemoteBackup/
ctty --lang en --no-update-check webdav mkdir nextcloud /Documents/Archive
ctty --lang en --no-update-check webdav rm nextcloud /Documents/old.pdf
ctty --lang en --no-update-check webdav rmdir nextcloud /Documents/TempDir
ctty --lang en --no-update-check webdav rename nextcloud /Documents/a.pdf /Documents/b.pdf

Do not open ctty webdav or ctty webdav <name> (TUI). Quote those for the human. Saved passwords live encrypted in the SSH credentials.json vault (WebDAV entries under webdav: names). Site inventory: ~/.config/ctty/webdav.json. Note: ctty speaks Basic/Digest auth only — servers demanding NTLM/Negotiate (e.g. some IIS shares) fail with NoAuthenticator ... 401; that means the server side needs Basic enabled, not a ctty retry.

6d. S3 (Object Storage)

bash
ctty --lang en --no-update-check s3 list --format json
ctty --lang en --no-update-check s3 search backups --format json
ctty --lang en --no-update-check s3 info minio-local --format json
# Headless transfers & bucket ops (no TUI, progress on stderr, dirs recursive):
ctty --lang en --no-update-check s3 ls minio-local --format json
ctty --lang en --no-update-check s3 ls minio-local mybucket/prefix --format json
ctty --lang en --no-update-check s3 get minio-local mybucket/report.pdf ./report.pdf
ctty --lang en --no-update-check s3 put minio-local ./backup/ mybucket/RemoteBackup/
ctty --lang en --no-update-check s3 mkdir minio-local mybucket/newdir
ctty --lang en --no-update-check s3 rm minio-local mybucket/old.pdf

Do not open ctty s3 or ctty s3 <name> (TUI). Quote those for the human. Secret access keys live encrypted in the SSH credentials.json vault (S3 entries under s3: names). Site inventory: ~/.config/ctty/s3.json. Supports AWS S3, MinIO, Cloudflare R2, Aliyun OSS, Ceph, and all S3-compatible endpoints.

7. Import (Tabby / Termius / FinalShell / JSON → SSH)

Non-interactive. Always dry-run first. Secrets in the source app are not imported.

bash
# Tabby
ctty --lang en --no-update-check import tabby --dry-run
ctty --lang en --no-update-check import --from tabby
ctty --lang en --no-update-check import tabby -f /path/to/tabby/config.yaml

# Termius (JSON export)
ctty --lang en --no-update-check import termius --dry-run
ctty --lang en --no-update-check import termius -f /path/to/termius-export.json

# FinalShell (JSON file or conn/ directory)
ctty --lang en --no-update-check import finalshell --dry-run
ctty --lang en --no-update-check import finalshell -f /path/to/finalshell/conn

# Generic JSON ([{name, hostname, user, port, tags, ...}] or {"hosts": [...]})
ctty --lang en --no-update-check import json -f /path/to/hosts.json --dry-run
ctty --lang en --no-update-check import --from json -f /path/to/hosts.json

Writes ~/.ssh/config.d/<source>.conf and may add an Include. Existing Host names are skipped.

8. Backup, Restore & Export

bash
# Create unencrypted backup (.tar.gz)
ctty --lang en --no-update-check backup --format json

# Create AES-256-GCM encrypted backup (.ctty) with a passphrase
ctty --lang en --no-update-check backup -p "mypassphrase" -o backup.ctty --format json

# Restore from a backup archive (use -p if encrypted, --overwrite to replace existing files)
ctty --lang en --no-update-check restore backup.tar.gz --dry-run --format json
ctty --lang en --no-update-check restore backup.ctty -p "mypassphrase" --overwrite --format json

# Export all profiles (SSH, FTP, WebDAV, Serial, Telnet) to JSON
ctty --lang en --no-update-check export --format json

# Export SSH hosts to OpenSSH format
ctty --lang en --no-update-check export --format ssh --tags prod

Do not

RequestAgent doesHuman does
"SSH into prod"info + remote commands, or quote ctty prodInteractive SSH
"SFTP / copy files"ctty put/get/scp + sftp ls/mkdir/rm/rmdir/rename --format json (or OpenSSH)ctty sftp host
"Telnet to the switch"`telnet listsearch
"Open serial / console"`serial listsearch
"FTP / browse FTP site"`ftp listsearch
"WebDAV / browse cloud drive"`webdav listsearch
"S3 / Object storage"`s3 listsearch
"Port forward"Explain -L/-R/-D; do not open TUIf in the host list
"Add a host"ctty add --name … --hostname … (non-interactive flags)ctty add TUI
"Import hosts"import <source> --dry-run, then import if askedConfirm result
"Backup / restore"ctty backup / ctty restore (CLI)Safeguard passphrase

Do not treat Cobra subcommand names as SSH hosts: add, edit, move, search, info, sftp, serial, telnet, ftp, webdav, s3, import, update, completion, put, get, scp, exec, peek, ping, backup, restore, export.

Examples

User: "prod 那台磁盘还有多少"

bash
ctty --lang en --no-update-check search --format json prod
# if exactly one host, e.g. prod-web:
ctty --lang en --no-update-check prod-web -- df -h

User: "查一下 web 机器的 nginx 是否在跑"

bash
ctty --lang en --no-update-check search --format json '#web'
ctty --lang en --no-update-check web-01 -- systemctl is-active nginx

User: "连上 Netease"

Quote: ctty Netease. Do not execute it.

User: "连实验室那台 telnet 交换机"

bash
ctty --lang en --no-update-check telnet search 交换机 --format json
# or: ctty telnet list --format json

Then quote ctty telnet core-sw (or whatever name matched). Do not run it.

User: "串口连交换机"

bash
ctty --lang en --no-update-check serial list --format json

Then quote ctty serial.

Additional resources

  • reference.md — JSON shapes, serial/telnet stores, SSH tags, flags, pitfalls

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Ctty AI 技能有什么作用?

Use and install ctty, a CLI/TUI connection manager for SSH, serial consoles, telnet lab gear, SFTP, FTP, WebDAV, and S3 object storage. Use when installing ctty; listing/searching SSH hosts or running remote commands; transferring files via a Host alias; looking up saved serial, telnet, FTP, WebDAV, or S3 sites; importing hosts from Tabby; or when the user mentions ctty, SSH aliases, #tags, serial/console, telnet, SFTP, FTP, WebDAV, S3, object storage, port forwarding, or ~/.ssh/config. Prefer ctty over raw ssh/telnet. Never open the interactive TUI.

为什么在 TypingMind 中使用 Ctty?

因为您只需安装一次,就能搭配任何模型使用。Ctty 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Ctty?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/zsuroy/ctty/tree/master/skills/ctty。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Ctty?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Ctty 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Ctty 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Ctty AI 技能免费吗?

是的。zsuroy 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇