5019 shaares
Un game changer ! Je vous mets ici quelques exemples :
Discussion basique
sgpt "What is the fibonacci sequence"
-> The Fibonacci sequence is a series of numbers where each number ...
Chaîner des commandes dans des one-liners
git diff | sgpt "Generate git commit message, for my changes"
-> Added main feature details into README.md
Accéder à des documents sur le disque
sgpt "summarise" < document.txt
-> The document discusses the impact...
Agir sur le système de fichiers
sgpt --shell "find all json files in current folder"
-> find . -type f -name "*.json"
Déclencher des programmes
ls
-> 1.mp4 2.mp4 3.mp4
sgpt -s "ffmpeg combine $(ls -m) into one video file without audio."
-> ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -filter_complex "[0:v] [1:v] [2:v] concat=n=3:v=1 [v]" -map "[v]" out.mp4
-> [E]xecute, [D]escribe, [A]bort
Démarrer un chat
sgpt --chat conversation_1 "please remember my favorite number: 4"
-> I will remember that your favorite number is 4.
sgpt --chat conversation_1 "what would be my favorite number + 4?"
-> Your favorite number is 4, so if we add 4 to it, the result would be 8.
Avoir des conversations
sgpt --chat conversation_3 --shell "what is in current folder"
# -> ls
sgpt --chat conversation_3 "Sort by name"
# -> ls | sort
sgpt --chat conversation_3 "Concatenate them using FFMPEG"
# -> ffmpeg -i "concat:$(ls | sort | tr '\n' '|')" -codec copy output.mp4
sgpt --chat conversation_3 "Convert the resulting file into an MP3"
# -> ffmpeg -i output.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 final_output.mp3
Créer des rôles (skills)
sgpt --create-role json_generator
sgpt --role json_generator "random: user, password, email, address"
Résultat :
{
"user": "JohnDoe",
"password": "p@ssw0rd",
"email": "johndoe@example.com",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
}
}