FDU Hole (树洞) terminal client — TUI, CLI, and telnet server all in one.
- TUI — full interactive terminal UI with image rendering, search, settings
- CLI — all operations available as commands, with
--jsonfor agent/programmatic use - Serve — telnet server that exposes the TUI over the network
- WebVPN — UIS login for WebVPN access to forum authentication, posts, and images
cargo build --release
# binary at target/release/danta-clidanta login -e <email> -p <password>To access the forum through Fudan WebVPN, first log in with your UIS account:
danta webvpn login -u <UIS_ID> # prompts for the UIS password without echoing it
danta webvpn status # verifies the saved session and forum gateway
danta login -e <email> -p <password> # only needed if not already logged into FDU Hole
danta # prefers direct access, falls back to saved WebVPNUIS authenticates the WebVPN connection; your FDU Hole email/password still authenticates your forum account. With a saved WebVPN session, the CLI and TUI probe direct access briefly at startup. If the probe fails, they use WebVPN for forum authentication, content, and supported images. A direct connection failure can switch later requests in the same process to WebVPN. Requests are not replayed automatically after a connection failure. Restart an already-running TUI after logging in or removing the WebVPN session.
Use danta --connection webvpn status to test the forum over WebVPN, or
danta --connection direct status to force direct access. danta webvpn status
always checks the saved WebVPN session independently of the routing preference.
The client saves WebVPN session cookies and keeps them updated when the gateway
rotates them. It does not save the UIS password. webvpn.json lives next to token.json
in ~/Library/Application Support/danta-cli/ on macOS and in
$XDG_CONFIG_HOME/danta-cli/ or ~/.config/danta-cli/ on Linux. On Unix, the file is
readable and writable only by its owner. If WebVPN requires renewed authentication,
run danta webvpn login -u <UIS_ID> again.
For automation, danta webvpn login -u <UIS_ID> --password-stdin reads the password
from the first line of standard input. Supply it from your secret manager or another
private input source; there is no UIS password command-line argument.
danta webvpn logout # removes the local WebVPN session and restores direct accessThis removes this client's saved session only; it does not sign out other browser sessions. CAPTCHA and additional verification cannot currently be completed by the CLI; use the university WebVPN in a browser when these challenges are required. Browser sign-in does not transfer its session into this CLI. Weak-password and maintenance responses also stop login; resolve those conditions before retrying.
The authentication and routing protocol follows the Flutter
DanXi main repository at commit
3c1f5f026fbc7ca50e151865f813cdb381807abe:
identity login
and WebVPN routing.
It supports the current id.fudan.edu.cn password and ticket flow, with a legacy
UIS form fallback. Interactive browser verification is not embedded in this CLI.
danta # or
danta tuiKeybindings:
j/k— navigate up/downEnter— open holen— new postr— reply (in hole detail)/— searchTab— switch divisionm— messages,— settingsq— back / quit
danta holes # list holes
danta view 12345 # view hole and floors
danta post "hello" -d 1 -t "tag" # create post
danta reply 12345 "content" # reply to hole
danta search "keyword" # search
danta me # user infoAll commands support --json for machine-readable output:
danta --json holes -l 5
danta --json view 12345
danta --json meFull command list: danta --help
Expose the TUI over TCP so other machines can connect:
danta serve # localhost:2323
danta serve -p 8080 # custom port
danta serve -b 0.0.0.0 -p 2323 # listen on all interfacesConnect from another machine:
stty raw -echo; nc <host> 2323; stty sane
# or
socat TCP:<host>:2323 STDIO,raw,echo=0Each connection spawns an isolated TUI session via PTY.
Settings are stored at ~/.config/danta-cli/config.toml. Editable in-app via , key in TUI.
Options: border style, sort order, floors per page, image protocol (Kitty/iTerm2/Sixel/auto), thumbnail mode, and more.
MIT