pku-treehole 0.1.4

北大树洞 CLI 客户端
Documentation

pku-treehole

A command-line client for PKU Treehole (北大树洞) anonymous forum.

crates.io License

Full-featured CLI for browsing, posting, searching, and interacting with the PKU Treehole anonymous forum. Also provides access to your grades, schedule, and academic calendar.

Install

cargo install pku-treehole

Or install the complete PKU toolkit:

cargo install pku-cli

Setup

Store your IAAA credentials once (encrypted in your OS keychain):

cargo install pku-auth
info-auth store

Then login:

treehole login -p

[!NOTE] First-time login may require SMS verification. Set PKU_SMS_CODE=123456 as an environment variable if running non-interactively, or enter it when prompted.

Usage

Browse & Search

treehole list                    # Latest posts (supports --page, -n)
treehole list follow             # Posts you follow
treehole show 12345              # View a post with replies
treehole search "关键词"          # Full-text search
treehole search "#12345"         # Search by post ID

Post & Interact

treehole post -t "Hello world"         # Create a post
treehole post -t "..." --tag 1,2       # With tags
treehole post -t "..." -i image.jpg    # With an image
treehole post -t "..." --reward 5      # Reward 5 树叶 (tree leaves)

treehole reply 12345 -t "Nice post!"   # Reply to a post
treehole like 12345                    # Upvote
treehole star 12345                    # Bookmark
treehole stars                         # List bookmarks

Messages & Profile

treehole msg                     # Notifications
treehole read 1 2 3              # Mark messages as read
treehole me                      # Your profile
treehole me --posts              # Your posts

Academic Info

treehole score                   # View your grades
treehole score -s 25-26-1        # Specific semester
treehole course                  # Weekly course schedule
treehole schedule                # This week's agenda
treehole academic-cal            # Academic calendar

TOTP (手机令牌)

treehole otp bind                # Bind mobile token (interactive, needs SMS)
treehole otp show                # Display current OTP code
treehole otp clear               # Remove saved OTP config

Links