CLI argument parser generator prompt
Describe your command-line tool's flags and arguments and get parser boilerplate with help text and validation included.
متى تستخدم هذا البرومبت
- When starting a new command-line tool or internal script.
- When adding new flags to an existing CLI.
- When switching argument-parsing libraries.
نص البرومبت
Generate boilerplate for a {{language}} CLI tool using {{framework}} that accepts: {{focus}}. Include help text and basic input validation.
{{CLIPBOARD}}{{language}}{{framework}}{{focus}}{{CLIPBOARD}}الكتلة {{CLIPBOARD}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».
كيف تستخدمه
- انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
- الصقه في ChatGPT أو Claude أو Gemini.
- عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.
مثال على النتيجة
import argparse
parser = argparse.ArgumentParser(description='Sync local files to remote')
parser.add_argument('--source', required=True, help='Source directory path')
parser.add_argument('--dry-run', action='store_true', help='Preview without making changes')
args = parser.parse_args()نصائح للاستخدام
- List every flag with its type and whether it's required, rather than describing loosely.
- Name your preferred library (argparse, click, commander, clap) for idiomatic output.
- Ask for a --help usage example to sanity-check the generated flag names.
أسئلة شائعة
- Can it generate subcommands, not just flat flags?
- Yes, describe the subcommands you need (e.g. tool sync, tool status) in the focus field and it will structure them accordingly.
- Does it include input validation?
- Basic validation like required fields and type checks are included by default; ask for stricter custom validation if needed.