Skip to content

Commit 256a892

Browse files
committed
(cli) add src search-jobs documentation
1 parent 0b41120 commit 256a892

File tree

9 files changed

+266
-129
lines changed

9 files changed

+266
-129
lines changed
Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
1-
# `src search-jobs`
1+
# src search-jobs
2+
3+
## Overview
4+
5+
`src search-jobs` is a tool that manages search jobs in a Sourcegraph instance.
26

37
## Usage
48

59
```
610
'src search-jobs' is a tool that manages search jobs on a Sourcegraph instance.
711
8-
Usage:
12+
Usage:
13+
14+
src search-jobs command [command options]
15+
16+
The commands are:
917
10-
src search-jobs command [command options]
18+
cancel cancels a search job by ID
19+
create creates a search job
20+
delete deletes a search job by ID
21+
get gets a search job by ID
22+
list lists search jobs
23+
logs fetches logs for a search job by ID
24+
restart restarts a search job by ID
25+
results fetches results for a search job by ID
1126
12-
The commands are:
27+
Common options for all commands:
28+
-c Select columns to display (e.g., -c id,query,state,username)
29+
-json Output results in JSON format
1330
14-
cancel cancels a search job by ID
15-
create creates a search job
16-
delete deletes a search job by ID
17-
get gets a search job by ID
18-
list lists search jobs
31+
Use "src search-jobs [command] -h" for more information about a command.
1932
```
2033

21-
## Sub-Commands
34+
## Sub-commands
2235

23-
* [`cancel`](search-jobs/cancel)
24-
* [`create`](search-jobs/create)
25-
* [`delete`](search-jobs/delete)
26-
* [`get`](search-jobs/get)
27-
* [`list`](search-jobs/list)
36+
* [cancel](search-jobs/cancel)
37+
* [create](search-jobs/create)
38+
* [delete](search-jobs/delete)
39+
* [get](search-jobs/get)
40+
* [list](search-jobs/list)
41+
* [logs](search-jobs/logs)
42+
* [restart](search-jobs/restart)
43+
* [results](search-jobs/results)
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
# `src search-jobs cancel`
1+
# src search-jobs cancel
22

3-
## Flags
3+
## Overview
44

5-
| Name | Description | Default Value |
6-
|------|-------------|---------------|
7-
| `-dump-requests` | Log GraphQL requests and responses to stdout | `false` |
8-
| `-get-curl` | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) | `false` |
9-
| `-id` | ID of the search job to cancel | |
10-
| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains | `false` |
11-
| `-trace` | Log the trace ID for requests. [See docs](/admin/observability/tracing) | `false` |
12-
| `-user-agent-telemetry` | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph | `true` |
5+
`src search-jobs cancel` is a tool that cancels a search job on a Sourcegraph instance.
136

147
## Usage
158

