This commit is contained in:
zhiqiang feng
2025-12-29 13:38:39 +08:00
commit 1a4aa9a660
579 changed files with 388880 additions and 0 deletions
@@ -0,0 +1,337 @@
---
title: "A collection of prompts for generating high quality code..."
source: "https://www.reddit.com/r/ChatGPTCoding/comments/1f51y8s/a_collection_of_prompts_for_generating_high/"
author:
- "[[LorestForest]]"
published: 2024-08-31
created: 2025-11-06
description:
tags:
- "clippings"
---
I wrote an [SOP](https://www.reddit.com/r/ClaudeAI/comments/1f0ya1t/i_used_claude_to_write_an_sop_for_using_claude/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) recently for creating software with the help of LLMs like ChatGPT or Claude. A lot of people found it helpful so I wanted to share some more prompt-related ideas for generating code.  
The prompts offered below work much better if you set up a proper foundation for your program before-hand (i.e. provide the AI with more context, as detailed in the SOP), so please be sure to take a look at that first if you haven't already.  
# My Standard Prompt for Code Generation 
Here's my go-to template for requesting code:  
I need to implement \[specific functionality\] in \[programming language\].
Key requirements:
1. \[Requirement 1\]
2. \[Requirement 2\]
3. \[Requirement 3\]
Please consider:
- Error handling
- Edge cases
- Performance optimization
- Best practices for \[language/framework\]
Please do not unnecessarily remove any comments or code.
Generate the code with clear comments explaining the logic.
This structured approach helps the AI understand exactly what you need and consider important aspects that you might forget to mention explicitly.  
# Reviewing and Understanding AI-Generated Code 
Never, ever blindly copy-paste AI-generated code into your project. Ask for an explanation first. Trust me. This will save you considerable debugging time and you will also learn a thing or two in the process.  
Here's a prompt I use for getting explanations:  
Can you explain the following part of the code in detail:
\[paste code section\]
Specifically:
1. What is the purpose of this section?
2. How does it work step-by-step?
3. Are there any potential issues or limitations with this approach?
# Using AI for Code Reviews and Improvements 
AI is great for catching issues you might miss and suggesting improvements.  
Try this prompt for code review:  
Please review the following code:
\[paste your code\]
Consider:
1. Code quality and adherence to best practices
2. Potential bugs or edge cases
3. Performance optimizations
4. Readability and maintainability
5. Any security concerns
Suggest improvements and explain your reasoning for each suggestion.
# Prompt Ideas for Various Coding Tasks 
For implementing a specific algorithm:  
Implement a \[name of algorithm\] in \[programming language\]. Please include:
1. The main function with clear parameter and return types
2. Helper functions if necessary
3. Time and space complexity analysis
4. Example usage
For creating a class or module:  
Create a \[class/module\] for \[specific functionality\] in \[programming language\].
Include:
1. Constructor/initialization
2. Main methods with clear docstrings
3. Any necessary private helper methods
4. Proper encapsulation and adherence to OOP principles
For optimizing existing code:  
Here's a piece of code that needs optimization:
\[paste code\]
Please suggest optimizations to improve its performance. For each suggestion, explain the expected improvement and any trade-offs.
For writing unit tests:  
Generate unit tests for the following function:
\[paste function\]
Include tests for:
1. Normal expected inputs
2. Edge cases
3. Invalid inputs
Use \[preferred testing framework\] syntax.
---
I've written a much more detailed guide on creating software with AI-assistance [here](https://aalapdavjekar.medium.com/02484af85dd7) which you might find more helpful.  
As always, I hope this lets you make the most out of your LLM of choice. If you have any suggestions on improving some of these prompts, do let me know!  
Happy coding!  
---
## Comments
> **\[已删除\]** • [0 points](https://reddit.com/) •
>
> Glad you found it useful!
>
> Could you elaborate on what you mean by a UI for the prompt? Do you want to create a front-end application specifically for the purpose of generating code? If so, I think a better approach would be to create a something like a framework for creating AI-generated software using a step-by-step approach as detailed in my SOP. Let me know if that makes sense.
>
> > **LorestForest** • [4 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkubbvx/) •
> >
> > Glad you found it useful!
> >
> > Could you elaborate on what you mean by a UI for the prompt? Do you want to create a front-end application specifically for the purpose of generating code? If so, I think a better approach would be to create a something like a framework for creating AI-generated software using a step-by-step approach as detailed in my SOP. Let me know if that makes sense.
> **ai\_did\_my\_homework** • [5 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/llda49d/) •
>
> We've gone full circle to the early days of GPT-3 when people were sharing entire libraries of prompts  
> **cosmic\_timing** • [4 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/ll3qluw/) •
>
> What's the next step after being rate limited? I prompt incessantly high level prompts and it just straight up fatigues out. Almost verbatim copy pastes what I say after a certain point  
>
> > **cosmic\_timing** • [2 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/ll414ut/) •
> >
> > Nevermind, playground pretty much solved my challenge in the first go  
> **Adi2Hot** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkr1ybl/) •
>
> Thank you  
> **UsernameOmitted** • [\-6 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkq73fa/) •
>
> If you use Cursor, it merges the code automatically and refers to your codebase, so prompt crafting is barely needed. You just ask for the functionality you want, merge it and go.
>
> > **\[已删除\]** • [0 points](https://reddit.com/) •
> >
> > I love how hot you came into this. Calm down there bud lol. Cursor is great. I can like it and not work there. The five most successful programmers I know use it in their daily flow. Have you ever merged someone elses code using GIT? Its exactly the same thing, except its machine written. You can decline to merge it and ask it to refine the code.
> >
> > ![评论图像](https://preview.redd.it/a-collection-of-prompts-for-generating-high-quality-code-v0-01qi0pcvevld1.jpeg?width=320&crop=smart&auto=webp&s=1f610dc4dc1f2d23ab7d7fe0a75b40ea3f04bc1c)
> >
> > > **UsernameOmitted** • [\-2 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkqmodi/) •
> > >
> > > I love how hot you came into this. Calm down there bud lol. Cursor is great. I can like it and not work there. The five most successful programmers I know use it in their daily flow. Have you ever merged someone elses code using GIT? Its exactly the same thing, except its machine written. You can decline to merge it and ask it to refine the code.
> > >
> > > ![评论图像](https://preview.redd.it/a-collection-of-prompts-for-generating-high-quality-code-v0-01qi0pcvevld1.jpeg?width=320&crop=smart&auto=webp&s=1f610dc4dc1f2d23ab7d7fe0a75b40ea3f04bc1c)
> > >
> > > > **\[已删除\]** • [0 points](https://reddit.com/) •
> > > >
> > > > qq, what is your workflow for using AI to generate code?
> > > >
> > > > > **old\_news\_forgotten** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkrhmwj/) •
> > > > >
> > > > > qq, what is your workflow for using AI to generate code?
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkpu2sd/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [0 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkpu2tw/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [0 points](https://reddit.com/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lkrvnqk/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lvze9sz/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/lvzea0u/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/m671fa8/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/m671fbg/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mbggb27/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mbggb38/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mbgges2/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mbggeti/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mdg0i1b/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mdg0i3x/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **Heavy\_Dinner7647** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mdn5qvo/) •
>
> This is extremely insightful. Thanks for the tip !  
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/meon1z8/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/meon20r/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/miggspc/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/miggss6/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mry1koi/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mry1kr0/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mwqhgra/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mwqhgtq/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **Pure\_City\_4985** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/mym5zv4/) •
>
> this is goated
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/n0xwf1f/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/n0xwf4b/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/n7f9xga/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/n7f9xi9/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
> **\[已删除\]** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/nizk7s0/) •
>
> Sorry, your submission has been removed due to inadequate account karma.
>
> *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
>
> > **AutoModerator** • [1 points](https://reddit.com/r/ChatGPTCoding/comments/1f51y8s/comment/nizk7u6/) •
> >
> > Sorry, your submission has been removed due to inadequate account karma.
> >
> > *I am a bot, and this action was performed automatically. Please* [*contact the moderators of this subreddit*](https://www.reddit.com/message/compose/?to=/r/ChatGPTCoding) *if you have any questions or concerns.*
@@ -0,0 +1,61 @@
---
title: "Centos 7 真是低配小鸡的福音! - V2EX"
source: "https://v2ex.com/t/1117168#reply10"
author:
- "[[V2EX]]"
published: 2025-03-10
created: 2025-03-10
description: "Linux - @Tounea - 之前买了一个 1 核 512MB 的小鸡,安装 debian 11 系统,发现启动某些服务,结果服务死活起不来,最后查看内核日志,发现是被系统进程 kill 掉了,原因是可用内存不足,一看系统内存,已"
tags:
- "clippings"
---
[首页](https://v2ex.com/) [注册](https://v2ex.com/signup) [登录](https://v2ex.com/signin)
**V2EX = way to explore** V2EX 是一个关于分享和探索的地方
[现在注册](https://v2ex.com/signup) 已注册用户请  [登录](https://v2ex.com/signin)
**Distributions** [Ubuntu](http://www.ubuntu.com/) [Fedora](http://fedoraproject.org/) [CentOS](http://www.centos.org/) **中文资源站** [网易开源镜像站](http://mirrors.163.com/)
[V2EX](https://v2ex.com/)    [Linux](https://v2ex.com/go/linux)   [Tounea](https://v2ex.com/member/Tounea) · 1 小时 27 分钟前 · 826 次点击
之前买了一个 1 核 512MB 的小鸡,安装 debian 11 系统,发现启动某些服务,结果服务死活起不来,最后查看内核日志,发现是被系统进程 kill 掉了,原因是可用内存不足,一看系统内存,已用内存 230M ,可用内存 96M ,这还只是开机后的状态,装 ubuntu 14.04 也是差不多的情况,后面干脆直接吃灰快大半年。
上周末闲着无事,就尝试用 Centos 7 构建那服务,好多服务不能直接 yum ,直接编译安装各种组件坑了我大半天,结果运行还真跑起来了。
Centos 7 启动后已使用内存只占 86M ,可用内存还有 200M 多 M ,最后服务跑起来才占 100 多 M 内存,Centos 7 果然是香!!!
这是内存使用率截图
[![](https://i.imgur.com/Vt3TnKr.png)](https://i.imgur.com/Vt3TnKr.png)
[centos](https://v2ex.com/tag/centos) [memory](https://v2ex.com/tag/memory) [Performance](https://v2ex.com/tag/Performance)
8 条回复  **•**  2025-03-10 11:31:05 +08:00
| | | 1 **[w568w](https://v2ex.com/member/w568w)**      1 小时 13 分钟前 这小鸡确实有点太小了,我一般装 alpine ,最新版的内存占用大概在 50M 左右。 \> 好多服务不能直接 yum ,直接编译安装各种组件坑了我大半天 既然都用 centos 7 了,不如试一下 almalinux 和 centos stream ,内存占用应该差不多。自己编译还是太麻烦了。 |
| --- | --- | --- |
| | | 2 **[MoeDisk](https://v2ex.com/member/MoeDisk)**      33 分钟前 FreeBSD 也行,而且适合养老,服务挂号几年不用管没问题( |
| --- | --- | --- |
| | | 3 **[LuminousKK](https://v2ex.com/member/LuminousKK)**      27 分钟前 抛开使用难度的话,alpine 或者 debian i686 是最适合低配(<512M )机器的 |
| --- | --- | --- |
| | | 4 **[adoal](https://v2ex.com/member/adoal)**      17 分钟前 CentOS 7 是 2014 首发的,对应的 Debian 版本是 7 到 8 之间。 |
| --- | --- | --- |
| | | 5 **[duzhuo](https://v2ex.com/member/duzhuo)**      14 分钟前 这么小内存能够干嘛 |
| --- | --- | --- |
| | | 6 **[DinnyXu](https://v2ex.com/member/DinnyXu)**      11 分钟前 1C512M ? 太小了吧...只能跑个前端的静态文件啥都 |
| --- | --- | --- |
| | | 7 **[totoro625](https://v2ex.com/member/totoro625)**      7 分钟前 两台阿里云 T6 就是买的 512mb 内存版本,到手 401mb 安装官方的 debian12 ,跑了 frp+ufw+一些简单的监控程序,已用内存 137mb 、168mb ,可用内存 263mb 、231mb 太小内存的机器千万不要安装太多程序,尤其是 docker |
| --- | --- | --- |
| | | 8 **[moefishtang](https://v2ex.com/member/moefishtang)**      5 分钟前 @[duzhuo](https://v2ex.com/member/duzhuo) 搭代理,转发网络流量还是可以的 500M 的带宽跑满了 cpu 占用大概在 50~60 ,内存占用 70 (开了 swap 的情况下) |
| --- | --- | --- |
**[关于](https://v2ex.com/about)   ·   [帮助文档](https://v2ex.com/help)   ·   [博客](https://blog.v2ex.com/)   ·   [API](https://v2ex.com/help/api)   ·   [FAQ](https://v2ex.com/faq)   ·   [实用小工具](https://v2ex.com/tools)   ·   5456 人在线**   最高记录 6679   ·     [Select Language](https://v2ex.com/select/language) 创意工作者们的社区 World is powered by solitude VERSION: 3.9.8.5 · 26ms · [UTC 03:36](https://v2ex.com/worldclock#utc) · [PVG 11:36](https://v2ex.com/worldclock#pvg) · [LAX 20:36](https://v2ex.com/worldclock#lax) · [JFK 23:36](https://v2ex.com/worldclock#jfk)
Developed with [CodeLauncher](https://cl.v2ex.pro/)
♥ Do have faith in what you're doing.
@@ -0,0 +1,328 @@
---
title: "How to create your own testing framework using ChatGPT?"
source: "https://cloudqa.io/gpt-prompts-test-case-generation-qa-automation-2025/"
author:
- "[[Syna]]"
published: 2025-09-03
created: 2025-11-06
description: "Self Healing Tests | The Ultimate Guide to GPT Prompts for Test Case Generation in 2025 | Create Robust | CloudQA"
tags:
- "clippings"
---
*Ready to supercharge your QA process? Discover how CloudQAs AI-powered, codeless platform can integrate seamlessly with modern techniques like GPT-driven test case generation.* ***[Explore the Future of QA Today](https://app.cloudqa.io/Account/Register?source=MainHeader "What are the Best Automatic Test Case Generation Tools Available? Qa Automation").***
### Introduction: The AI Revolution in Quality Assurance
The world of Quality Assurance (QA) is in the midst of an AI-driven revolution. While ChatGPT introduced the world to the power of Large Language Models (LLMs), the landscape has since exploded with a new generation of powerful and specialized AI. For QA teams, this evolution presents an unprecedented opportunity to move beyond the slow, manual, and often inconsistent process of creating test cases.
The conversation is no longer just about one model; its about a diverse ecosystem of AI tools that can be leveraged to create comprehensive, high-quality test suites with incredible speed. This guide serves as a complete introduction to this new era, exploring how modern LLMs from Google, Anthropic, OpenAI, and others are being used for test case generation. We will cover how to choose the right AI partner, craft effective prompts for any model, and strategically integrate this technology into your QA automation strategy for 2025 and beyond.
This section explores the practical challenges QA teams face with manual and scriptless test case creation, including:
- Lengthy development cycles for test case writing and updates
- Incomplete or inconsistent test coverage leading to defects in production
- Difficulties in maintaining and scaling test suites as applications evolve
- The perennial problem of flaky tests and associated maintenance overhead
This shift not only improves test efficiency but also enriches QA workflows, enabling teams to focus on strategic testing and exploratory efforts.
Curious about taking your test automation to the next level?
Join CloudQAs webinar on “Revolutionizing Test Case Generation with GPT” and get hands-on tips!
[Register Now](https://cloudqa.io/webinars/gpt-automation "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")
![qa automation, regression test cases](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03073915/visual-selection-12-768x478.png)
### The Manual Bottleneck: Why Test Case Generation Needs an Upgrade
A **test case** is the fundamental building block of quality assurance—a sequence of steps designed to verify a specific piece of software functionality. The quality of a product is directly tied to the quality and comprehensiveness of its test suite.
Traditionally, creating these test cases has been a manual, labor-intensive process. A QA engineer or business analyst would:
- Meticulously read through product requirement documents (PRDs) or user stories.
- Manually identify all possible user scenarios, including positive paths, negative paths, and edge cases.
- Write out each test case step-by-step in a test management tool.
This process is not only slow but also prone to human error and inconsistency. It often struggles to keep pace with rapid development, leading to gaps in test coverage and a higher risk of bugs slipping into production.
![qa automation, self healing tests](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074924/visual-selection-13-768x747.png)
### The Rise of LLMs in QA: A Look Beyond ChatGPT
The public release of ChatGPT demonstrated that AI could understand context and generate human-like text, immediately showing its potential for tasks like test case creation. However, the field is advancing at an exponential rate. The modern QA professional now has access to a wide array of LLMs, each with unique strengths.
This new ecosystem includes:
- **General-Purpose Powerhouses:** Highly advanced models that can reason, create, and process information across a vast range of topics.
- **Code-Specific LLMs:** Models that are specifically trained on billions of lines of code, making them experts in programming languages and software logic.
- **Integrated AI in QA Platforms:** A growing trend where QA tool vendors embed or fine-tune these powerful LLMs directly into their platforms, creating a seamless, context-aware user experience.
Instead of manually analyzing requirements, a QA professional provides the AI with the context,such as a user story, a feature description, or a piece of code,and asks it to generate relevant test cases. The AI leverages its vast training data to understand the context, identify potential scenarios, and output a structured list of test cases that can be used for both manual and automated testing. This transforms the role of the QA professional from a manual scribe into a strategic orchestrator, guiding the AI to produce the desired quality artifacts.
A prompt is more than just a query. It can be framed as a scenario, role, requirement, or checklist, and its quality will directly impact the relevance and accuracy of the generated test cases. The most effective prompts are those that precisely communicate the context, constraints, and expectations for a test scenario—whether it be functional UI coverage, API endpoint validation, boundary testing, or complex user journeys.
### Choosing Your AI Partner: A Guide to Modern LLMs for QA
Selecting the right AI model depends on your specific needs, from generating high-level business scenarios to writing unit test code.
#### General-Purpose Powerhouses
These models are your go-to for understanding user stories and generating functional, end-to-end, and exploratory test ideas.
- **OpenAIs GPT-4 and GPT-4o:** Still the industry benchmark for complex reasoning, nuance, and creativity. Excellent for generating detailed test scenarios, edge cases, and BDD feature files from business requirements.
- **Googles Gemini Family (Pro and Ultra):** Known for its massive context window and powerful multimodal capabilities. Gemini can analyze screenshots of a UI alongside a user story to generate even more relevant test cases.
- **Anthropics Claude Series (Claude 3 Opus, Sonnet):** A strong competitor with a large context window and a focus on reliability and enterprise-grade safety. Its an excellent choice for generating tests from lengthy and complex technical documentation.
#### Code-Specific LLMs
These are ideal for more technical tasks, like generating unit tests or simple automation scripts.
- **GitHub Copilot:** Powered by OpenAIs models, it lives directly in your code editor (IDE) and can suggest test code in real-time as developers write new functions.
- **Open-Source Models (e.g., Code Llama):** For teams with privacy concerns or the desire to fine-tune a model on their own codebase, open-source models offer a powerful and flexible alternative.
### The Art of the Prompt: Universal Principles for Any LLM
While different models may have slight nuances, the principles of effective prompt engineering are universal. The quality of your AI-generated output is a direct reflection of the quality of your input.
- **Assign a Role:** Begin your prompt by telling the AI who to be (e.g., “Act as a principal SDET…”). This sets the context and tone for a professional response.
- **Provide Rich Context:** This is the most critical step. Paste the complete user story, acceptance criteria, technical specification, or even a snippet of code. The more relevant details the LLM has, the more accurate its output will be.
- **Be Explicit in Your Task:** Use clear, direct action verbs. Dont ask it to “think about” test cases; instruct it to “Generate a comprehensive list of…”
- **Define the Output Format:** To get a structured and immediately usable response, specify the format you want. Ask for a table with named columns, a numbered list, or code formatted in Gherkin for BDD.
By mastering these elements, you can guide the AI to become a highly efficient test case generation engine.
### Practical GPT Prompts for Every Testing Scenario
Here are some practical, real-world examples of GPT prompts you can adapt for your own projects.
#### A. Generating Functional Test Cases from a User Story
This is the most common use case. The goal is to ensure a feature works as intended.
**The Prompt:**
Act as a senior QA engineer. Based on the following user story, generate a comprehensive set of functional test cases in a table format with the columns: “Test Case ID,” “Test Scenario,” “Test Steps,” and “Expected Result.”
**User Story:**
As a registered user on an e-commerce website, I want to be able to add a product to my shopping cart from the product details page so that I can purchase it later.
**Acceptance Criteria:**
1. The product details page must display an “Add to Cart” button.
2. Clicking the “Add to Cart” button should add the selected item to the users cart.
3. A confirmation message, “Product added to cart successfully,” should appear.
4. The cart icon in the header should update to show the new number of items.
5. If the item is already in the cart, the button should still be clickable, and the quantity in the cart should be updated.
#### B. Identifying Edge Cases and Negative Scenarios
GPT excels at thinking of scenarios that a human tester might overlook.
**The Prompt:**
Act as a meticulous QA tester responsible for ensuring application robustness. For the user login functionality described below, identify and list all possible negative scenarios and edge cases. Focus on invalid inputs, boundary conditions, and unusual user behaviors.
**Functionality:**
A user login form with two fields: “Email” (must be a valid email format) and “Password” (must be at least 8 characters).
#### C. Creating Security-Focused Test Cases
You can leverage GPT to test for common vulnerabilities.
**The Prompt:**
Act as a cybersecurity analyst. For a new user registration form that accepts a username, email, and password, generate a list of security-focused test cases to check for common vulnerabilities like SQL Injection and Cross-Site Scripting (XSS).
#### D. Generating BDD Scenarios in Gherkin Format
For teams practicing Behavior-Driven Development (BDD), GPT can write the Gherkin feature files for you.
**The Prompt:**
Act as a BDD automation specialist. Based on the following feature description for a search functionality, write the Gherkin feature file with multiple “Scenario” blocks covering both positive and negative tests.
**Feature: Product Search**
As a user, I want to be able to search for products by name so that I can easily find what Im looking for.
![qa automation, self healing automation](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074910/visual-selection-15-768x457.png)
Prompt engineering is the foundation of effective AI-powered test case creation. As QA automation enters a new era driven by large language models, the quality of your results depends on the clarity, structure, and intent behind your prompts. For QA teams aiming to maximize the value of your LLM of choice, mastering best practices in prompt engineering can yield measurable improvements in efficiency, coverage, and reliability.
**Clarity and Specificity:
**Ambiguous or overly broad prompts can lead to generic, incomplete, or error-prone test cases. Instead, high-performing QA teams craft prompts that are precise and focused—mentioning the feature under test, input data, expected outcomes, and any relevant constraints. For example, rather than “Create tests for login,” a best-practice prompt might be: “Generate positive and negative test cases for a login form requiring email and password. Include validations for valid credentials, invalid email formats, missing fields, and password length constraints.”
**Structure and Delimiters:
**Break complex requests into step-by-step instructions using delimiters (like numbered lists or bullet points). This encourages AI to output organized, actionable test cases and helps avoid missed requirements. For instance, listing test data, expected result, and setup steps separately clarifies intent and ensures all bases are covered.
**Iterative Refinement and Feedback Loops:
**Prompt engineering is rarely a “write-once” task. QA professionals should review AI-generated output, identify where prompts require more context or detail, and iteratively refine their wording. Over time, this feedback loop builds more accurate, domain-specific prompt libraries that boost productivity and test quality.
**Role-Based and Persona Prompts:
**Assigning a persona to the AI, such as “Act as a senior QA engineer” or “Assume the role of a security analyst,” helps tailor responses to specific test design philosophies or business needs. Role-based prompting has become an industry best practice for generating specialized test assets.
**Data-Driven and Structured Output:
**Providing concrete data or requesting specific output formats (like JSON or tables) further aligns results with automation tool requirements. Always specify if you need outputs in a format like Gherkin, markdown tables, or step-by-step instructions to improve integration and downstream usability.
**Versioning & Collaboration:
**Store and version your most successful prompts. Share them in a central repository so team members can reuse and adapt proven patterns. Integrated tools and prompt management platforms help QA teams optimize their workflows as new test coverage needs emerge.
![qa and automation, qa automation](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074903/visual-selection-16-768x697.png)
In 2025, QA success increasingly hinges on how well teams can connect AI-powered test case generation with robust automation frameworks. Integrating GPT-driven prompt outputs with tools like Playwright, WebdriverIO, and CloudQA ensures a seamless transition from natural language requirements to actionable, executable, and version-controlled test assets.
## From Prompt to Practically Automated Tests
Step 1: Generate Test Cases Using GPT Prompts
Begin by supplying a clear, focused prompt to your preferred LLM. For instance, describe a login workflow or an API endpoint. Well-structured prompts especially those with explicit field requirements or validation steps yield detailed, reusable test cases. The AI model can generate outputs in different formats, such as Gherkin, step-by-step instructions, or even direct code snippets for Playwright or WebdriverIO.
Step 2: Integrate with Playwright and WebdriverIO
Modern test frameworks like Playwright and WebdriverIO are designed for easy script integration. Many GPT-powered tools can export or format test cases directly into JavaScript, TypeScript, or Python code compatible with these frameworks. You can copy/paste, import files, or use API bridges to flow generated tests straight into your automation suite:
- Example: “Create a Playwright script to test invalid login attempts on the login page, with all edge case validations.”
- Review and tweak the AI-generated code for precise selector use and application context.
Step 3: Leverage CloudQAs Native AI Capabilities
CloudQA enables users to define test steps in natural language and converts them directly into maintainable, scriptless automation flows. By pairing CloudQAs interface with your growing prompt library, teams can rapidly build up reusable test scenarios—no hand-coding required. All prompts, test results, and artifacts can be collaboratively managed in the CloudQA platform, encouraging best practice sharing and knowledge reuse.
Step 4: Organize and Maintain Prompt Outputs
Storing prompt outputs alongside regular test scripts promotes transparency, traceability, and easy versioning. Organize test artifacts in a dedicated repository or use built-in project management tools available through your automation provider.
![qa and automation, automatic test case generation tools](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074849/visual-selection-17-1024x352.png)
Selecting the right automation tool to maximize the benefits of GPT-powered test case generation is critical for QA teams aiming to excel in 2025. Playwright, WebdriverIO, and CloudQA represent three prominent options, each offering distinctive strengths in prompt integration, test automation capabilities, and developer experience.
## Playwright
Playwright, developed by Microsoft, excels as a modern, open-source framework built for cross-browser testing with native support for Chromium, Firefox, and WebKit. It features an intuitive API, auto-wait mechanisms, and parallel test execution, which help QA teams handle complex app scenarios efficiently. Playwright allows developers to directly incorporate AI-generated test scripts by accepting code snippets in JavaScript, TypeScript, or Python formats. Moreover, Playwrights trace viewer enhances debugging, which is invaluable when refining GPT-generated tests to ensure stability and accuracy.
Strengths:
- Fast execution with event-driven architecture
- Supports multiple programming languages
- Strong cross-browser and device testing capabilities
- Native support for prompt-based automated test script integration
Considerations:
- Primarily developer-centric; requires JavaScript/TypeScript proficiency
- Smaller community compared to Selenium ecosystem but rapidly growing
## WebdriverIO
WebdriverIO is a versatile open-source automation framework that offers excellent extensibility and integration with numerous testing services. It supports TypeScript and JavaScript and provides plugins and service integrations that facilitate direct use of AI-generated test cases. WebdriverIOs flexible architecture works well for teams using prompt engineering to generate test scripts that support UI, API, and mobile app automation.
Strengths:
- Robust plugin ecosystem enabling broad integrations
- Supports both Selenium and DevTools protocols
- Flexible, easy to integrate with AI and prompt-based tools
- Strong community support
Considerations:
- Slightly steeper learning curve and configuration effort
- Requires managing Selenium Grid or equivalent for parallel execution
## CloudQA
CloudQA offers a codeless, AI-powered end-to-end automation platform that natively supports natural language test case creation using GPT prompts. Its scriptless interface allows QA analysts, even those without programming backgrounds, to rapidly generate, execute, and maintain prompt-based test scenarios. CloudQA also supports seamless collaboration and shared prompt libraries, enhancing team productivity and accelerating test coverage expansion.
Strengths:
- No-code platform ideal for business and manual testers
- AI-driven prompt engineering integration from the ground up
- Easy test maintenance with AI self-healing capabilities
- Collaboration-driven prompt and test case management
Considerations:
- Less suitable for teams requiring extensive custom scripting
- Pricing models vary depending on usage and team size
## Summary Table
| **Feature** | **Playwright** | **WebdriverIO** | **CloudQA** |
| --- | --- | --- | --- |
| Language Support | JavaScript, TypeScript, Python | JavaScript, TypeScript | Codeless, natural language |
| AI Prompt Integration | Code snippet import | Flexible plugin support | Native GPT prompt interface |
| Cross-browser Support | Chromium, Firefox, WebKit | Selenium compatible | Web-focused with cloud scaling |
| User Skill Level | Developer-centric | Developer-centric | Business and manual testers |
| Parallel Execution | Yes | Yes | Yes |
| Community Support | Growing | Large | Growing |
| Ideal For | Developer teams, complex testing | Flexible automation teams | Non-coders, fast deployment |
The theoretical benefits of GPT-powered prompt engineering come alive in real-world applications where QA teams achieve measurable improvements in test coverage, reliability, and productivity. This section highlights three case studies featuring organizations that have embraced GPT prompts integrated with Playwright, WebdriverIO, and CloudQA automation, demonstrating the practical impact of this innovative approach.
## Case Study 1: SaaS Company Boosts Test Coverage and Developer Confidence
A fast-growing SaaS provider struggled with maintaining comprehensive regression suites as their application rapidly evolved. By adopting GPT prompt engineering, their QA team generated over 50 reusable test case prompts tailored for API and UI scenarios. Automating test case creation with Playwright scripts enabled a 35% increase in test coverage and reduced manual scripting time by 60%. The prompts ensured consistent and detailed test cases across releases, helping developers catch bugs earlier and improve release stability.
## Case Study 2: Reducing Flaky Tests with Iterative Prompt Refinement
A financial services firm faced significant challenges with flaky UI tests causing false positives and slowing deployments. Using CloudQAs AI-driven platform, the team harnessed GPT prompts with role-based scenarios to systematically generate robust, context-aware test cases. They implemented iterative prompt refinement cycles that cut flaky test rates by 45%, resulting in less downtime and smoother CI automation. Prompt versioning and collaboration features enabled quick sharing of best practices across the QA team.
## Case Study 3: Expanding Mobile and Cross-Browser Coverage
A mobile app developer needed a scalable approach to test on multiple devices and browsers but had limited automation expertise. By leveraging WebdriverIO with GPT prompt-based test case generation, their team developed a library of data-driven and device-specific prompts. This enabled broad test case creation for diverse user interactions and edge conditions with minimal scripting. The result was a 50% reduction in manual test effort and faster release cycles without compromising user experience quality.
![qa and automation, regression test cases](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074843/visual-selection-18-768x829.png)
### The Strategic Benefits of AI-Driven Test Generation
Integrating LLMs into your QA process offers transformative advantages:
- **Accelerated Speed:** Reduce the time it takes to create a comprehensive test suite from days to minutes.
- **Deeper Coverage:** Leverage the AIs ability to identify complex scenarios and edge cases that a human might miss.
- **Improved Consistency:** Enforce a standard format for all test cases, making your test suite easier to manage and maintain.
- **Enhanced Collaboration:** Use AI-generated test cases as a clear, structured baseline for discussions between developers, QA, and product owners to ensure everyone is aligned.
![qa and automation, self healing tests](https://d1ax5wqehib729.cloudfront.net/wp-content/uploads/2025/09/03074918/visual-selection-14-768x768.png)
### Limitations and Best Practices: A Realistic Framework
LLMs are powerful partners, not perfect oracles. A strategic approach requires acknowledging their limitations and adhering to best practices.
**Limitations:**
- **No Business Context:** An LLM does not understand your companys unique business risks, user personas, or long-term goals.
- **Data Privacy:** Using public versions of these tools means your data is sent to a third-party server. Never paste highly sensitive, proprietary, or customer data into a public LLM interface.
**Best Practices:**
- **Human Oversight is Non-Negotiable:** Always treat AI-generated content as a first draft. A skilled QA professional must review, refine, and prioritize the test cases based on their domain knowledge.
- **Use Enterprise-Grade Solutions for Sensitive Data:** If you need to use proprietary information, use enterprise-grade versions of these LLMs (e.g., Azure OpenAI Service, Google Clouds Vertex AI) which offer data privacy and security guarantees.
- **Iterate and Refine:** Dont be discouraged if the first response isnt perfect. Tweak your prompt, add more context, and try again. Prompt engineering is an iterative skill.
### Conclusion: Your Future as an AI-Powered QA Strategist
The role of the QA professional is evolving. The future is not about being replaced by AI, but about learning to leverage it as a powerful collaborator. The tedious task of manual test case writing is being automated, freeing up human testers to focus on what they do best: strategic thinking, exploratory testing, risk analysis, and creative problem-solving. By mastering the art of prompting and strategically choosing from the diverse ecosystem of modern LLMs, you can elevate your role, supercharge your teams efficiency, and become a key driver of quality in this new era of software development.
### Frequently Asked Questions (FAQs)
- **Q1: Which LLM is “best” for QA and test generation?**
- There is no single “best” model. It depends on the task. For understanding business requirements and generating functional scenarios, a powerful general-purpose model like GPT-4o, Claude 3, or Gemini is ideal. For generating unit tests or automation code, a code-specific model like GitHub Copilot might be more efficient.
- **Q2: Is it safe to paste my companys proprietary code or user stories into these AI models?**
- It is **not safe** to paste sensitive or proprietary information into the public, free versions of these tools. For company use, you must use an enterprise-grade solution that provides a private, secure instance and guarantees that your data will not be used for training.
- **Q3: Will these AI models make manual testing obsolete?**
- No. They will make the manual *creation of test case documents* largely obsolete. This will free up time for more valuable forms of manual testing, such as exploratory testing, usability testing, and accessibility testing, which rely on human intuition and empathy.
1. Boonstra, L. (2025). *Prompt Engineering*. Technical Whitepaper. [Link to PDF
](https://www.gptaiflow.com/assets/files/2025-01-18-pdf-1-TechAI-Goolge-whitepaper_Prompt%20Engineering_v4-af36dcc7a49bb7269a58b1c9b89a8ae1.pdf "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")A foundational resource explaining prompt design methodologies and optimization strategies for LLMs in software testing.
2. CloudQA Blog. (2025). *QA Automation Best Practices for 2025*. Practical guidance on leveraging AI, GPT prompts, and automation frameworks for next-gen QA success.
3. “Master Prompt Engineering: AI-Powered Software Testing Efficiency.” Aqua Cloud, 2025. [https://aqua-cloud.io/prompt-engineering-for-testers/
](https://aqua-cloud.io/prompt-engineering-for-testers/ "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Covers prompt crafting, iterative refinement, and common pitfalls with real examples focused on software testing.
4. “Best Practices for Prompt Engineering with the OpenAI API.” OpenAI Help Center, 2025. [https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api
](https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Formal best practices for prompt construction, few-shot learning, and model interaction techniques applicable to QA teams.
5. “The 2025 AI Testing Roadmap: 5 Moves Every QA Engineer Should Make.” LinkedIn Article by P. Kulkarni, 2025.
Insights on AI integration, self-healing tests, and future-proofing QA workflows with generative AI.
6. “Top 10 ChatGPT Prompts for Software Testing.” PractiTest, 2025. [https://www.practitest.com/resource-center/blog/chatgpt-prompts-for-software-testing/
](https://www.practitest.com/resource-center/blog/chatgpt-prompts-for-software-testing/ "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Practical prompt examples for various testing contexts, emphasizing GPT-driven automation.
7. “ChatGPT for Test Automation.” testRigor, 2025. [https://testrigor.com/chatgpt-for-test-automation/
](https://testrigor.com/chatgpt-for-test-automation/ "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Case studies and recommendations for applying GPT and AI in test automation workflows.
8. “Prompt Engineering in 2025: The Latest Best Practices.” News.Aakashg, 2025. [https://www.news.aakashg.com/p/prompt-engineering
](https://www.news.aakashg.com/p/prompt-engineering "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Comprehensive overview of evolving prompt engineering techniques key for 2025 and beyond.
9. “Future Trends in Prompt Engineering & QA Automation in 2025.” Refonte Learning, 2025. [https://www.refontelearning.com/blog/prompt-engineering-trends-2025-skills-youll-need-to-stay-competitive
](https://www.refontelearning.com/blog/prompt-engineering-trends-2025-skills-youll-need-to-stay-competitive "What are the Best Automatic Test Case Generation Tools Available? Qa Automation")Strategic outlook on AI prompt innovation shaping QA and software testing fields.
10. “Selenium vs Playwright vs WebdriverIO Archives.” CloudQA, 2025. Detailed tool comparisons for AI and GPT-powered test case integration in leading frameworks.
+152
View File
@@ -0,0 +1,152 @@
---
title: "API密钥管理 - NEW CLI"
source: "https://foxcode.rjj.cc/api-keys"
author:
published:
created: 2025-12-26
description: "创建和管理您的API访问密钥"
tags:
- "clippings"
---
## API密钥管理
创建和管理您的API访问密钥
### 各渠道可用额度
余额基数 $97.48
官渠CC满血 x6
9个模型
$16.25
预计可用额度
claude-opus-4-5-20251101 claude-opus-4-5 claude-haiku-4-5-20251001 claude-opus-4-1-20250805 claude-3-5-haiku-20241022 claude-3-7-sonnet-20250219 claude-sonnet-4-20250514 claude-sonnet-4-5-20250929 claude-opus-4-20250514
Azure官方CC x4
5个模型
$24.37
预计可用额度
claude-opus-4-5-20251101 claude-haiku-4-5-20251001 claude-opus-4-1-20250805 claude-sonnet-4-5-20250929 claude-opus-4-20250514
2API特价CC x1
3个模型
$97.48
预计可用额度
claude-sonnet-4-5-20250929 claude-haiku-4-5-20251001 claude-opus-4-5-20251101
AWS特价CC x0.25
14个模型
$389.91
预计可用额度
claude-opus-4-5 claude-opus-4-5-20251101 claude-opus-4-5-thinking claude-opus-4-5-20251101-thinking claude-sonnet-4-5 claude-sonnet-4-5-20250929 claude-sonnet-4-5-thinking claude-sonnet-4-5-20250929-thinking claude-haiku-4-5-20251001 claude-opus-4 claude-opus-4-20250514 claude-opus-4-1 claude-opus-4-1-20250805 claude-sonnet-4-20250514
AWS特价CC(思考) x0.25
10个模型
$389.91
预计可用额度
claude-opus-4-5 claude-opus-4-5-20251101 claude-sonnet-4-5 claude-sonnet-4-5-20250929 claude-haiku-4-5-20251001 claude-opus-4 claude-opus-4-20250514 claude-opus-4-1 claude-opus-4-1-20250805 claude-sonnet-4-20250514
### 您的API密钥
#### coding
活跃
创建时间: 2025年12月25日 08:43 最后使用: 2025年12月25日 22:44
`sk-ant-oat01••••••••••••••••iyAA`
### 使用教程
当前渠道: **AWS特价CC** https://code.newcli.com/claude/aws
> 该方案是用于官方客户端使用,如果安装了我们定制客户端可以忽略以下内容
>
> "
以下是 Windows、macOS 和 Linux 系统下设置 `ANTHROPIC_BASE_URL``ANTHROPIC_AUTH_TOKEN` 环境变量的详细方法:
---
### Windows 系统
#### 方法1:配置settings.json
- 创建 `~/.claude/settings.json` 文件,内容如下:
- vscode中插件使用,创建文件 ~/.claude/config.json
#### 方法2:临时设置(仅当前终端有效)
-**PowerShell****CMD** 中执行:
#### 方法3:永久设置(全局生效)
1. **图形界面**
- 右键「此电脑」→「属性」→「高级系统设置」→「环境变量」
- 在「用户变量」或「系统变量」中新建:
- 变量名: `ANTHROPIC_BASE_URL`
- 变量值: `https://code.newcli.com/claude/aws`
- 同样方法添加 `ANTHROPIC_AUTH_TOKEN`
2. **PowerShell 永久设置**
- 重启终端后生效。
---
### macOS 系统
#### 方法1:配置settings.json
- 创建 `~/.claude/settings.json` 文件,内容如下:
- vscode中插件使用,创建文件 ~/.claude/config.json
#### 方法2:临时设置(仅当前终端有效)
-**终端** 中执行:
#### 方法3:永久设置
1. 编辑 shell 配置文件(根据使用的 shell 选择):
2. 立即生效:
---
### Linux 系统
#### 方法1:配置settings.json
- 创建 `~/.claude/settings.json` 文件,内容如下:
#### 方法2:临时设置(仅当前终端有效)
-**终端** 中执行:
#### 方法3:永久设置
1. 编辑 shell 配置文件(根据使用的 shell 选择):
2. 立即生效:
---
### 通用验证方法
在所有系统中,可以通过以下命令验证是否设置成功: