Amazon Q developer cheatsheet learnt


Few commands

q help
q settings
q whoami
Enter fullscreen mode

Exit fullscreen mode



Learn the Core Workflows

As a professional, you’ll use Q mostly for code assistance + AWS workflows.

🔑 Core commands you should master:

  • q generate → generate or refactor code
  • q explain → explain existing code
  • q test → write or improve unit tests
  • q run → execute code
  • q fix → debug/resolve errors
  • q ask → general-purpose Q&A (like ChatGPT but AWS/dev focused)

q chat --resume

explain app/models/user.rb

generate rspec tests for app/models/mev.rb

ask "list all s3 buckets in my account"

test app/models/user.rb

fix "DB connection error in database.yml file"

ask “where in this project do we send emails?”



Go deeper

  1. Always run Q inside your project root so it reads your code.
  2. Be specific → “generate a Rails service object for sending user notification email” > “generate email code.”
  3. refine to refine the answer given by q, if you do not believe q in first instance
  4. Security mindset: Do not copy blindly



AWS Pro Workflows

Q to speed up AWS development:

Infra as Code (Pulumi/CDK/Terraform)

q chat --resume

| ask "command to list all ec2 instances in ap-southeast-1"

will give the bash command for using with aws-cli

| generate pulumi code in yaml for listing all ec2 instances in ap-southeast-1

Will create the Pulumi.dv.yaml

Now pulumi up will help to list down the instances

NB: When you give prompt, explain more to get more accurate result, q will behave like a senior developer

Example:

generate s3 upload code
vs

generate rails service object UploadFileService with method call(file:, bucket:) using aws-sdk-s3 gem, include unit tests with rspec



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *