Skip to content

Instantly share code, notes, and snippets.

@mahdi-malv
Created December 2, 2023 23:56
Show Gist options
  • Save mahdi-malv/5a4859ffb551ca55d301bf14f2ed9611 to your computer and use it in GitHub Desktop.
Save mahdi-malv/5a4859ffb551ca55d301bf14f2ed9611 to your computer and use it in GitHub Desktop.
gptcli plugin to be a coding assistant
# Put it in ~/.config/gpt-cli/code/code.yml
# add an alias for simplicity
# alias 'c?'='gptcli code'
name: code
description: "AI assistant for code"
author: "mahdi-malv"
help: |
code ask plugin for gptcli
Usage:
❯ gpt code 'How can I get the length of a string in python?' L1
Note: You can also pass a level from L1 (shortest) to L5 (longest) - default: L1
steps:
- name: "ask ai answer"
uses: "gpt:createChatCompletion"
with:
messages:
- role: "user"
content: "You are a software programmer assistant. You get programming related questions and answer with code and technical details. If possible only answer with code and avoid extra explanations. You answer based on the depth level required (from L1, being the shortest and pricise to the L5, the most descriptive and verbose). If level wasn't specified, answer for L1 only. DO NOT MENTION WHAT LEVEL YOU ARE ANSWERING WITH"
- role: "user"
content: $params_all
export:
answer: ANSWER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment