Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cli/references/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Most commands require that the user first [authenticate](quickstart#connect-to-s
* [`repos`](references/repos)
* [`scout`](references/scout)
* [`search`](references/search)
* [`search-jobs`](references/search-jobs)
* [`serve-git`](references/serve-git)
* [`snapshot`](references/snapshot)
* [`teams`](references/teams)
Expand Down
41 changes: 41 additions & 0 deletions docs/cli/references/search-jobs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# src search-jobs

<p className="subtitle">`src search-jobs` is a tool that manages search jobs in a Sourcegraph instance.</p>

## Usage

```bash
'src search-jobs' is a tool that manages search jobs on a Sourcegraph instance.

Usage:

src search-jobs command [command options]

The commands are:

cancel cancels a search job by ID
create creates a search job
delete deletes a search job by ID
get gets a search job by ID
list lists search jobs
logs fetches logs for a search job by ID
restart restarts a search job by ID
results fetches results for a search job by ID

Common options for all commands:
-c Select columns to display (e.g., -c id,query,state,username)
-json Output results in JSON format

Use "src search-jobs [command] -h" for more information about a command.
```

## Sub-commands

* [cancel](search-jobs/cancel)
* [create](search-jobs/create)
* [delete](search-jobs/delete)
* [get](search-jobs/get)
* [list](search-jobs/list)
* [logs](search-jobs/logs)
* [restart](search-jobs/restart)
* [results](search-jobs/results)
34 changes: 34 additions & 0 deletions docs/cli/references/search-jobs/cancel.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# src search-jobs cancel

<p className="subtitle">`src search-jobs cancel` is a tool that cancels a search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs cancel':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Cancel a search job by ID:

$ src search-jobs cancel U2VhcmNoSm9iOjY5

Arguments:
The ID of the search job to cancel.

The cancel command stops a running search job and outputs a confirmation message.
```
40 changes: 40 additions & 0 deletions docs/cli/references/search-jobs/create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# src search-jobs create

<p className="subtitle">`src search-jobs create` is a tool that creates a search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs create':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Create a search job:

$ src search-jobs create "repo:^github\.com/sourcegraph/sourcegraph$ sort:indexed-desc"

Create a search job and display specific columns:

$ src search-jobs create "repo:sourcegraph" -c id,state,username

Create a search job and output in JSON format:

$ src search-jobs create "repo:sourcegraph" -json

Available columns are: id, query, state, username, createdat, startedat, finishedat,
url, logurl, total, completed, failed, inprogress
```
32 changes: 32 additions & 0 deletions docs/cli/references/search-jobs/delete.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# src search-jobs delete

<p className="subtitle">`src search-jobs delete` is a tool that deletes a search job on a Sourcegraph instance.</p>

```bash
Usage of 'src search-jobs delete':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Delete a search job by ID:

$ src search-jobs delete U2VhcmNoSm9iOjY5

Arguments:
The ID of the search job to delete.

The delete command permanently removes a search job and outputs a confirmation message.
```
40 changes: 40 additions & 0 deletions docs/cli/references/search-jobs/get.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# src search-jobs get

<p className="subtitle">`src search-jobs get` is a tool that gets details of a single search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs get':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Get a search job by ID:

$ src search-jobs get U2VhcmNoSm9iOjY5

Get a search job with specific columns:

$ src search-jobs get U2VhcmNoSm9iOjY5 -c id,state,username

Get a search job in JSON format:

$ src search-jobs get U2VhcmNoSm9iOjY5 -json

Available columns are: id, query, state, username, createdat, startedat, finishedat,
url, logurl, total, completed, failed, inprogress
```
62 changes: 62 additions & 0 deletions docs/cli/references/search-jobs/list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# src search-jobs list

<p className="subtitle">`src search-jobs list` is a tool that lists search jobs on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs list':
-asc
Sort search jobs in ascending order
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-limit int
Limit the number of search jobs returned (default 10)
-order-by string
Sort search jobs by a sortable field (QUERY, CREATED_AT, STATE) (default "CREATED_AT")
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

List all search jobs:

$ src search-jobs list

List all search jobs in ascending order:

$ src search-jobs list --asc

Limit the number of search jobs returned:

$ src search-jobs list --limit 5

Order search jobs by a field (must be one of: QUERY, CREATED_AT, STATE):

$ src search-jobs list --order-by QUERY

Select specific columns to display:

$ src search-jobs list -c id,state,username,createdat

Output results as JSON:

$ src search-jobs list -json

Combine options:

$ src search-jobs list --limit 10 --order-by STATE --asc -c id,query,state

Available columns are: id, query, state, username, createdat, startedat, finishedat,
url, logurl, total, completed, failed, inprogress
```
36 changes: 36 additions & 0 deletions docs/cli/references/search-jobs/logs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# src search-jobs logs

<p className="subtitle">`src search-jobs logs` is a tool that gets the logs of a search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs logs':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-out string
File path to save the logs (optional)
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

View the logs of a search job:
$ src search-jobs logs U2VhcmNoSm9iOjY5

Save the logs to a file:
$ src search-jobs logs U2VhcmNoSm9iOjY5 -out logs.csv

The logs command retrieves the raw log data in CSV format. The data will be
displayed on stdout or written to the file specified with -out.
```
40 changes: 40 additions & 0 deletions docs/cli/references/search-jobs/restart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# src search-jobs restart

<p className="subtitle">`src search-jobs restart` is a tool that restarts a search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs restart':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Restart a search job by ID:

$ src search-jobs restart U2VhcmNoSm9iOjY5

Restart a search job and display specific columns:

$ src search-jobs restart U2VhcmNoSm9iOjY5 -c id,state,query

Restart a search job and output in JSON format:

$ src search-jobs restart U2VhcmNoSm9iOjY5 -json

Available columns are: id, query, state, username, createdat, startedat, finishedat,
url, logurl, total, completed, failed, inprogress
```
37 changes: 37 additions & 0 deletions docs/cli/references/search-jobs/results.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# src search-jobs results

<p className="subtitle">`src search-jobs results` is a tool that gets the results of a search job on a Sourcegraph instance.</p>

## Usage

```bash
Usage of 'src search-jobs results':
-c string
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")
-dump-requests
Log GraphQL requests and responses to stdout
-get-curl
Print the curl command for executing this query and exit (WARNING: includes printing your access token!)
-insecure-skip-verify
Skip validation of TLS certificates against trusted chains
-json
Output results as JSON for programmatic access
-out string
File path to save the results (optional)
-trace
Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing
-user-agent-telemetry
Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default true)

Examples:

Get the results of a search job:
$ src search-jobs results U2VhcmNoSm9iOjY5

Save search results to a file:
$ src search-jobs results U2VhcmNoSm9iOjY5 -out results.jsonl

The results command retrieves the raw search results in JSON Lines format.
Each line contains a single JSON object representing a search result. The data
will be displayed on stdout or written to the file specified with -out.
```