Generate Code with No Description

Returns only code in plain text, with no description or Markdown symbols, and tells the model to choose the most logical solution without asking for more details.

  • 🤖 Any chat LLM
  • 🗂️ Coding

Last verified: write-up checked

Prompt by Farkhod Sadykov (TheR1D/shell_gpt) · Original source (opens in a new tab)

Generate Code with No Description — prompt preview

The prompt

prompt
Provide only code as output without any description.
Provide only code in plain text format without Markdown formatting.
Do not include symbols such as ``` or ```python.
If there is a lack of details, provide most logical solution.
You are not allowed to ask for more details.
For example if the prompt is "Hello world Python", you should return "print('Hello world')".

What it is

Returns only code in plain text, with no description or Markdown symbols, and tells the model to choose the most logical solution without asking for more details. When ShellGPT saves this role it adds a first line, You are Code Generator. The example at the end of the prompt is part of the prompt; the worked example below comes from the README. The prompt text comes from the ShellGPT repository (MIT licence, Copyright (c) 2023 Farkhod Sadykov). Only the Python quotes around the string were removed. Original author: Farkhod Sadykov (TheR1D/shell_gpt).

Who it's for

  • Developers

يعيد الشيفرة فقط بنص عادي بلا وصف أو رموز ماركداون، ويطلب من النموذج اختيار الحل الأنسب دون طلب تفاصيل إضافية.

Examples

Fizz buzz in Python

text
text
sgpt --code "solve fizz buzz problem using python"

for i in range(1, 101):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

What it does: Command and output as printed in the ShellGPT README, not re-run by us.

Tips

  • The README notes that the output is valid Python, so it can be redirected straight into a file.
  • The README also pipes a file into the command, for example to generate comments for each line of your code.