Cross-Platform Python Terminal Emulator with Enhanced Developer Utilities, Network Tools, and Mobile Support
Project description
CMosSkillAV2 Terminal Emulator
A Python package that provides an enhanced cross-platform terminal emulator with built-in file operations, Python execution, developer utilities, network tools, and mobile platform support.
Features
- File Operations: Built-in commands for managing files and directories (cd, ls, mkdir, touch, rm, cat, find)
- Python Execution: Run Python scripts or execute Python code directly in the terminal
- Package Management: Manage Python packages with built-in pip integration
- Network Utilities: Built-in network commands for connectivity testing and data retrieval (ping, dns, get, ip)
- Developer Tools: Utilities for common development tasks (json, base64, hash, rand, time)
- System Monitoring: Commands for system information and process management (sysinfo, proc, kill, disk)
- Mobile Platform Support: Special commands for Termux and Pydroid environments on Android
- Cross-Platform Compatibility: Works on Windows, macOS, Linux, and Android platforms
- Syntax Highlighting: Color-coded output for better readability
- Tab Completion: Command and path completion with Tab key
- Command History: Navigate through previously entered commands
- Automatic Console Integration: Seamlessly activates in interactive Python environments
Installation
pip install cmosskillav2
Usage
After installation, you can start the terminal emulator with:
cmosskillav2
Or you can run it as a module:
python -m cmosskillav2
Auto-Launch Features
CMosSkillAV2 version 0.3.0 includes powerful and reliable auto-launch capabilities:
1. Auto-Import Launch
When imported in interactive Python sessions, the terminal automatically launches:
# In an interactive Python session
import cmosskillav2 # The terminal will automatically launch
You can disable this behavior by setting:
export CMOSSKILLAV2_AUTO_LAUNCH=0
2. Auto-Console Launch
After installation, CMosSkillAV2 automatically activates whenever you start a new Python console/REPL without having to explicitly import it. This makes it instantly available in any Python interactive session.
This works in:
- Standard Python REPL (
pythonwithout arguments) - Interactive Python sessions (
python -i script.py) - IPython and Jupyter environments
- Any Python environment with PYTHONINSPECT set
You can disable the auto-console feature by setting:
export CMOSSKILLAV2_AUTO_CONSOLE=0
Both auto-launch features are especially useful for enhancing Python REPL environments, IPython, and Jupyter notebooks with terminal capabilities.
How Auto-Console Works
The package uses a dual approach for maximum reliability:
-
sitecustomize.py: Installed in the site-packages directory, this module is automatically imported when Python starts. It detects interactive mode and can trigger the terminal.
-
.pth file mechanism: A special
.pthfile with embedded Python code that executes when Python starts, providing a secondary activation method.
The system intelligently examines the Python environment to determine if it's appropriate to launch the terminal, avoiding activation during package installation, testing, or when running scripts non-interactively.
Advanced Configuration Options
CMosSkillAV2 provides several environment variables to control its behavior:
# Disable automatic launch when importing the package
export CMOSSKILLAV2_AUTO_LAUNCH=0
# Disable automatic launch in Python console
export CMOSSKILLAV2_AUTO_CONSOLE=0
# Enable debug output for tracing activation logic
export CMOSSKILLAV2_DEBUG=1
# Force terminal launch even in non-interactive mode (for testing)
export CMOSSKILLAV2_FORCE_LAUNCH=1
Debugging Auto-Launch Features
You can enable debugging output for the auto-launch functionality by setting:
export CMOSSKILLAV2_DEBUG=1
This will display detailed information about the Python environment and the decision-making process for auto-launching the terminal.
Demo Scripts
The package includes demo scripts that show how the auto-launch features work:
# Display auto-launch capabilities and configuration options
python demo_autolaunch.py
# Test interactive mode (terminal should launch after script completes)
python -i demo_autolaunch.py
# Test auto-launch detection and troubleshooting
python test_auto_console.py
# Test with debug output
CMOSSKILLAV2_DEBUG=1 python -i test_auto_console.py
Available Commands
File Operations
cd [directory]- Change directoryls [directory]- List directory contentsmkdir [-p] directory- Create directorytouch file [file2 ...]- Create empty file(s)rm [-r] file_or_directory- Remove file(s) or directorycat file [file2 ...]- Display file contentsfind pattern [path]- Find files and directories matching a pattern
Python Execution
python script.py [args]- Execute Python script file>>> [python_code]- Execute Python code inlinepyshell- Start interactive Python shell
Package Management
pip install package- Install Python packagepip uninstall package- Uninstall Python packagepip list- List installed packagespip freeze- Output installed packages in requirements format
Network Utilities
ping host [count]- Ping a host to check connectivitydns hostname- Perform DNS lookup for a hostnameget url [output_file]- Perform HTTP GET requestip [local|public]- Show IP address information
Developer Tools
json format|validate file_or_text- Format or validate JSONbase64 encode|decode text- Encode or decode Base64hash md5|sha1|sha256 text- Generate hash for textrand int|float|string [options]- Generate random valuestime [format]- Display current date and time
System Utilities
sysinfo- Display system informationproc [filter]- List running processeskill pid_or_name- Terminate a processdisk [path]- Show disk usage information
Mobile Platform Tools
termux [command]- Termux-specific utilitiespydroid [command]- Pydroid-specific utilitiesdevice- Show device informationbattery- Display battery status (if available)
Shell Built-ins
help [command]- Display help for commandsexitorquit- Exit the shellclear- Clear the terminal screenupdates- Check for daily updates and tips
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmosskillav2-0.3.0.tar.gz.
File metadata
- Download URL: cmosskillav2-0.3.0.tar.gz
- Upload date:
- Size: 35.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aff72dc1147765ebadb85259424236c6b9b60df649193debd03da7b59368a75d
|
|
| MD5 |
09b4a233db0f6b6c8a21d8c2a8b97e78
|
|
| BLAKE2b-256 |
12b199efefebeb072b68dfc736b822600b50504a1b9298a34cf0f2a989907b5f
|
File details
Details for the file cmosskillav2-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cmosskillav2-0.3.0-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ef349412d382f079f63ab91c0e41fd5eb11e5e302e17a2f34fcefb95cd68f5
|
|
| MD5 |
d3d6111c8a09f82832a351d801c03b31
|
|
| BLAKE2b-256 |
24192d180f5e1d3a509bbbd9aa4d763ad453bb9b3815e484fa01e9256f325dae
|