pieces-app / cli-agent

Pieces CLI for interacting with Pieces OS
https://docs.pieces.app/extensions-plugins/cli
MIT License
46 stars 16 forks source link

Add a select menu class for the list command to be able to choose an asset from #133

Closed Bishoy-at-pieces closed 1 month ago

sambhavnoobcoder commented 1 month ago

Hey @Bishoy-at-pieces , just confirming , this used to be the output when running the list command for assets earlier :

Screenshot 2024-07-20 at 3 05 42 AM

but after the change I made , it looks like this :

Screenshot 2024-07-20 at 3 07 11 AM

is this the change you were seeking in this issue ? if yes , then I can push the code . if not , kindly do tell me the changes you wanted here and I'll make them accordingly.

Bishoy-at-pieces commented 1 month ago

140

sambhavnoobcoder commented 1 month ago

aha , got . thanks . on it .

Bishoy-at-pieces commented 1 month ago

Let me know if you want the code snippet for making select menus and you can continue on it and make it working in the list models,assets or any other index based selection

sambhavnoobcoder commented 1 month ago

yeah sure , if you have that , I'd rather work with that rather than reinventing the wheel . I'll try to implement that for the assets , apps and models , those three are what I believe are the index based sections in the list_command code

Bishoy-at-pieces commented 1 month ago

Yupp sure here you go https://bishoyatpieces.pieces.cloud/?p=c787439ee9, but before you add anything I would like to discuss more about it in #140 and know how it will exactly work. I think the open command should be removed now since we won't use it also the change model we will need to discuss it first before you do anything

Bishoy-at-pieces commented 1 month ago

@sambhavnoobcoder also feel free to share your thoughts in #140

Bishoy-at-pieces commented 1 month ago

@sambhavnoobcoder let me know if you faced an issue or you need any sort of help from me

sambhavnoobcoder commented 1 month ago

sure , working on it rn , will inform you if I face any issues , will most probably share a screen recording to verify if the behaviour after the change is as expected .

sambhavnoobcoder commented 1 month ago

https://github.com/user-attachments/assets/95c9b307-dad3-4cef-bd35-e3e2f13b40db

@Bishoy-at-pieces does this replicate the expected behaviour ? Running it opens the selection menu , and selecting the file opens it up . does this align with the functionalities required in the issue ?

Bishoy-at-pieces commented 1 month ago

Yes nice open a pull request for it! Well done!!

Bishoy-at-pieces commented 1 month ago

But wanted to know why we changed the way of opening the snippet? Just let it open as it is (gonna change it later but for now i think it is better to consontrate on one task)

sambhavnoobcoder commented 1 month ago

okay , so just to be clear ,what you are saying is that for this issue , we just want the code that allows us to select the asset from the possible list of assets , using the select menu , and then using separate line of code , we call the open_asset command from the AssetCommand class to open the selected asset as done previously ?and we can integrate the open_asset to work from inside the select menu directly later ?

Bishoy-at-pieces commented 1 month ago

Exactly

Bishoy-at-pieces commented 1 month ago

For later I would like to change the behavior of the open command. Just for now, when you select an asset you gonna run the open_asset method in the AssetsCommands class

sambhavnoobcoder commented 1 month ago

okay got it . I may have overstepped a bit here, but no worries , I'll make it behave accordingly for the timebeing , and will raise a pr accordingly . we can work to change the behaviour of the open command in the future .

Bishoy-at-pieces commented 1 month ago

Thank you!

sambhavnoobcoder commented 1 month ago

created PR #149 to address this issue . kindly give it a look .