diff --git a/docs/cli/references/index.mdx b/docs/cli/references/index.mdx index a7c433e00..bd1338247 100644 --- a/docs/cli/references/index.mdx +++ b/docs/cli/references/index.mdx @@ -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) diff --git a/docs/cli/references/search-jobs.mdx b/docs/cli/references/search-jobs.mdx new file mode 100644 index 000000000..af7c70abc --- /dev/null +++ b/docs/cli/references/search-jobs.mdx @@ -0,0 +1,41 @@ +# src search-jobs + +

`src search-jobs` is a tool that manages search jobs in a Sourcegraph instance.

+ +## 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) diff --git a/docs/cli/references/search-jobs/cancel.mdx b/docs/cli/references/search-jobs/cancel.mdx new file mode 100644 index 000000000..2573d41a1 --- /dev/null +++ b/docs/cli/references/search-jobs/cancel.mdx @@ -0,0 +1,34 @@ +# src search-jobs cancel + +

`src search-jobs cancel` is a tool that cancels a search job on a Sourcegraph instance.

+ +## 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. +``` diff --git a/docs/cli/references/search-jobs/create.mdx b/docs/cli/references/search-jobs/create.mdx new file mode 100644 index 000000000..30ade86ba --- /dev/null +++ b/docs/cli/references/search-jobs/create.mdx @@ -0,0 +1,40 @@ +# src search-jobs create + +

`src search-jobs create` is a tool that creates a search job on a Sourcegraph instance.

+ +## 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 +``` diff --git a/docs/cli/references/search-jobs/delete.mdx b/docs/cli/references/search-jobs/delete.mdx new file mode 100644 index 000000000..e4c5c5074 --- /dev/null +++ b/docs/cli/references/search-jobs/delete.mdx @@ -0,0 +1,32 @@ +# src search-jobs delete + +

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

+ +```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. +``` diff --git a/docs/cli/references/search-jobs/get.mdx b/docs/cli/references/search-jobs/get.mdx new file mode 100644 index 000000000..3d81730a7 --- /dev/null +++ b/docs/cli/references/search-jobs/get.mdx @@ -0,0 +1,40 @@ +# src search-jobs get + +

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

+ +## 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 +``` diff --git a/docs/cli/references/search-jobs/list.mdx b/docs/cli/references/search-jobs/list.mdx new file mode 100644 index 000000000..8d48ca178 --- /dev/null +++ b/docs/cli/references/search-jobs/list.mdx @@ -0,0 +1,62 @@ +# src search-jobs list + +

`src search-jobs list` is a tool that lists search jobs on a Sourcegraph instance.

+ +## 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 +``` diff --git a/docs/cli/references/search-jobs/logs.mdx b/docs/cli/references/search-jobs/logs.mdx new file mode 100644 index 000000000..af898e596 --- /dev/null +++ b/docs/cli/references/search-jobs/logs.mdx @@ -0,0 +1,36 @@ +# src search-jobs logs + +

`src search-jobs logs` is a tool that gets the logs of a search job on a Sourcegraph instance.

+ +## 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. +``` diff --git a/docs/cli/references/search-jobs/restart.mdx b/docs/cli/references/search-jobs/restart.mdx new file mode 100644 index 000000000..1849e8a67 --- /dev/null +++ b/docs/cli/references/search-jobs/restart.mdx @@ -0,0 +1,40 @@ +# src search-jobs restart + +

`src search-jobs restart` is a tool that restarts a search job on a Sourcegraph instance.

+ +## 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 +``` diff --git a/docs/cli/references/search-jobs/results.mdx b/docs/cli/references/search-jobs/results.mdx new file mode 100644 index 000000000..1f7e50ac9 --- /dev/null +++ b/docs/cli/references/search-jobs/results.mdx @@ -0,0 +1,37 @@ +# src search-jobs results + +

`src search-jobs results` is a tool that gets the results of a search job on a Sourcegraph instance.

+ +## 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. +```