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
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For quick end-to-end CLI sanity checks against a live Sourcegraph instance, run:

This script intentionally uses your currently exported `SRC_*` environment variables, is not hooked up to CI, and is meant for manual regression checks (for example, to catch issues like `src users list` failing unexpectedly).

We adhere to the [general Sourcegraph principles for testing](https://docs.sourcegraph.com/dev/background-information/testing_principles), as well as [the Go specific directions](https://docs.sourcegraph.com/dev/background-information/languages/testing_go_code), at least to the extent they apply to a standalone tool like `src`.
We adhere to the general Sourcegraph principles for testing, as well as the Go specific directions used in the main Sourcegraph repository, at least to the extent they apply to a standalone tool like `src`.

## Releasing

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- **Search & get results in your terminal**
- **Search & get JSON** for programmatic consumption
- Make **GraphQL API requests** with auth easily & get JSON back fast
- Execute **[batch changes](https://docs.sourcegraph.com/batch_changes)**
- Execute **[batch changes](https://sourcegraph.com/docs/batch_changes)**
- **Manage & administrate** repositories, users, and more
- **Easily convert src-CLI commands to equivalent curl commands**, just add --get-curl!

Expand Down Expand Up @@ -173,7 +173,7 @@ Is your Sourcegraph instance behind a custom auth proxy? See [auth proxy configu
- `src auth` - print the active authentication token or authorization header
- `src search` - perform searches and get results in your terminal or as JSON
- `src api` - run Sourcegraph GraphQL API requests
- `src batch` - execute and manage [batch changes](https://docs.sourcegraph.com/batch_changes)
- `src batch` - execute and manage [batch changes](https://sourcegraph.com/docs/batch_changes)
- `src repos` - manage repositories
- `src users` - manage users
- `src orgs` - manages organization
Expand All @@ -185,7 +185,7 @@ Is your Sourcegraph instance behind a custom auth proxy? See [auth proxy configu
- `src version` - check version and guaranteed-compatible version for your Sourcegraph instance

Run `src -h` and `src <subcommand> -h` for more detailed usage information.
You can also read the [usage docs for the latest version of `src-cli`](https://docs.sourcegraph.com/cli/references) online.
You can also read the [usage docs for the latest version of `src-cli`](https://sourcegraph.com/docs/cli/references) online.

#### Optional: Renaming `src`

Expand All @@ -211,7 +211,7 @@ src-cli/3.21.10 linux amd64

To disable this and _only_ send the version, you can set `-user-agent-telemetry=false` for a single command, or set the `SRC_DISABLE_USER_AGENT_TELEMETRY` environment variable to any non-blank string.

As with [other Sourcegraph telemetry](https://docs.sourcegraph.com/dev/background-information/telemetry), any collected data is only sent to Sourcegraph.com in aggregate form.
As with other Sourcegraph telemetry, any collected data is only sent to Sourcegraph.com in aggregate form.

## Development

Expand Down
2 changes: 1 addition & 1 deletion cmd/src/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Other tips:

Force color output on (not on by default when piped to other programs) by setting COLOR=t

Query syntax: https://docs.sourcegraph.com/code_search/reference/queries
Query syntax: https://sourcegraph.com/docs/code_search/reference/queries

Be careful with search strings including negation: a search with an initial
negated term may be parsed as a flag rather than as a search string. You can
Expand Down
2 changes: 1 addition & 1 deletion internal/api/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewFlags(flagSet *flag.FlagSet) *Flags {
return &Flags{
dump: flagSet.Bool("dump-requests", false, "Log GraphQL requests and responses to stdout"),
getCurl: flagSet.Bool("get-curl", false, "Print the curl command for executing this query and exit (WARNING: includes printing your access token!)"),
trace: flagSet.Bool("trace", false, "Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing"),
trace: flagSet.Bool("trace", false, "Log the trace ID for requests. See https://sourcegraph.com/docs/admin/observability/tracing"),
insecureSkipVerify: flagSet.Bool("insecure-skip-verify", false, "Skip validation of TLS certificates against trusted chains"),
userAgentTelemetry: flagSet.Bool("user-agent-telemetry", defaultUserAgentTelemetry(), "Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph"),
}
Expand Down
2 changes: 1 addition & 1 deletion internal/batches/ui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func printExecutionError(out *output.Output, err error) {
out.Write("")

block := out.Block(output.Line(output.EmojiLightbulb, output.StyleSuggestion, "The troubleshooting documentation can help to narrow down the cause of the errors:"))
block.WriteLine(output.Line("", output.StyleSuggestion, "https://docs.sourcegraph.com/batch_changes/references/troubleshooting"))
block.WriteLine(output.Line("", output.StyleSuggestion, "https://sourcegraph.com/docs/batch_changes/references/troubleshooting"))
block.Close()
}

Expand Down
2 changes: 1 addition & 1 deletion internal/clicompat/api_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func WithAPIFlags(baseFlags ...cli.Flag) []cli.Flag {
}{
{"dump-requests", false, "Log GraphQL requests and responses to stdout"},
{"get-curl", false, "Print the curl command for executing this query and exit (WARNING: includes printing your access token!)"},
{"trace", false, "Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing"},
{"trace", false, "Log the trace ID for requests. See https://sourcegraph.com/docs/admin/observability/tracing"},
{"insecure-skip-verify", false, "Skip validation of TLS certificates against trusted chains"},
{"user-agent-telemetry", defaultAPIUserAgentTelemetry(), "Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph"},
}
Expand Down
5 changes: 3 additions & 2 deletions internal/users/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ func (c *Client) GraphQL(token, query string, variables map[string]any, target a
if token != "" {
req.Header.Set("Authorization", fmt.Sprintf("token %s", token))
} else {
// NOTE: This header is required to authenticate our session with a session cookie, see:
// https://docs.sourcegraph.com/dev/security/csrf_security_model#authentication-in-api-endpoints
// NOTE: This header is required to authenticate our session with a session
// cookie. Sourcegraph's CSRF protection rejects cookie-authenticated API
// requests that do not carry this header.
req.Header.Set("X-Requested-With", "Sourcegraph")
req.AddCookie(c.sessionCookie)

Expand Down
Loading