169
```
1710
Usage of 'src search-jobs cancel':
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")
1813
-dump-requests
19-
Log GraphQL requests and responses to stdout
14+
Log GraphQL requests and responses to stdout
2015
-get-curl
21-
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
22-
-id string
23-
ID of the search job to cancel
16+
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
2417
-insecure-skip-verify
25-
Skip validation of TLS certificates against trusted chains
18+
Skip validation of TLS certificates against trusted chains
19+
-json
20+
Output results as JSON for programmatic access
2621
-trace
27-
Log the trace ID for requests. See https://sourcegraph.com/docs/admin/observability/tracing
22+
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
2823
-user-agent-telemetry
29-
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)
24+
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)
3025
31-
Examples:
26+
Examples:
3227
33-
Cancel a search job:
28+
Cancel a search job by ID:
3429
35-
$ src search-jobs cancel -id=123
36-
```
30+
$ src search-jobs cancel U2VhcmNoSm9iOjY5
31+
32+
Arguments:
33+
The ID of the search job to cancel.
34+
35+
The cancel command stops a running search job and outputs a confirmation message.
36+
```
Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
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+
147
## Usage
158

169
```
1710
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")
1813
-dump-requests
1914
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}})")
2215
-get-curl
2316
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
2417
-insecure-skip-verify
2518
Skip validation of TLS certificates against trusted chains
26-
-query string
27-
Search query
19+
-json
20+
Output results as JSON for programmatic access
2821
-trace
2922
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
3023
-user-agent-telemetry
3124
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)
3225
33-
Examples:
26+
Examples:
27+
28+
Create a search job:
29+
30+
$ src search-jobs create "repo:^github\.com/sourcegraph/sourcegraph$ sort:indexed-desc"
3431
35-
Create a search job:
32+
Create a search job and display specific columns:
3633
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+
```
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
1-
# `src search-jobs delete`
2-
3-
## Flags
4-
5-
| Name | Description | Default Value |
6-
|------|-------------|---------------|
7-
| `-dump-requests` | Log GraphQL requests and responses to stdout | `false` |
8-
| `-get-curl` | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) | `false` |
9-
| `-id` | ID of the search job to delete | |
10-
| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains | `false` |
11-
| `-trace` | Log the trace ID for requests. [See docs](https://docs.sourcegraph.com/admin/observability/tracing) | `false` |
12-
| `-user-agent-telemetry` | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph | `true` |
13-
14-
## Usage
1+
# src search-jobs delete
152

3+
## Overview
164

5+
`src search-jobs delete` is a tool that deletes a search job on a Sourcegraph instance.
176

187
```
198
Usage of 'src search-jobs delete':
9+
-c string
10+
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")
2011
-dump-requests
2112
Log GraphQL requests and responses to stdout
2213
-get-curl
2314
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
24-
-id string
25-
ID of the search job to delete
2615
-insecure-skip-verify
2716
Skip validation of TLS certificates against trusted chains
17+
-json
18+
Output results as JSON for programmatic access
2819
-trace
2920
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
3021
-user-agent-telemetry
3122
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)
3223
33-
Examples:
24+
Examples:
3425
35-
Delete a search job by ID:
26+
Delete a search job by ID:
3627
37-
$ src search-jobs delete U2VhcmNoSm9iOjY5
38-
39-
```
28+
$ src search-jobs delete U2VhcmNoSm9iOjY5
29+
30+
Arguments:
31+
The ID of the search job to delete.
32+
33+
The delete command permanently removes a search job and outputs a confirmation message.
34+
```
Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
1-
# `src search-jobs get`
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-
| `-id` | ID of the search job | |
11-
| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains | `false` |
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` |
14-
15-
## Usage
16-
1+
# src search-jobs get
172

3+
## Overview
184

5+
`src search-jobs get` is a tool that gets details of a single search job on a Sourcegraph instance.
196

207
## Usage
218

229
```
2310
Usage of 'src search-jobs get':
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")
2413
-dump-requests
2514
Log GraphQL requests and responses to stdout
26-
-f string
27-
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}})")
2815
-get-curl
2916
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
30-
-id string
31-
ID of the search job
3217
-insecure-skip-verify
3318
Skip validation of TLS certificates against trusted chains
19+
-json
20+
Output results as JSON for programmatic access
3421
-trace
3522
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
3623
-user-agent-telemetry
3724
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)
3825
39-
Examples:
26+
Examples:
4027
41-
Get a search job by ID:
28+
Get a search job by ID:
4229
43-
$ src search-jobs get U2VhcmNoSm9iOjY5
30+
$ src search-jobs get U2VhcmNoSm9iOjY5
4431
45-
```
32+
Get a search job with specific columns:
33+
34+
$ src search-jobs get U2VhcmNoSm9iOjY5 -c id,state,username
35+
36+
Get a search job in JSON format:
37+
38+
$ src search-jobs get U2VhcmNoSm9iOjY5 -json
39+
40+
Available columns are: id, query, state, username, createdat, startedat, finishedat,
41+
url, logurl, total, completed, failed, inprogress
42+
```

0 commit comments

Comments
 (0)