Skip to content

Instantly share code, notes, and snippets.

@wesen

wesen/zsh.yaml Secret

Created April 5, 2023 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wesen/e02efb6c374c426654a565abda5e5592 to your computer and use it in GitHub Desktop.
Save wesen/e02efb6c374c426654a565abda5e5592 to your computer and use it in GitHub Desktop.
name: zsh
short: Autocomplete zsh
factories:
openai:
client:
timeout: 120
completion:
engine: gpt-3.5-turbo
temperature: 0.2
max_response_tokens: 1024
stream: true
arguments:
- name: input
type: stringFromFile
default: "-"
description: |
The input to the completion engine. If this is a file, it will be read
from the file. If this is a dash (-), it will be read from stdin.
prompt: |
Return a json list of possible completions for a zsh shell whose buffer history is:
```
{{ .input }}
```
Output a simple json list where each entry is a command line, and a description. No explanations, no prose, just json.
Example:
```json
[
{
"command": "gcc -O3 mouse.c -o mouse",
"description": "compile mouse.c with full optimization"
},
{
"command": "python3 entry_points.py",
"description": "run the entry_points.py script"
}
]
```
The command line entries should be valid zsh commands that correspond to what the user might want.
Suggest only useful commands, max 5 suggestions. Often, the user will specify a description
of what they want as a comment on the last line.
{{ if .request }}
Here is what the user is asking for: "{{ .request }}"
{{ end }}
Output a simple json list where each entry is a command line, and a description. No explanations, no prose, just json.%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment