DEV Community

Cover image for Using Copilot: CLI to reorganize my blog
Leonardo Montini for This is Learning

Posted on • Edited on • Originally published at leonardomontini.dev

11 1 2 1 1

Using Copilot: 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 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 ;)

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay