Skip to content

Add easy access to shell#53

Merged
AspadaX merged 7 commits intomainfrom
add-easy-access-to-shell
Jun 25, 2025
Merged

Add easy access to shell#53
AspadaX merged 7 commits intomainfrom
add-easy-access-to-shell

Conversation

@AspadaX
Copy link
Copy Markdown
Owner

@AspadaX AspadaX commented Jun 20, 2025

No description provided.

AspadaX added 2 commits June 17, 2025 21:18
- Add file operations to Cache for script management:
  - Make add_new_script take &self instead of &mut self
  - Implement actual file creation and writing in add_new_script
  - Add delete_script method with error handling
- Initialize Cache in main execution flow
- Add shell script execution module with platform-specific handling
- Integrate script search in main command processing
- Support script execution context (script directory or current working directory)
- Add enable_cache flag to Configurations with default implementation
- Implement cache lookup and script execution in main.rs
- Add save_to_shell_in_cache helper function
- Refactor shell.rs to simplify script execution
- Reorganize imports and reformat code for consistency
- Add proper error handling for cache operations
@AspadaX AspadaX self-assigned this Jun 20, 2025
@AspadaX AspadaX added bug Something isn't working enhancement New feature or request labels Jun 20, 2025
@AspadaX AspadaX requested a review from Copilot June 20, 2025 12:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new cross-platform shell execution helper and adds optional script caching to the CLI flow.

  • Adds execute_shell_script API for running arbitrary shell snippets on Windows and Unix.
  • Integrates Cache (with enable_cache flag in Configurations) into main.rs and helper flows to save and reuse generated scripts.
  • Extends Configurations and Cache modules with new fields and methods to support caching behavior.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/shell.rs Implements execute_shell_script for OS-specific command runs
src/main.rs Loads and uses cache in the Run command path
src/helpers.rs Expanded helper functions to optionally save scripts to cache
src/configurations.rs Added enable_cache field with serde default and Default impl
src/cache.rs New add_new_script and delete_script methods in Cache
Cargo.toml Bumped version to 0.1.90

Comment thread src/cache.rs Outdated
Comment thread src/cache.rs Outdated
Comment thread src/shell.rs
Comment thread src/shell.rs
Comment thread src/cache.rs
AspadaX added 3 commits June 24, 2025 10:01
- Add `list` and `remove` subcommands to CLI arguments
- Implement `list_scripts()` and enhanced `delete_script()` in Cache
- Add helper functions `process_list_cached_scripts()` and `process_remove_cached_script()`
- Update main command handling to support new operations
- Document project structure in new PROJECT_STRUCTURE_AND_DESIGN.md
@AspadaX
Copy link
Copy Markdown
Owner Author

AspadaX commented Jun 25, 2025

Translate your natural language into executable command(s)

Usage: you <COMMAND>

Commands:
  run          Run a command that is described in natural langauge. The LLM will breakdown the task and executes them
  explain      Explain a given command
  list         List all saved scripts in the cache
  remove       Remove a specified script from the cache
  version, -v  Display the version of `you`
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

The list and remove command needs to print abbr on the help.

@AspadaX AspadaX merged commit addde72 into main Jun 25, 2025
11 of 13 checks passed
@AspadaX AspadaX deleted the add-easy-access-to-shell branch June 25, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants