ឧបករណ៍ដែលបង្កើតឡើងដោយ Python សម្រាប់គ្រប់គ្រង និងដំណើរការ shell scripts ជាមួយនឹងការជ្រើសរើសអន្តរកម្ម និងការគ្រប់គ្រងការអនុញ្ញាតដោយស្វ័យប្រវត្តិ។ ល្អសម្រាប់អ្នកអភិវឌ្ឍន៍ដែលប្រើ shell scripts ញឹកញាប់សម្រាប់កិច្ចការអភិវឌ្ឍន៍ដូចជាការផ្លាស់ប្តូរអ្នកប្រើ Git ការកំណត់ឡើងវិញនូវ IDE និងការគ្រប់គ្រងមូលដ្ឋានទិន្នន័យ។
- ការជ្រើសរើស Script អន្តរកម្ម: រុករក និងដំណើរការ
.shscripts ពីថតshell_file/បានយ៉ាងងាយស្រួលដោយប្រើចំណុចប្រទាក់ប៊ូតុងវិទ្យុដែលយល់បាន។ - ការគ្រប់គ្រងការអនុញ្ញាតដោយស្វ័យប្រវត្តិ: ស្នើឱ្យធ្វើឱ្យ scripts អាចដំណើរការបានមុនពេលដំណើរការ ធានាការដំណើរការរលូន។
- ការរៀបចំការអនុញ្ញាតច្រើន: ឧបករណ៍ម្តងមួយដងដើម្បីធ្វើឱ្យ shell scripts ទាំងអស់អាចដំណើរការបានជាមួយនឹងការបញ្ជាក់ជាក្រុម ឬបុគ្គល។
- សុវត្ថិភាព និងអនាមិក: តែងតែស្នើមុនពេលផ្លាស់ប្តូរការអនុញ្ញាត គ្រប់គ្រងកំហុសយ៉ាងរលូនជាមួយនឹងសារកំហុសច្បាស់លាស់។
- ការរួមបញ្ចូល
uv: ដំណើរការយ៉ាងរលូនជាមួយនឹង uv Python package manager សម្រាប់ការអភិវឌ្ឍន៍ Python ទំនើប។ - ការរុករកដោយព្រួញ: ការគាំទ្រ keyboard ពេញលេញជាមួយនឹងព្រួញសម្រាប់ការរុករក និងការជ្រើសរើស។
sh_manager/
├── main.py # ចំណុចចូលកម្មវិធីគោល
├── make_executable.py # ឧបករណ៍ការអនុញ្ញាតច្រើន
├── pyproject.toml # ការកំណត់រចនាសម្ព័ន្ធ និងការពឹងផ្អែកគម្រោង
├── uv.lock # ឯកសារ lock សម្រាប់ uv package manager
├── data/
│ └── git_user_configs.json # ការកំណត់រចនាសម្ព័ន្ធអ្នកប្រើ Git
└── shell_file/
├── switch_git_user.sh # ឧបករណ៍ផ្លាស់ប្តូរអ្នកប្រើ Git
├── reset_intellijidea.sh # Script កំណត់ឡើងវិញនូវ IntelliJ IDEA
└── reset_navicate.sh # Script កំណត់ឡើងវិញនូវ Navicat database
- macOS តែប៉ុណ្ណោះ: ឧបករណ៍នេះត្រូវបានរចនាឡើងសម្រាប់ macOS តែប៉ុណ្ណោះ
- Python 3.11.11 ឬខ្ពស់ជាង
- uv package manager (ណែនាំ)
- Clone ឬទាញយក repository នេះ
- ចូលទៅកាន់ថតគម្រោង
- ដំឡើងការពឹងផ្អែកដោយប្រើ uv:
uv sync
ចាប់ផ្តើមឧបករណ៍គ្រប់គ្រង shell script អន្តរកម្ម:
# ប្រើ uv
uv run main.pyធ្វើឱ្យ shell scripts ទាំងអស់អាចដំណើរការបានក្នុងម្តង:
# ប្រើ uv
uv run make_executable.py
# ឬដំឡើង និងដំណើរការជា script
uv run make-executableផ្លាស់ប្តូររវាងការកំណត់រចនាសម្ព័ន្ធអ្នកប្រើ Git ផ្សេងៗគ្នាដែលកំណត់ក្នុង data/git_user_configs.json។
ការកំណត់រចនាសម្ព័ន្ធបច្ចុប្បន្ន:
@username(username@example.com)@username2(username2@example.com)
កំណត់ឡើងវិញនូវការកំណត់ និង cache របស់ IntelliJ IDEA។ មានប្រយោជន៍សម្រាប់ដោះស្រាយបញ្ហា IDE។
កំណត់ឡើងវិញនូវការកំណត់ការតភ្ជាប់មូលដ្ឋានទិន្នន័យ Navicat និង cache។
ឧបករណ៍ reset_intellijidea.sh អាចកំណត់ឡើងវិញបានគ្រប់កម្មវិធី JetBrains ដូចជា:
- IntelliJ IDEA - Java IDE
ឧបករណ៍ reset_navicate.sh អាចកំណត់ឡើងវិញបាន:
- Navicat Premium (ជំនាន់ 15, 16, 17) - ឧបករណ៍គ្រប់គ្រងមូលដ្ឋានទិន្នន័យ
- ការកំណត់រចនាសម្ព័ន្ធ និង cache
- ការលុបពេលវេលាសាកល្បង
- ការកំណត់ឡើងវិញនូវការកំណត់អ្នកប្រើប្រាស់
- ការលុបឯកសារ preferences និង plist
កម្មវិធីផ្តល់ចំណុចប្រទាក់ប៊ូតុងវិទ្យុដែលយល់បាន:
- ព្រួញ ↑/↓: រុករករវាង scripts
- ព្រួញ →: ជ្រើសរើស script (ការជ្រើសរើសប៊ូតុងវិទ្យុ)
- Enter: ដំណើរការ script ដែលបានជ្រើសរើស
- q: ចាកចេញពីកម្មវិធី
ឧទាហរណ៍ចំណុចប្រទាក់:
ប្រើ ↑/↓ ដើម្បីផ្លាស់ទី, → ដើម្បីជ្រើសរើស, Enter ដើម្បីដំណើរការ, q ដើម្បីចាកចេញ។
> [x] switch_git_user.sh
[ ] reset_intellijidea.sh
[ ] reset_navicate.sh
រុករកដោយព្រួញ។ ជ្រើសរើសដោយ →, ដំណើរការដោយ Enter, ចាកចេញដោយ q។
កែសម្រួល data/git_user_configs.json ដើម្បីបន្ថែម ឬកែប្រែ profile អ្នកប្រើ Git:
ចំណាំ: ប្រសិនបើឯកសារ git_user_configs.json មិនមានទេ សូមចម្លងពី data/git_user_configs_example.json ទៅ data/git_user_configs.json និងកែសម្រួលតាមតម្រូវការរបស់អ្នក។
[
{
"name": "ឈ្មោះរបស់អ្នក",
"email": "email.របស់អ្នក@example.com"
}
]- ដាក់
.shscript របស់អ្នកក្នុងថតshell_file/ - ត្រូវប្រាកដថា script មាន shebang ត្រឹមត្រូវ (
#!/bin/bash) និងការអនុញ្ញាត - Script នឹងបង្ហាញដោយស្វ័យប្រវត្តិក្នុងចំណុចប្រទាក់ជ្រើសរើស
- ការបញ្ជាក់ការអនុញ្ញាត: តែងតែស្នើមុនពេលធ្វើឱ្យឯកសារអាចដំណើរការបាន
- ការគ្រប់គ្រងកំហុស: ការគ្រប់គ្រងកំហុសយ៉ាងរលូនជាមួយនឹងសារកំហុសច្បាស់លាស់
- ការដំណើរការមានសុវត្ថិភាព: Scripts ដំណើរការក្នុងបរិស្ថានដែលគ្រប់គ្រងបាន
- ការផ្ទៀងផ្ទាត់ការបញ្ចូល: ការផ្ទៀងផ្ទាត់ត្រឹមត្រូវនូវការបញ្ចូលរបស់អ្នកប្រើ
# ដំឡើងការពឹងផ្អែកអភិវឌ្ឍន៍
uv sync
# ដំណើរការកម្មវិធីគោល
uv run main.py
# ដំណើរការឧបករណ៍ការអនុញ្ញាត
uv run make_executable.py- Python 3.11.11+: មុខងារ និងដំណើរការ Python ទំនើប
- Standard Library តែប៉ុណ្ណោះ: មិនត្រូវការការពឹងផ្អែកខាងក្រៅ
- uv: ការគ្រប់គ្រង package Python ទំនើប
គម្រោងនេះគឺជា open source និងមានជាមួយអាជ្ញាប័ណ្ណ MIT។
- Fork repository
- បង្កើត feature branch
- ធ្វើការផ្លាស់ប្តូររបស់អ្នក
- ធ្វើតេស្តយ៉ាងហ្មត់ចត់
- ដាក់ស្នើ pull request
Script មិនអាចដំណើរការបាន:
- ដំណើរការ
uv run make-executableដើម្បីរៀបចំការអនុញ្ញាត - ឬដំណើរការដោយដៃ
chmod +x shell_file/your_script.sh
ការអនុញ្ញាតត្រូវបានបដិសេធ:
- ត្រូវប្រាកដថាអ្នកមានការអនុញ្ញាតសរសេរទៅថត
shell_file/ - ពិនិត្យមើលថា script files មិនមែនជា read-only
Script មិនត្រូវបានរកឃើញ:
- ផ្ទៀងផ្ទាត់ថា script មាននៅក្នុងថត
shell_file/ - ពិនិត្យមើលថា file មាន extension
.sh
សម្រាប់បញ្ហា សំណួរ ឬការរួមចំណែក សូមបើក issue នៅលើ repository គម្រោង។
A Python-based tool for managing and running shell scripts with interactive selection and automatic permission handling. Perfect for developers who frequently use shell scripts for development tasks like Git user switching, IDE resets, and database management.
- Interactive Script Selection: Easily browse and run
.shscripts from theshell_file/directory using an intuitive radio-button interface. - Automatic Permission Handling: Prompts to make scripts executable before running, ensuring smooth execution.
- Bulk Permission Setup: One-time utility to make all shell scripts executable with batch or individual confirmation.
- Safe & Secure: Always asks before changing permissions; handles errors gracefully with proper error messages.
uvIntegration: Works seamlessly with the uv Python package manager for modern Python development.- Arrow Key Navigation: Full keyboard support with arrow keys for navigation and selection.
sh_manager/
├── main.py # Main application entry point
├── make_executable.py # Bulk permission utility
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Lock file for uv package manager
├── data/
│ └── git_user_configs.json # Git user configurations
└── shell_file/
├── switch_git_user.sh # Git user switching utility
├── reset_intellijidea.sh # IntelliJ IDEA reset script
└── reset_navicate.sh # Navicat database reset script
- macOS Only: This tool is designed specifically for macOS
- Python 3.11.11 or higher
- uv package manager (recommended)
- Clone or download this repository
- Navigate to the project directory
- Install dependencies using uv:
uv sync
Start the interactive shell script manager:
# Using uv
uv run main.py
# Or install and run as a script
uv run sh-managerMake all shell scripts executable at once:
# Using uv
uv run make_executable.py
# Or install and run as a script
uv run make-executableSwitches between different Git user configurations defined in data/git_user_configs.json.
Current configurations:
@username(username@example.com)@username2(username2@example.com)
Resets IntelliJ IDEA settings and caches. Useful for resolving IDE issues.
Resets Navicat database connection settings and caches.
The reset_intellijidea.sh tool can reset all JetBrains applications including:
- IntelliJ IDEA - Java IDE
The reset_navicate.sh tool can reset:
- Navicat Premium (Versions 15, 16, 17) - Database management tool
- Settings and cache reset
- Trial period reset
- User configuration reset
- Preferences and plist file cleanup
The application provides an intuitive radio-button interface:
- ↑/↓ Arrow Keys: Navigate between scripts
- → Arrow Key: Select a script (radio button selection)
- Enter: Run the selected script
- q: Quit the application
Example interface:
Use ↑/↓ to move, → to select, Enter to run, q to quit.
> [x] switch_git_user.sh
[ ] reset_intellijidea.sh
[ ] reset_navicate.sh
Navigate with arrow keys. Select with →, run with Enter, quit with q.
Edit data/git_user_configs.json to add or modify Git user profiles:
Note: If the git_user_configs.json file doesn't exist, copy from data/git_user_configs_example.json to data/git_user_configs.json and modify according to your needs.
[
{
"name": "Your Name",
"email": "your.email@example.com"
}
]- Place your
.shscript in theshell_file/directory - Make sure the script has proper shebang (
#!/bin/bash) and permissions - The script will automatically appear in the selection interface
- Permission Confirmation: Always asks before making files executable
- Error Handling: Graceful error handling with informative messages
- Safe Execution: Scripts run in a controlled environment
- Input Validation: Proper validation of user inputs
# Install development dependencies
uv sync
# Run the main application
uv run main.py
# Run the permission utility
uv run make_executable.py- Python 3.11.11+: Modern Python features and performance
- Standard Library Only: No external dependencies required
- uv: Modern Python package management
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Script not executable:
- Run
uv run make-executableto set up permissions - Or manually run
chmod +x shell_file/your_script.sh
Permission denied:
- Ensure you have write permissions to the
shell_file/directory - Check that the script files are not read-only
Script not found:
- Verify the script exists in the
shell_file/directory - Check that the file has a
.shextension
For issues, questions, or contributions, please open an issue on the project repository.