Open
Conversation
Why is this change needed? -------------------------- It's an experiment in accelerating development with the convenient use of generative AI. There are currently LOTS of articles about it. This implementation is based on this article: https://kadekillary.work/posts/1000x-eng/ How does it address the issue? ------------------------------ It adds a bash function, ask_chatgpt, that takes a prompt in the same way chatgpt would in the browser. I also aliased it to "h". I'm not sure I think that's the best alias, but it works for now. I don't actually expect this function to be all that useful by itself. I think a key feature of chatgpt is that it remembers what you're talking to it about, so you can make modifications and adjustments. That doesn't happen using this command line interface. However, I expect it will be a lot easier to automate things and provide large bodies of input to chatgpt over command line. Maybe even setting large bodies of context before asking a question. Per discussion about making the common files more development friendly, I added a line to the top of bashrc that sources all the bash files in a directory. The directory is hardcoded right now in a way that's probably not going to work for other people, but I had to stop shaving at some point. Anyway, the idea is that ALL function extension for bash will be done in files in that directory[1]. Any links to any relevant tickets, articles or other resources? --------------------------------------------------------------- 1 - https://3.basecamp.com/3093825/buckets/28354346/messages/5105707052#__recording_5163658670
Why is this change needed? -------------------------- I got tired of it printing "null" whenever there was a problem with my request. How does it address the issue? ------------------------------ Check to see if they API returns an error message. Print that message if there is one. Any links to any relevant tickets, articles or other resources? ---------------------------------------------------------------
Why is this change needed? -------------------------- A more interesting use for command line chatgpt is the ability to write a file that provides significant context for a question and supply the entire thing. Some possibilities include - easily providing some code to optimize - accumulate a shared/sophisticated context for a question How does it address the issue? ------------------------------ If there are two arguments, append the second to the first. If there's only one argument, just use that as the prompt. Any links to any relevant tickets, articles or other resources? ---------------------------------------------------------------
Why is this change needed? -------------------------- I want to put weird things in channel. How does it address the issue? ------------------------------ There's now a function called img_gpt in the terminal that takes a text description and provides a url for the created image. I aliased it to "hi", since the basic chat function is "h". And I think "hi" is funny. Any links to any relevant tickets, articles or other resources? --------------------------------------------------------------- https://kadekillary.work/posts/1000x-eng/
mediocretes
reviewed
May 18, 2023
|
|
||
| [[ -f /etc/bash_completion ]] && source /etc/bash_completion | ||
|
|
||
| for file in ~/Dropbox/code/common-files/bash_functions/*.sh; do |
Contributor
There was a problem hiding this comment.
This path is not a good path for me.
Also, maybe everyone should have an env variable with their root code path in it.
Member
There was a problem hiding this comment.
Same here. I think the path could be ~/bash_functions/*.sh which should be symlinked because of stow. Though, I think we probably want to move that folder to ~/.common_files/bash_functions or actually I think ~/.common_files/bin and adding that to the PATH is probably a more common pattern in dotfiles.
Member
Author
|
@jason-o-matic - I knew I had done the work to set up the bash script folder. It was in this PR that's been lingering for almost two years. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm working on adding AI convenience functions as seen in this article from channel
This PR also moves us in the organizational direction defined here. Specifically, you can now add files to the bash_functions folder to expand the common files capabilities without bloating bash_profile or whatever.