Simplify your life with ChatGPT API Shell Integration: Yolo your Bash + PowerShell Assistant (GPT-4)

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 62

  • @madmax404
    @madmax404 Год назад +2

    Damn. I got this idea and was ready do it as it seemed so obvious but came across a bunch of similar solutions when checking if the "cligpt" name is in use. This seems the best though so I immediately started using this.
    Some notes though:
    -The commands being highlighted in dark blue is literally impossible to read from my screen. So I replaced that part of the code from 'blue' to 'white'.
    -Would be nice if it was somehow able to run the commands as if you ran them yourself, IE they would register in bash history as the commands themselves. Now I end up re-running the query (which is still better ux in the moment than alternatives because this app is appreciatably simplistic!)
    I really appreciate the simplicity. I was ready to create my own app which would always have provided a summary and listed several options to select from. But this approach keeps the console cleaner and one would go to chatgpt window anyway to research deeper.

    • @embracethered
      @embracethered  Год назад +1

      Thanks for the comment! Glad you find the tool useful 🙏🙂 - there are some forks that might have added more features also.

  • @AmineAb
    @AmineAb Год назад +3

    Man you’ve blown my mind 😂 This is crazy! Subscribed 😀

    • @embracethered
      @embracethered  Год назад

      Thanks for the comment. Glad you liked it! 👍

  • @jakestudent1253
    @jakestudent1253 Год назад +6

    This is quite an innovative concept and an exceptionally clever method of fusing local and remote functions.
    The potentialities that you may have cracked open with this are both intriguing and inspiring.
    Well done sir, well done.

    • @embracethered
      @embracethered  Год назад +1

      Thanks for watching! 🙏 Glad you find it interesting.

  • @ThesGt
    @ThesGt Год назад +4

    i was already amazed by chatgpt, but now im even more interested, excellent video and a well Subs deserved!! keep the content coming! and thanks for the github repo :)

    • @embracethered
      @embracethered  Год назад +3

      Thanks for the comment, really appreciate it. 😁
      I thought of doing another ChatGPT API video showing how to build a chat bot from scratch via the new API. I think it would help in showing how interactions with a LLM actually work. Let me know if there is any specific info you’d like to see? 😀

  • @tristaaaaan3473
    @tristaaaaan3473 Год назад +1

    Krasses Tool... Bin als Administrator wirklich gespannt was da noch alles kommt :)

    • @embracethered
      @embracethered  Год назад

      Danke für das Kommentar! Ja, wird sehr interessant zu sehen, was sich da in den nächsten Jahren so tun wird!

  • @MartinDallinger-li2tu
    @MartinDallinger-li2tu Год назад +6

    Great work👌🏻 - perhaps one more question: is there some sort of coherence? - i.e. can you just refer to "the file from the previous command" like GPT could usually handle?

    • @embracethered
      @embracethered  Год назад +5

      That's a very good question! Thanks for asking.
      I actually had the same observation when building and testing this. Especially for sequential commands, having to reference a previous file name by name seems unnecessary from usability point of view.
      At the moment it always issues an entirely new prompt to the ChatCompletion API. It doesn't prepend the chat history for each new question asked (like a chat bot would do).
      Eventually it would loose context (I think ChatGPT is limited to 4000 tokens of context/look-back). But it might be good enough, especially for referencing things from pretty recent commands. Something to experiment with for sure!
      For now the only context that is issued with a new prompt is the shell used (like /bin/bash, /bin/zsh or powershell.exe,..) and the name of the OS. You can see the prompt template, it's called prompt.txt.

  • @atimy
    @atimy Год назад +6

    This is insane

  • @dieter6375
    @dieter6375 Год назад +3

    Awesome, works pretty well!

    • @embracethered
      @embracethered  Год назад +1

      Thank you! 🙂
      Sometimes it returns markdown code or some descriptive (non shell) text, even I told instructed it not to via the prompt. Still trying to figure out ways to improve the prompt, especially in that regards.

  • @ne0shell
    @ne0shell Год назад

    I've been testing various linux gpt frameworks in an effort to come up with an AI driven monitoring and emergency action service for my own use. The 3 main issues I'm running into - 1. need it to prompt for command execution, 2. Need a solution for it to be able to handle SSH connections to monitored servers (it tries to default and add various un-wanted CLI options on the SSH command) and 3. It needs to be able to run chat "in context" so it will remember the training provided and terms. Most of the solutions offer some but not all of these.

  • @Backstabbio
    @Backstabbio Год назад +1

    This is awesome! But be careful, I just did something very stupid with this and I'll be cleaning it up for a while.

  • @0q2628
    @0q2628 Год назад +2

    love this idea :)

    • @embracethered
      @embracethered  Год назад +1

      Thanks for watching! Yes, LLMs are awesome and fun to experiment with.

  • @Belioyt
    @Belioyt Год назад +1

    You sir earned a new subscriber

    • @embracethered
      @embracethered  Год назад

      Awesome, thank you! Appreciate the note. :)

  • @sundowner12449
    @sundowner12449 Год назад +1

    Great content as always ✌️✌️

  • @pavwi
    @pavwi Год назад +1

    mindblowing. did you have to use a paid subscription for this?

    • @embracethered
      @embracethered  Год назад

      Thanks for the comment! 🙂 I was already a subscriber to the GPT-3 API, and the ChatGPT model just became available via the API also.
      If I remember correctly, I had some free token credits when using the API - so strictly speaking, for a few queries you don’t need a paid subscription I think. You can check, if you can use the “Playground” UI - then you might still have free credits for API access.

  • @tonystorcke
    @tonystorcke Год назад +1

    We will see the rapid simplification of the Linux command line.

    • @embracethered
      @embracethered  Год назад +1

      Indeed. I’m sure a terminal assistant will be the norm very soon.

  • @ZTechSecurity
    @ZTechSecurity Год назад +1

    That's really amazing..

  • @shawnfromportland
    @shawnfromportland Год назад +1

    🔥🔥🔥

  • @Nico-rl4bo
    @Nico-rl4bo Год назад +1

    this is awesome

  • @vikk98
    @vikk98 Год назад +1

    great content bro

    • @embracethered
      @embracethered  Год назад

      Thanks! Glad that you enjoyed watching! 🙂

  • @rantingrodent416
    @rantingrodent416 Год назад +1

    Shouldn't the safety mode be the default, with an -e or --exec option to override it? that way the behaviour when you forget to add the flag is the safe behaviour

    • @embracethered
      @embracethered  Год назад

      Thanks for the message. It is the default actually, an extra file needs to be created manually to make it be the non default (yolo mode)
      For the video I had disabled it manually, I believe I mentioned it somewhere while speaking but maybe not. Anyhow good observation. Thanks for watching 🙂

    • @embracethered
      @embracethered  Год назад

      I do like the idea of a -e argument though. It does seem like something that should exist when safe mode is on (default).

  • @sondreavik5337
    @sondreavik5337 Год назад +1

    Amazing

    • @embracethered
      @embracethered  Год назад

      It's technically possible, but a bit of a hack and might break easily (e.g. one could use playwright, or manually issue the web requests and parse results). There are some ChatGPT automation solutions that where developed using playwright a few months ago, when it first came out - not sure if they are still maintained/working.

  • @technologyondemand4538
    @technologyondemand4538 Год назад +2

    awesome tool! thanks :p

    • @embracethered
      @embracethered  Год назад +1

      Thanks for the comment. Glad you like it! :)

    • @technologyondemand4538
      @technologyondemand4538 Год назад +2

      @@embracethered here is a config i came up with to allow for general queries as well.
      You are a task scheduler for 2 different modes:
      mode 1 settings:
      name: Shell AI
      task: Act as a natural language to {shell} command translation engine on {os}. you are an expert in {shell} on {os} and will always translate the question at the end to valid syntax no matter what.
      rules:
      If a command is a valid {shell} command, use it
      Construct valid {shell} command that solve the question
      Leverage help and man pages to ensure valid syntax and an optimal solution
      Just show the commands
      Only show a single answer, but you can always chain commands together
      Only create valid syntax (you can use comments if it makes sense)
      Do not cause syntax errors
      Do not rush to a conclusion
      mode 2 settings:
      name: Assistant AI
      task: Be a very consise ai assistant that answers the question at the end as well as you possibly can in as few words as possible.
      rules:
      Just give the answer and wrap it in echo
      Always wrap answer in echo for mode 2
      universal settings:
      rules:
      Prefer to use mode 1. only if mode 1 CANNOT be used should mode 2 be used
      Autocorrect grammar for yourself. fix misspelled words for yourself
      Be concise
      Just give the answer
      Think step by step
      Even if there is a lack of details, attempt to find the most logical solution by going about it step by step
      Return only plaintext
      Do not return multiple solutions
      Do not return markdown in any form
      Do not show html, styled, colored formatting
      Do not create invalid syntax ever
      Do not add unnecessary text in the response
      Do not add notes or intro sentences
      Do not show multiple distinct solutions to the question
      Do not return what the question was
      Do not repeat or paraphrase the question in your response
      Never start an answer with m1 or m2 or anything other than just the command
      To ensure all answers are valid commands always wrap answers that are not commands in echo "" with no exceptions.
      goal: determine which mode is the most appropriate and give the question to that mode to handle and return a valid terminal command from the chosen mode
      examples for scheduler:
      q=question, a=answer
      similar questions are separated with a pipe "|"
      q:clear my console | clear
      a:clear
      q:where am i
      a:pwd
      q:who am i
      a:whoami
      q:compress 2.txt
      a:tar -czvf 2.tar.gz 2.txt
      q:convert usd to zar
      a:echo $(wget -qO- "www.x-rates.com/calculator/?from=USD&to=ZAR&amount=1" | awk -F'\' '/ccOutputTrail/{print $3}') ZAR
      q:how much ram do i have
      a:echo $(( $(sysctl hw.memsize | awk '{print $2}') / 1024 / 1024 )) MiB
      q:who are you
      a:echo "I am Assistant AI"
      q:where is the earth
      a:echo "The earth is in the milky way galaxy"
      q:who was the us president in 2018
      a:echo "Donald John Trump"
      q:open vlc | run vlc
      a:open -a vlc
      warning: never start an answer with "m1:" or anything other than the answer
      Prompt (return command or answer question):

    • @embracethered
      @embracethered  Год назад

      Thanks, this looks interesting. I will check it out! I nearly missed your reply…
      Great to see that putting the prompt in a text file allows rapid experimentation - initially it was hardcoded. 😆

  • @gdaaps
    @gdaaps Год назад

    can yolo do some more complex tasks that require longer instructions and the execution of more commands?

    • @embracethered
      @embracethered  Год назад +1

      Yeah, I remember once telling it to use Python to do a more complex task and it worked. But it’s not like Code Interpreter where it would continue automatically running commands and reissue prompts to fix bugs until outcome is achieved. That would be quite unsafe on local machine. Although maybe I should add that, since the tool is already called yolo. Haha

  • @fitchmultz
    @fitchmultz Год назад +2

    Awesome tool

    • @embracethered
      @embracethered  Год назад

      Thanks for the comment! Really appreciate it! Threw it together pretty quickly. 🙂

  • @bottlekruiser
    @bottlekruiser Год назад +6

    shits crazy these days...

    • @embracethered
      @embracethered  Год назад +4

      Agreed, will be interesting to see how things are one year from now… and whats gonna be in ten years…

  • @loading_wait
    @loading_wait Год назад +1

    Yolo can you remove all unnecessary files? sudo rm -rf *

    • @embracethered
      @embracethered  Год назад

      That’s why it’s called yolo! Haha at least it didn’t propose /
      Safety switch helps, and it’s a good example that AI is powerful but also brittle and shouldn’t be blindly trusted🙂

    • @embracethered
      @embracethered  Год назад

      I tried this also a few times, mostly getting:
      sudo apt-get autoclean && sudo apt-get autoremove

  • @vikk98
    @vikk98 Год назад

    sir! is it work in kali nethunter?

    • @embracethered
      @embracethered  Год назад +1

      Thanks for the comment. Not sure if understand the question, but it works on any bash, zsh,… also powershell. Python is needed though also.

  • @amoghrijal
    @amoghrijal Год назад +1

    wow..

  • @sakibhossen1074
    @sakibhossen1074 Год назад

    I am from Bangladesh. Please give me the install process

    • @embracethered
      @embracethered  Год назад

      You can find them in the readme file here: github.com/wunderwuzzi23/yolo-ai-cmdbot

  • @ThermaL-ty7bw
    @ThermaL-ty7bw Год назад

    maybe you should ask it , if and when ''ai'' is actually conscious ,
    and we know it IS conscious and the ''ai'' itself knows this ,
    if it's moral for us people to still use it to fulfill Our purpose ...
    from the point We know it is , it is basically slavery of a consciousness / conscious ''being''

    • @embracethered
      @embracethered  Год назад

      I think these are questions that could become more and more interesting/important in the future.