Using Copilot X: CLI to reorganize my blog

A few days ago I was working on my blog leonardomontini.dev as I’d like to give it a strong restyle and move from Gatsby to Astro.

I also took the chance to change the folder structure of the current blog as it’s now flat and I wanted a more organized…


This content originally appeared on DEV Community and was authored by Leonardo Montini

A few days ago I was working on my blog leonardomontini.dev as I'd like to give it a strong restyle and move from Gatsby to Astro.

I also took the chance to change the folder structure of the current blog as it's now flat and I wanted a more organized one.

Not too complicated, I wanted to group for year and month folders and move all the posts in the right one. For example, the post 2023-04-30_my-post/index.md should be moved to 2023/04/my-post/index.md.

There are ~50 articles right now, such a boring task to do manually and since it's just a simple files/folders manipulation I thought a simple bash script could have been the solution... but it's 2023, I didn't want to write it myself and Google for the right commands when I can just ask an AI to write a wrong script for me :D

Copilot X CLI

I've recently got access to the Copilot CLI beta and I'm playing with it to see how it works but this seems like a real use case for it.

I actually didn't plan to make a video out of it but I thought the process could have been interesting to share so I quickly turned on the lights, the webcam and started recording.

This is how it went:

Spoiler: it didn't work on the first attempt, but it was definitely my fault for not noticing the error in the suggested script

Outcome

Running a script generated by an AI if you have no idea what is it going to do isn't probably a wise choice, even if you can ask the AI to explain it. In my case, the task was quite simple and the outcome was easy to verify so it was a safe playground.

Actually, as you can see in the video, I was in a temporary folder AND I had an extra backup on a zip file. Better safe than sorry!

Are you using AI tools for generating scripts for you? Only easy scripts or also more complex ones?
What questions are you asking or what problems are you solving with them?

Let me know in the comments! :D

Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me ❤️
You can find it here:
YouTube

Feel free to follow me to get notified when new articles are out ;)


This content originally appeared on DEV Community and was authored by Leonardo Montini


Print Share Comment Cite Upload Translate Updates
APA

Leonardo Montini | Sciencx (2023-05-01T19:41:43+00:00) Using Copilot X: CLI to reorganize my blog. Retrieved from https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/

MLA
" » Using Copilot X: CLI to reorganize my blog." Leonardo Montini | Sciencx - Monday May 1, 2023, https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/
HARVARD
Leonardo Montini | Sciencx Monday May 1, 2023 » Using Copilot X: CLI to reorganize my blog., viewed ,<https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/>
VANCOUVER
Leonardo Montini | Sciencx - » Using Copilot X: CLI to reorganize my blog. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/
CHICAGO
" » Using Copilot X: CLI to reorganize my blog." Leonardo Montini | Sciencx - Accessed . https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/
IEEE
" » Using Copilot X: CLI to reorganize my blog." Leonardo Montini | Sciencx [Online]. Available: https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/. [Accessed: ]
rf:citation
» Using Copilot X: CLI to reorganize my blog | Leonardo Montini | Sciencx | https://www.scien.cx/2023/05/01/using-copilot-x-cli-to-reorganize-my-blog/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.