|
1 | | -# `src search-jobs create` |
2 | | - |
3 | | -## Flags |
4 | | - |
5 | | -| Name | Description | Default Value | |
6 | | -|------|-------------|---------------| |
7 | | -| `-dump-requests` | Log GraphQL requests and responses to stdout | `false` | |
8 | | -| `-f` | Format for the output using Go text/template syntax | `\{\{\.ID\}\}: \{\{\.Creator.Username\}\} \{\{\.State\}\} (\{\{\.Query\}\})` | |
9 | | -| `-get-curl` | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) | `false` | |
10 | | -| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains | `false` | |
11 | | -| `-query` | Search query (required) | | |
12 | | -| `-trace` | Log the trace ID for requests. [See docs](/admin/observability/tracing) | `false` | |
13 | | -| `-user-agent-telemetry` | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph | `true` | |
| 1 | +# src search-jobs create |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +`src search-jobs create` is a tool that creates a search job on a Sourcegraph instance. |
| 6 | + |
14 | 7 | ## Usage |
15 | 8 |
|
16 | 9 | ``` |
17 | 10 | Usage of 'src search-jobs create': |
| 11 | + -c string |
| 12 | + Comma-separated list of columns to display. Available: id,query,state,username,createdat,startedat,finishedat,url,logurl,total,completed,failed,inprogress (default "id,username,state,query") |
18 | 13 | -dump-requests |
19 | 14 | Log GraphQL requests and responses to stdout |
20 | | - -f string |
21 | | - Format for the output, using the syntax of Go package text/template. (e.g. "{{.ID}}: {{.Creator.Username}} ({{.Query}})" or "{{.|json}}") (default "{{.ID}}: {{.Creator.Username}} {{.State}} ({{.Query}})") |
22 | 15 | -get-curl |
23 | 16 | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) |
24 | 17 | -insecure-skip-verify |
25 | 18 | Skip validation of TLS certificates against trusted chains |
26 | | - -query string |
27 | | - Search query |
| 19 | + -json |
| 20 | + Output results as JSON for programmatic access |
28 | 21 | -trace |
29 | 22 | Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing |
30 | 23 | -user-agent-telemetry |
31 | 24 | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true) |
32 | 25 |
|
33 | | -Examples: |
| 26 | + Examples: |
| 27 | +
|
| 28 | + Create a search job: |
| 29 | +
|
| 30 | + $ src search-jobs create "repo:^github\.com/sourcegraph/sourcegraph$ sort:indexed-desc" |
34 | 31 |
|
35 | | - Create a search job: |
| 32 | + Create a search job and display specific columns: |
36 | 33 |
|
37 | | - $ src search-jobs create -query "repo:^github\.com/sourcegraph/sourcegraph$ sort:indexed-desc" |
38 | | -``` |
| 34 | + $ src search-jobs create "repo:sourcegraph" -c id,state,username |
| 35 | +
|
| 36 | + Create a search job and output in JSON format: |
| 37 | +
|
| 38 | + $ src search-jobs create "repo:sourcegraph" -json |
| 39 | +
|
| 40 | + Available columns are: id, query, state, username, createdat, startedat, finishedat, |
| 41 | + url, logurl, total, completed, failed, inprogress |
| 42 | +``` |
0 commit comments