Skip to content

Commit 903c0b4

Browse files
authored
Merge branch 'main' into marc/ci-release-artifact-checks
2 parents 4177d63 + 0d0128d commit 903c0b4

3 files changed

Lines changed: 52 additions & 39 deletions

File tree

‎.markdownlint-cli2.jsonc‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"config": {
3+
// Prose in this repo is not hard-wrapped.
4+
"MD013": false,
5+
// "Latest version" and friends repeat under each OS heading.
6+
"MD024": { "siblings_only": true },
7+
// The README floats a screenshot right and keeps an anchor that other repos link to.
8+
"MD033": { "allowed_elements": ["img", "a"] }
9+
}
10+
}

‎README.md‎

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
# [Sourcegraph](https://sourcegraph.com) CLI [![Build Status](https://github.com/sourcegraph/src-cli/workflows/Go%20CI/badge.svg)](https://github.com/sourcegraph/src-cli/actions?query=workflow%3A%22Go+CI%22) [![Go Report Card](https://goreportcard.com/badge/sourcegraph/src-cli)](https://goreportcard.com/report/sourcegraph/src-cli)
1+
# [Sourcegraph](https://sourcegraph.com) CLI [![Build Status](https://github.com/sourcegraph/src-cli/workflows/Go%20CI/badge.svg)](https://github.com/sourcegraph/src-cli/actions?query=workflow%3A%22Go+CI%22)
22

3-
<img src="https://user-images.githubusercontent.com/3173176/43567326-3db5f31c-95e6-11e8-9e74-4c04079c01b0.png" width=500 align=right>
3+
<img src="https://user-images.githubusercontent.com/3173176/43567326-3db5f31c-95e6-11e8-9e74-4c04079c01b0.png" alt="src search results in a terminal" width=500 align=right>
44

55
`src` is a command line interface to Sourcegraph:
66

77
- **Search & get results in your terminal**
88
- **Search & get JSON** for programmatic consumption
99
- Make **GraphQL API requests** with auth easily & get JSON back fast
10-
- Execute **[batch changes](https://sourcegraph.com/docs/batch_changes)**
10+
- Execute **[batch changes](https://sourcegraph.com/docs/batch-changes)**
1111
- **Manage & administrate** repositories, users, and more
1212
- **Easily convert src-CLI commands to equivalent curl commands**, just add --get-curl!
1313

14-
**Note:** Using Sourcegraph 3.12 or earlier? [See the older README](https://github.com/sourcegraph/src-cli/tree/3.11.2).
15-
1614
## Installation
1715

18-
Binary downloads are available on the [releases tab](https://github.com/sourcegraph/src-cli/releases), and through Sourcegraph.com. _If the latest version does not work for you,_ consider using the version compatible with your Sourcegraph instance instead.
16+
Download the latest version from the [releases page](https://github.com/sourcegraph/src-cli/releases), or from Sourcegraph.com using the commands below. If the latest version does not work with your Sourcegraph instance, download the version compatible with your Sourcegraph instance, as shown below.
1917

20-
### Installation: Mac OS
18+
### Installation: macOS
2119

2220
#### Latest version
2321

2422
```bash
25-
curl -L https://sourcegraph.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src
23+
curl -L https://sourcegraph.com/.api/src-cli/src_darwin_arm64 -o /usr/local/bin/src
2624
chmod +x /usr/local/bin/src
2725
```
2826

@@ -43,24 +41,22 @@ npm install -g @sourcegraph/src
4341
Replace `sourcegraph.example.com` with your Sourcegraph instance URL:
4442

4543
```bash
46-
curl -L https://sourcegraph.example.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src
44+
curl -L https://sourcegraph.example.com/.api/src-cli/src_darwin_arm64 -o /usr/local/bin/src
4745
chmod +x /usr/local/bin/src
4846
```
4947

50-
or, if you know the specific version to target, for example 3.43.2:
48+
or, if you know the specific version to target:
5149

5250
```bash
53-
brew install sourcegraph/src-cli/src-cli@3.43.2
51+
brew install sourcegraph/src-cli/src-cli@8.1.2687
5452
```
5553

5654
or with npm/npx:
5755

5856
```bash
59-
npx @sourcegraph/src@3.43.2 version
57+
npx @sourcegraph/src@8.1.2687 version
6058
```
6159

62-
> Note: Versioned formulas are available on Homebrew for Sourcegraph versions 3.43.2 and later.
63-
6460
### Installation: Linux
6561

6662
#### Latest version
@@ -70,6 +66,8 @@ curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/s
7066
chmod +x /usr/local/bin/src
7167
```
7268

69+
On an ARM host, replace `src_linux_amd64` with `src_linux_arm64`.
70+
7371
or with npm:
7472

7573
```bash
@@ -85,10 +83,10 @@ curl -L https://sourcegraph.example.com/.api/src-cli/src_linux_amd64 -o /usr/loc
8583
chmod +x /usr/local/bin/src
8684
```
8785

88-
or, with npm/npx, if you know the specific version to target, for example 3.43.2:
86+
or, with npm/npx, if you know the specific version to target:
8987

9088
```bash
91-
npx @sourcegraph/src@3.43.2 version
89+
npx @sourcegraph/src@8.1.2687 version
9290
```
9391

9492
### Installation: Windows
@@ -97,7 +95,7 @@ See [Sourcegraph CLI for Windows](WINDOWS.md).
9795

9896
### Installation: Docker
9997

100-
`sourcegraph/src-cli` is published to Docker Hub. You can use the `latest` tag or a specific version such as `3.43`. To see all versions view [sourcegraph/src-cli tags](https://hub.docker.com/r/sourcegraph/src-cli/tags).
98+
The [`sourcegraph/src-cli`](https://hub.docker.com/r/sourcegraph/src-cli/tags) image on Docker Hub is tagged with `latest` and with each release version.
10199

102100
```bash
103101
docker run --rm=true sourcegraph/src-cli:latest search 'hello world'
@@ -119,7 +117,7 @@ For PowerShell on Windows:
119117
$env:SRC_ENDPOINT = 'https://sourcegraph.example.com'
120118
```
121119

122-
For convenience, add this environment variable to your terminal profile or system environment variables. On Mac OS and Linux, the terminal profile is typically `~/.bash_profile` for Bash or `~/.zprofile` for Zsh. On Windows, you can add it through the *System Properties* window. See [these instructions](https://www.computerhope.com/issues/ch000549.htm) for details.
120+
For convenience, add this environment variable to your terminal profile or system environment variables. On macOS and Linux, the terminal profile is typically `~/.zprofile` for Zsh or `~/.bash_profile` for Bash. On Windows, you can add it through the *System Properties* window.
123121

124122
If `SRC_ENDPOINT` is not set, `src` defaults to `https://sourcegraph.com`.
125123

@@ -169,27 +167,32 @@ Is your Sourcegraph instance behind a custom auth proxy? See [auth proxy configu
169167

170168
`src` provides different subcommands to interact with different parts of Sourcegraph:
171169

172-
- `src login` - authenticate to a Sourcegraph instance with your user credentials
173-
- `src auth` - print the active authentication token or authorization header
174-
- `src search` - perform searches and get results in your terminal or as JSON
175-
- `src api` - run Sourcegraph GraphQL API requests
176-
- `src batch` - execute and manage [batch changes](https://sourcegraph.com/docs/batch_changes)
177-
- `src repos` - manage repositories
178-
- `src users` - manage users
179-
- `src orgs` - manages organization
180-
- `src config` - manage global, org, and user settings
181-
- `src extsvc` - manage external services (repository configuration)
182-
- `src extensions` - manage extensions
183-
- `src code-intel` - manages Code Intelligence data
184-
- `src serve-git` - serves your local git repositories over HTTP for Sourcegraph to pull
185-
- `src version` - check version and guaranteed-compatible version for your Sourcegraph instance
170+
- `src abc` - manage agentic batch changes
171+
- `src api` - run Sourcegraph GraphQL API requests
172+
- `src auth` - print the active authentication token or authorization header
173+
- `src batch` - execute and manage [batch changes](https://sourcegraph.com/docs/batch-changes)
174+
- `src code-intel` - manage code intelligence data
175+
- `src codeowners` - manage ingested code ownership data
176+
- `src config` - manage global, org, and user settings
177+
- `src debug` - gather and bundle debug data from a Sourcegraph deployment for troubleshooting
178+
- `src extsvc` - manage external services (repository configuration)
179+
- `src login` - authenticate to a Sourcegraph instance with your user credentials
180+
- `src lsp` - run a Language Server Protocol server that proxies requests to Sourcegraph code intelligence
181+
- `src orgs` - manage organizations
182+
- `src repos` - manage repositories
183+
- `src search` - perform searches and get results in your terminal or as JSON
184+
- `src search-jobs` - manage search jobs
185+
- `src serve-git` - serve your local git repositories over HTTP for Sourcegraph to pull
186+
- `src snapshot` - manage snapshots of Sourcegraph instance databases (experimental)
187+
- `src users` - manage users
188+
- `src version` - display and compare the `src` version against the recommended version for your Sourcegraph instance
186189

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

190-
#### Optional: Renaming `src`
193+
### Optional: Renaming `src`
191194

192-
If you have a naming conflict with the `src` command, such as a Bash alias, you can rename the static binary. For example, on Linux / Mac OS:
195+
If you have a naming conflict with the `src` command, such as a Bash alias, you can rename the static binary. For example, on Linux / macOS:
193196

194197
```sh
195198
mv /usr/local/bin/src /usr/local/bin/src-cli
@@ -203,13 +206,13 @@ You can then invoke it via `src-cli`.
203206

204207
## Telemetry
205208

206-
`src` includes the operating system and architecture in the `User-Agent` header sent to Sourcegraph. For example, running `src` version 3.21.10 on an x86-64 Linux host will result in this header:
209+
`src` includes the operating system and architecture in the `User-Agent` header sent to Sourcegraph. For example, running `src` on an x86-64 Linux host will result in this header:
207210

208-
```
209-
src-cli/3.21.10 linux amd64
211+
```text
212+
src-cli/8.1.2687 linux amd64
210213
```
211214

212-
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.
215+
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.
213216

214217
As with other Sourcegraph telemetry, any collected data is only sent to Sourcegraph.com in aggregate form.
215218

‎cmd/src/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ query ViewerUserID {
136136
}
137137

138138
if result.CurrentUser == nil || result.CurrentUser.ID == "" {
139-
return "", errors.New("unable to determine current user ID (see https://github.com/sourcegraph/src-cli#authentication)")
139+
return "", errors.New("unable to determine current user ID (see https://github.com/sourcegraph/src-cli#connect-to-your-sourcegraph-instance)")
140140
}
141141
return result.CurrentUser.ID, nil
142142
}

0 commit comments

Comments
 (0)