- Add api_keys and feishu_apps to config.json - Add env export/init commands for shell integration - Add config CRUD: list, set, delete, init - Add config.json.example template - Add config.json to .gitignore for security - Update README with new commands Usage: mycli env export # Export all env vars mycli config set key value # Set config value mycli config delete key # Delete config key
3.7 KiB
3.7 KiB
MyCLI
Personal CLI toolkit - unified interface for various utility scripts.
Installation
make install
Commands
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) - 增删改查
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 pathsssh_hosts: SSH connection settingsgit_proxies: Git proxy URLsopenfoam: OpenFOAM mount settingsapi_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
-
Copy the example config:
cp mycli/config.json.example mycli/config.json -
Edit with your actual API keys:
mycli config edit -
Add to your
~/.zshrcto auto-load:eval "$(mycli env export 2>/dev/null)"
Uninstall
make uninstall