• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

duq duq goose!

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
This is a submission for the

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

: Crushing the Command Line


What I Built


Dreading docstrings? Tired of writing boilerplate README files? Wish you could automate those tedious development tasks? Meet duq CLI (Developer Utility with Q) - a command-line tool that supercharges your development workflow by leveraging Amazon Q to handle the boring stuff.

duq CLI wraps the Amazon Q CLI with specialized prompt templates to automate common development tasks like:

  • Generating comprehensive README files for your projects
  • Adding proper docstrings to your code files
  • Creating test cases for your functions
  • Suggesting code refactoring improvements
  • Performing security analysis on your codebase

The best part? It maintains a backup system that lets you revert the most recent changes made with the duq CLI with a simple command, giving you the confidence to experiment with AI-powered code improvements.

Demo


Here's a quick example of how duq CLI can transform your workflow:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.





# Generate a README for your project
duq document ./my-project

# Add docstrings to a file
duq docstrings ./src/utils.js

# Generate test cases
duq test ./src/api.js

# Chain commands together
duq chain ./src/models.js "refactor,docstrings,test"

# Oops! Changed your mind? Revert the changes
duq revert
Code Repository



Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


or
try it for yourself by running npm install -g duq-cli

How I Used Amazon Q Developer


Amazon Q Developer was the secret sauce that made duq CLI possible. Aside from Amazon Q being the brains behind the operation, it was also a valuable asset in creating the CLI tool.

To test the efficacy of the idea, I thought it important to consider prompt engineering when initially speaking with Amazon Q.
Short or rushed prompts such as...
q chat "create a readme"
Returned responses like...
Q: I'd be more than happy to assist you in creating a README for your project. Please share the path to your project so that I can get started!
Continuing on the path of chaos...
Me: just do it
Q was able to handle this hasty response with ease, and began scanning through the directory in which the chat was started. Due to lack of instruction and poor prompting, Q wound up generating a README that was seemingly perfect and detailed. Upon further inspection, it turned out Q had hallucinated a file structure that didn't exist within the directory - or anywhere on the computer for that matter.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



It also seemed as if just because the word 'test' was in the directory name, Q incorrectly assumed that the whole project was for testing, when in reality, it was just a safe place to test out the duq CLI, that is, until duq revert was implemented.

Prompt engineering is definitely an important part of getting what you want out of any AI, and even more so with programming, it is just as important to give context. This is where the duq CLI really helps Amazon Q shine! Certain duq commands such as README take in a directory path, or if none is given, it will analyze the current directory. It feeds information to Q and gives it that ever-so-important context.

One important piece of insight I gained was that Amazon Q excels at understanding context and generating appropriate responses when given well-structured prompts. By designing my CLI to provide rich context (file contents, directory structures) along with clear instructions, I was able to get remarkably useful and consistent outputs.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу