Nhà phát triển
CLI
Trình khách command-line cho nền tảng S.EE
Một trình khách command-line cho nền tảng S.EE, cho phép bạn tạo và quản lý URL ngắn, đoạn văn bản và tệp trực tiếp từ terminal.
Tính năng
- Quản lý URL ngắn: Tạo, cập nhật và xóa liên kết rút gọn với slug tùy chỉnh, tên miền và thời gian hết hạn
- Đoạn văn bản: Chia sẻ đoạn mã và ghi chú từ stdin hoặc tệp
- Tải tệp lên: Tải tệp lên trực tiếp hoặc qua stdin
- Quản lý tên miền và thẻ: Liệt kê tên miền khả dụng và quản lý thẻ
- Bảo vệ bằng mật khẩu: Bảo vệ nội dung bằng mật khẩu
- Đầu ra JSON: Đầu ra có thể đọc bằng máy để viết script
Cài đặt
macOS
brew tap sdotee/homebrew-tap
brew install seeDebian / Ubuntu
dpkg -i see-cli_<version>_<arch>.debRHEL / Fedora
rpm -i see-cli_<version>_linux_<arch>.rpmArch Linux
yay -S see-cli
# or pre-built binary
yay -S see-cli-binTừ source
go install github.com/sdotee/cli@latestTải các binary và package dựng sẵn từ GitHub Releases.
Cấu hình
Đặt khóa API của bạn qua environment variable hoặc flag:
# Environment variable (recommended)
export SEE_API_KEY="your-api-key"
# Or use the flag
see --api-key "your-api-key" <command>Tùy chọn cấu hình
| Option | Environment Variable | Description |
|---|---|---|
--api-key | SEE_API_KEY | khóa API S.EE của bạn (bắt buộc) |
--base-url | SEE_BASE_URL | URL cơ sở API tùy chỉnh |
--timeout | SEE_TIMEOUT | Thời gian chờ yêu cầu |
--json | - | Bật định dạng đầu ra JSON |
Lệnh
Tên miền và thẻ
# List available domains for short URLs
see domains
# List available domains for file uploads
see file domains
# List your tags
see tagsURL ngắn
# Tạo a short URL
see url create https://example.com
# Tạo with custom options
see url create https://example.com \
--slug my-link \
--domain s.ee \
--title "My Link" \
--password secret \
--expires 2024-12-31
# Update a short URL
see url update --domain s.ee --slug my-link --title "New Title"
# Xóa URL rút gọn
see url delete --domain s.ee --slug my-linkĐoạn văn bản
# Tạo text from stdin
echo "Hello World" | see text create --title "greeting"
# Tạo text from file
see text create --file ./snippet.txt --title "Code Snippet"
# Tạo with options
cat script.sh | see text create \
--title "Shell Script" \
--domain fs.to \
--password secret \
--expires 2024-12-31
# Cập nhật văn bản
see text update --domain fs.to --slug abc123 --title "Updated Title"
# Xóa văn bản
see text delete --domain fs.to --slug abc123Tải tệp lên
# Tải tệp lên
see file upload ./image.png
# Tải lên với tên miền tùy chỉnh
see file upload ./document.pdf --domain fs.to
# Tải lên từ stdin
cat image.png | see file upload --stdin --filename image.png
# Xóa tệp
see file delete <delete-hash>Đầu ra JSON
Dùng flag --json để lấy đầu ra có thể đọc bởi máy, hữu ích cho scripting:
see url create https://example.com --json | jq '.short_url'Ví dụ
Tạo URL ngắn và sao chép vào clipboard (macOS)
see url create https://example.com --json | jq -r '.short_url' | pbcopyTải ảnh chụp màn hình lên và lấy URL (Linux)
see file upload ~/screenshot.png --json | jq -r '.url'Tạo URL ngắn hàng loạt
while read url; do
see url create "$url" --json
done < urls.txt