Enhance bp_tools.py with new utilities and shell mode support #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Review and improvement of
bp_tools.pyper request, adding commonly needed file/path utilities and fixingrun_os_commandlimitations.Bug Fixes
run_os_command: Fixedinput=""→input=b""for proper subprocess bytes handlingerrors='replace'to UTF-8 decode for robustnessNew
run_os_commandShell ModeAdded
use_shellparameter for commands requiring pipes, redirects, or chaining:New Tools (18)
File Operations
move_file,rename_file,file_exists,directory_existsjoin_files,delete_lines_from_fileText/Content
find_and_replace_regex— pattern-based replacementsread_first_n_lines,read_last_n_lines— memory-efficient partial readscount_occurrences_in_file,find_line_numbersPath Utilities
get_file_extension,get_filename,get_parent_directoryget_absolute_path,path_joinExecution/Environment
run_python_file— mirrors existingrun_php_fileget_working_directory,change_directoryTests
Added 42 tests covering all new functionality. Total: 103 tests passing.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.