|
| 1 | +# src prompts create |
| 2 | + |
| 3 | +Create a new prompt in your Sourcegraph instance. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```bash |
| 8 | +src prompts create [flags] |
| 9 | +``` |
| 10 | + |
| 11 | +## Examples |
| 12 | + |
| 13 | +```bash |
| 14 | +# Create a basic prompt (uses current user as owner) |
| 15 | +src prompts create \ |
| 16 | + -name="go-error-handling" \ |
| 17 | + -description="Best practices for Go error handling" \ |
| 18 | + -content="Write a Go function that properly handles errors..." |
| 19 | + |
| 20 | +# Create a prompt with tags |
| 21 | +src prompts create \ |
| 22 | + -name="python-optimization" \ |
| 23 | + -description="Python performance optimization tips" \ |
| 24 | + -content="Optimize this Python code for better performance..." \ |
| 25 | + -tags="UHJvbXB0VGFnOjE=,UHJvbXB0VGFnOjI=" |
| 26 | + |
| 27 | +# Create a draft prompt |
| 28 | +src prompts create \ |
| 29 | + -name="draft-prompt" \ |
| 30 | + -description="Work in progress prompt" \ |
| 31 | + -content="This prompt is still being developed..." \ |
| 32 | + -draft |
| 33 | + |
| 34 | +# Create a recommended prompt with auto-submit |
| 35 | +src prompts create \ |
| 36 | + -name="recommended-prompt" \ |
| 37 | + -description="A recommended prompt for common use" \ |
| 38 | + -content="This is a recommended prompt..." \ |
| 39 | + -recommended \ |
| 40 | + -auto-submit |
| 41 | + |
| 42 | +# Create a secret prompt for INSERT mode |
| 43 | +src prompts create \ |
| 44 | + -name="secret-insert-prompt" \ |
| 45 | + -description="Secret prompt for code insertion" \ |
| 46 | + -content="Insert code here..." \ |
| 47 | + -visibility="SECRET" \ |
| 48 | + -mode="INSERT" |
| 49 | + |
| 50 | +# Create a prompt with explicit owner (optional) |
| 51 | +src prompts create \ |
| 52 | + -name="team-shared-prompt" \ |
| 53 | + -description="A prompt shared with a specific owner" \ |
| 54 | + -content="This prompt has an explicit owner..." \ |
| 55 | + -owner="VXNlcjox" |
| 56 | +``` |
| 57 | + |
| 58 | +## Flags |
| 59 | + |
| 60 | +| Flag | Description | |
| 61 | +|------|-------------| |
| 62 | +| `-name` | The prompt name (required) | |
| 63 | +| `-description` | Description of the prompt (required) | |
| 64 | +| `-content` | The prompt template text content (required) | |
| 65 | +| `-owner` | The ID of the owner (user or organization) (optional, defaults to current user) | |
| 66 | +| `-tags` | Comma-separated list of tag IDs | |
| 67 | +| `-draft` | Whether the prompt is a draft (default: false) | |
| 68 | +| `-visibility` | Visibility of the prompt: PUBLIC or SECRET (default: "PUBLIC") | |
| 69 | +| `-auto-submit` | Whether the prompt should be automatically executed in one click (default: false) | |
| 70 | +| `-mode` | Mode to execute prompt: CHAT, EDIT, or INSERT (default: "CHAT") | |
| 71 | +| `-recommended` | Whether the prompt is recommended (default: false) | |
| 72 | + |
| 73 | +### API flags |
| 74 | + |
| 75 | +| Flag | Description | |
| 76 | +|------|-------------| |
| 77 | +| `-dump-requests` | Log GraphQL requests and responses to stdout | |
| 78 | +| `-get-curl` | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) | |
| 79 | +| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains | |
| 80 | +| `-trace` | Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing | |
| 81 | +| `-user-agent-telemetry` | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default: true) | |
0 commit comments