https://github.com/yurenchen000/howto.sh
AI bash completion, bash implemention of https://github.com/antonmedv/howto
https://github.com/yurenchen000/howto.sh
ai bash completion deepseek-ai llm shell
Last synced: 2 months ago
JSON representation
AI bash completion, bash implemention of https://github.com/antonmedv/howto
- Host: GitHub
- URL: https://github.com/yurenchen000/howto.sh
- Owner: yurenchen000
- Created: 2025-05-24T15:52:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-17T07:50:21.000Z (9 months ago)
- Last Synced: 2025-09-17T09:35:32.089Z (9 months ago)
- Topics: ai, bash, completion, deepseek-ai, llm, shell
- Language: Shell
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
howto.sh
========
the bash version of
https://github.com/antonmedv/howto
[](https://asciinema.org/a/721054)
[](https://asciinema.org/a/721064)
## usage
in bash
### 1. setup
```bash
$ source howto.sh bind1
## for DeepSeek (is slow)
$ HOWTO_APIURL='https://api.deepseek.com/v1/chat/completions'
$ HOWTO_APIKEY='YOUR DEEPSEEK APIKEY'
$ HOWTO_MODEL='deepseek-chat'
## for OpenAI (or compatible api)
$ HOWTO_APIURL='https://api.openai.com/v1/chat/completions'
$ HOWTO_APIKEY='YOUR OPENAI APIKEY'
$ HOWTO_MODEL='gpt-4o'
## for Qwen (Pretty fast, Not openai compatible)
$ HOWTO_APIURL='https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation'
$ HOWTO_APIKEY='YOUR QWEN APIKEY'
$ HOWTO_MODEL='qwen-plus-latest' # better
## qwen models
HOWTO_MODEL='qwen-flash'
HOWTO_MODEL='qwen-turbo'
HOWTO_MODEL='qwen-turbo-latest' ## fine
HOWTO_MODEL='qwen-plus'
HOWTO_MODEL='qwen-plus-latest' ## fine 2
HOWTO_MODEL='qwen-max-latest' ## fine
HOWTO_MODEL='qwen-max' ## fine 2
```
NOTE: `HOWTO_APIURL` can be omitted (guess from `HOWTO_MODEL`)
more usage [demo wiki](https://github.com/yurenchen000/howto.sh/wiki)
### 2. usage demo
```console
$ howto find files modified today
== cmd is: find / -type f -mtime 0
$ find / -type f -mtime 0 <### this line auto-inputed by howto.sh, omitted in later
$ howto git clone use ssh:// for 'ssh android@localhost -p 4022' /tmp/test1
$ <### sometime i forget the git url scheme
== cmd is: git clone ssh://android@localhost:4022/tmp/test1
$ howto convert demo2.gif to demo2.mp4, frame rate 30, twitter compatible
$ <### i guess no one remember all the parameters
== cmd is: ffmpeg -i demo2.gif -vf "fps=30,scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -pix_fmt yuv420p demo2.mp4
```
note1:
AI may make mistakes, check before pressing Enter
note2:
deepseek query is slow (about 4 seconds)
> TIPS: `Ctrl + G` will prepend `howto` cmd and query
### 3. use ctrl+g completion
```bash
bind -x '"\C-g": "c_howto"'
```
//this will show howto in cli & history
OR
```bash
bind -x '"\C-g": "c_howto2"'
```
//this not show howto in cli & history
then input the search string, for example:
$ find files modified today
then press `Ctrl+G` to trigger completion
## Other Bash Script
[](https://github.com/yurenchen000/yurenchen000/blob/main/repos.md#bash-scripts)