Files
mytoolkit/README.md
T
Zhengshou Lai c1df4098b3 refactor: rename package from mytoolkit to bin
- Move all source files from mytoolkit/ to bin/
- Update entry point and build config in pyproject.toml
- Add pillow and pypdf dependencies
- Update README and .gitignore paths
- Remove unused subprocess import in pdf.py
- Clean up duplicate imports in pdf merge command
2026-04-26 09:56:29 +08:00

135 lines
4.1 KiB
Markdown

# MyCLI
Personal CLI toolkit - unified interface for various utility scripts.
## Installation
```bash
make install
```
## Commands
```bash
mytoolkit --help
# PDF utilities
mytoolkit pdf compress *.pdf
mytoolkit pdf crop *.pdf
mytoolkit pdf to-tiff *.pdf
# Image utilities
mytoolkit image eps-to-pdf *.eps
mytoolkit image jpg-to-pdf *.jpg -o output.pdf
mytoolkit image tiff-to-pdf *.tiff
mytoolkit image tiff-compress *.tiff
# LaTeX utilities
mytoolkit latex compile *.tex
mytoolkit latex count document.tex
# Video utilities
mytoolkit video avi-to-mp4 *.avi
# BibTeX utilities
mytoolkit bib to-markdown *.bib
mytoolkit bib cv-update
# Utilities
mytoolkit utils albany-cleanup
# Environment & Navigation
mytoolkit env list # List configured paths
mytoolkit env goto research # Print path for cd
mytoolkit env cd apaam # Start shell in path
mytoolkit env status # Show environment status
cd $(mytoolkit env goto study) # Use in scripts
# SSH Connections
mytoolkit ssh list # List configured hosts
mytoolkit ssh connect tianhe # SSH to host
mytoolkit ssh connect starlight
mytoolkit ssh tunnel tianhe # Create port tunnel
mytoolkit ssh cmd tianhe "ls" # Run remote command
# Git Proxy Management
# Git Proxy Management
mytoolkit git proxy status # Show proxy status
mytoolkit git proxy set fastgithub # Set proxy
mytoolkit git proxy set pandafan
mytoolkit git proxy unset # Unset proxy
mytoolkit git proxy list # List available proxies
# Self Management
mytoolkit self update # Update mytoolkit
mytoolkit self uninstall # Uninstall mytoolkit
mytoolkit self info # Show installation info
# Configuration (config.json) - 增删改查
# 方式1: 交互式向导(推荐,无需记忆命令)
mytoolkit wizard # 启动交互式配置向导
# 方式2: 命令行直接操作
mytoolkit config show # Show full config
mytoolkit config list # List top-level sections
mytoolkit config get paths # Get paths section
mytoolkit config get paths.apaam # Get specific path
mytoolkit config get api_keys.deepseek # Get API key
mytoolkit config set paths.new ~/Documents/new # Set simple value
mytoolkit config set api_keys.newkey abc123 # Set new API key
mytoolkit config set --json ssh_hosts.new '{"host":"user@host","port":22}'
mytoolkit config delete paths.old # Delete a key
mytoolkit config delete api_keys.old -y # Delete without confirmation
mytoolkit config paths # List all paths with existence check
mytoolkit config where # Show config file location
mytoolkit config edit # Edit config in $EDITOR
mytoolkit config init # Create config from template
# Environment Variables (API Keys)
mytoolkit env status # Show paths, API keys, Feishu status
mytoolkit env export # Print all export statements
mytoolkit env export deepseek # Export specific API key
mytoolkit env export qwen
mytoolkit env export feishu # Export all Feishu apps
mytoolkit env export claude # Export specific Feishu app
eval "$(mytoolkit env export)" # Load all in current shell
mytoolkit env init # Print shell init snippet
```
## Configuration
All settings are stored in `bin/config.json`:
- `paths`: Quick navigation paths
- `ssh_hosts`: SSH connection settings
- `git_proxies`: Git proxy URLs
- `openfoam`: OpenFOAM mount settings
- `api_keys`: API keys (deepseek, qwen)
- `feishu_apps`: Feishu app credentials
### Security Note
`config.json` contains sensitive information (API keys) and is **gitignored**.
The repository includes `config.json.example` as a template.
### Setup
1. Copy the example config:
```bash
cp bin/config.json.example bin/config.json
```
2. Edit with your actual API keys:
```bash
mytoolkit config edit
```
3. Add to your `~/.zshrc` to auto-load:
```bash
eval "$(mytoolkit env export 2>/dev/null)"
```
## Uninstall
```bash
make uninstall
```