Wrapper ของ AWS CLI ที่ช่วยให้คุณหลีกเลี่ยงข้อผิดพลาดและหลุมพรางทั่วไปด้วยโมเดลภาษาขนาดใหญ่ของ Amazon Bedrock โดยตรวจสอบอาร์กิวเมนต์คำสั่งของคุณเทียบกับเอกสารคำสั่ง
ในฐานะผู้ใช้ AWS บางครั้งการดำเนินการคำสั่ง CLI ที่พบทางออนไลน์หรือคัดลอกมาจากแหล่งต่างๆ เช่น Stack Overflow โดยไม่ตั้งใจ อาจนำไปสู่ผลลัพธ์ที่ไม่ได้ตั้งใจ ข้อมูลสูญหาย สูญเสียทางการเงิน หรือความเสี่ยงด้านความปลอดภัย
safeaws-cli
ช่วยให้คุณดำเนินการคำสั่ง AWS ได้อย่างมั่นใจโดยใช้ประโยชน์จากโมเดลภาษา AI ของ Amazon Bedrock เพื่อวิเคราะห์คำสั่ง CLI ดึงข้อความช่วยเหลือ และระบุปัญหาหรือข้อกังวลที่อาจเกิดขึ้นก่อนดำเนินการ ด้วยการมอบเครือข่ายความปลอดภัยที่ช่วยลดข้อผิดพลาด safeaws-cli
ช่วยให้ผู้ใช้สำรวจ AWS ได้อย่างปลอดภัย ส่งเสริมแนวทางการทำงานกับ CLI ที่มีข้อมูลมากขึ้น
แต่แน่นอนว่าการใช้โมเดล GenAI มาพร้อมกับค่าใช้จ่าย ประเมินก่อนใช้งาน!
python3 -m pip install boto3
SAFEAWS_BEDROCK_MODEL_ID
ตัวแปร | คำอธิบาย | ค่าเริ่มต้น |
---|---|---|
SAFEAWS_AWS_PROFILE | โปรไฟล์ AWS ที่จะใช้ | None |
SAFEAWS_AWS_REGION | ภูมิภาค AWS ที่จะใช้สำหรับโมเดล Bedrock | us-east-1 |
SAFEAWS_BEDROCK_MODEL_ID | รหัสโมเดล Bedrock เพื่อใช้ตรวจสอบ AI | anthropic.claude-3-haiku-20240307-v1:0 |
SAFEAWS_ANTHROPIC_VERSION | เวอร์ชัน Anthropic API | bedrock-2023-05-31 |
SAFEAWS_MODEL_MAX_TOKENS | โทเค็นสูงสุดที่จะสร้าง | 1024 |
SAFEAWS_TEMPERATURE | อุณหภูมิสำหรับ LLM | 0.5 |
สำหรับการตรวจสอบสิทธิ์กับ Amazon Bedrock แม้ว่าไม่แนะนำ คุณยังสามารถตั้งค่าคีย์การเข้าถึง AWS และคีย์ลับในตัวแปรสภาพแวดล้อม AWS_ACCESS_KEY_ID
และ AWS_SECRET_ACCESS_KEY
ได้
เพื่อความปลอดภัย ขอแนะนำให้ตั้งค่า sso-session
และใช้ตัวแปรสภาพแวดล้อม AWS_PROFILE
เพื่อตรวจสอบสิทธิ์
#! /bin/bash
sudo curl https://raw.githubusercontent.com/gabrielkoo/safeaws-cli/main/safeaws.py
-o /usr/local/bin/safeaws &&
sudo chmod +x /usr/local/bin/safeaws
หากต้องการใช้ safeaws-cli
เพียงเติมคำสั่ง AWS CLI ของคุณด้วย safeaws
:
safeaws <aws-cli-command>
ตัวอย่างเช่น:
> safeaws s3 cp file.txt s3://my-bucket/path/
The provided command appears to be correct and complete. However, here are a few points to consider:
1. Ensure that the file 'file.txt' exists in the local directory from where the command is being executed.
2. Verify that the S3 bucket 'my-bucket' and the 'path/' prefix exist, and that you have the necessary permissions to upload the file to that location.
3. Consider adding the '--acl' parameter to set the appropriate access control list (ACL) for the uploaded object, if required.
4. Evaluate whether any additional metadata, such as content-type or cache-control, should be set for the uploaded object using the respective parameters.
5. Assess if the default storage class ('STANDARD') is appropriate for your use case, and consider using a different storage class if necessary.
Do you want to execute the command? (y/N) y
<Execution results shown here>
สคริปต์จะดึงข้อความช่วยเหลือสำหรับคำสั่ง AWS CLI ที่ให้มา ส่งพร้อมกับอาร์กิวเมนต์คำสั่งไปยังโมเดล Bedrock ที่ระบุ และแสดงปัญหาหรือข้อกังวลที่อาจเกิดขึ้นซึ่งระบุโดย AI จากนั้นคุณจะได้รับแจ้งให้ยืนยันว่าคุณต้องการดำเนินการคำสั่งหรือไม่