Files
mytoolkit/README.md
T
Zhengshou Lai 00c608a3bd feat: add interactive config wizard
- Add mycli wizard command for guided configuration
- Interactive menus for paths, SSH, API keys, Feishu apps, git proxies
- User-friendly prompts with numbered choices
- Support add/edit/delete operations via wizard
- Hide sensitive input (API keys, secrets)
- Confirm before destructive operations
2026-04-13 11:53:27 +08:00

134 lines
3.8 KiB
Markdown

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