All Projects → sourcegraph → Src Cli

sourcegraph / Src Cli

Licence: apache-2.0
Sourcegraph CLI

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Src Cli

Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+74.07%)
Mutual labels:  api, graphql, cli
Run
⚡The resource runtime
Stars: ✭ 90 (-16.67%)
Mutual labels:  api, cli
Graphql Portal
Configurable and distributed GraphQL Gateway. Convert your legacy data sources or monitor your existing GraphQL Services with a visual dashboard.
Stars: ✭ 88 (-18.52%)
Mutual labels:  api, graphql
N26
API and CLI to get information of your N26 account
Stars: ✭ 107 (-0.93%)
Mutual labels:  api, cli
Projectartemis
An analytic tool for GraphQL queries to external APIs with a Graphical User Interface to view performance metrics.
Stars: ✭ 84 (-22.22%)
Mutual labels:  api, graphql
Pypistats
Command-line interface to PyPI Stats API to get download stats for Python packages
Stars: ✭ 86 (-20.37%)
Mutual labels:  api, cli
Graphql Dotnetcore
GraphQL for .NET core based on https://github.com/graphql/graphql-js
Stars: ✭ 97 (-10.19%)
Mutual labels:  api, graphql
Hopp Doc Gen
📔 API documentation generator CLI for https://hoppscotch.io
Stars: ✭ 70 (-35.19%)
Mutual labels:  api, cli
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-8.33%)
Mutual labels:  api, cli
Graphql devise
GraphQL interface on top devise_token_auth
Stars: ✭ 100 (-7.41%)
Mutual labels:  api, graphql
Gql
Very simple CLI for many GraphQL schemas in the cloud. Provides autocompletion for GraphQL queries
Stars: ✭ 101 (-6.48%)
Mutual labels:  graphql, cli
Purescript Graphql
End to End typesafe GraphQL with PureScript
Stars: ✭ 79 (-26.85%)
Mutual labels:  api, graphql
Requent
A GraphQL like interface to map a request to eloquent query with data transformation for Laravel.
Stars: ✭ 78 (-27.78%)
Mutual labels:  api, graphql
Ariadne
Ariadne is a Python library for implementing GraphQL servers using schema-first approach.
Stars: ✭ 1,274 (+1079.63%)
Mutual labels:  api, graphql
Mojo Weixin
使用Perl语言(不会没关系)编写的个人账号微信/weixin/wechat客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,181 (+993.52%)
Mutual labels:  api, cli
Miraql
GraphQL performance monitoring & error-handling tool
Stars: ✭ 97 (-10.19%)
Mutual labels:  api, graphql
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+38590.74%)
Mutual labels:  api, graphql
Mattersend
Library and CLI utility to send messages to mattermost's incoming webhooks
Stars: ✭ 68 (-37.04%)
Mutual labels:  api, cli
Cross Platform Node Guide
📗 How to write cross-platform Node.js code
Stars: ✭ 1,161 (+975%)
Mutual labels:  api, cli
Rundeck Cli
CLI tool for Rundeck
Stars: ✭ 98 (-9.26%)
Mutual labels:  api, cli

Sourcegraph CLI Build Status Go Report Card

src is a command line interface to Sourcegraph:

  • 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
  • Manage & administrate repositories, users, and more
  • Easily convert src-CLI commands to equivalent curl commands, just add --get-curl!

Note: Using Sourcegraph 3.12 or earlier? See the older README.

Installation

Binary downloads are available on the releases tab, and through Sourcegraph.com. If the latest version does not work for you, consider using the version compatible with your Sourcegraph instance instead.

Installation: Mac OS

Latest version

curl -L https://sourcegraph.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src

or

brew install sourcegraph/src-cli/src-cli

Version compatible with your Sourcegraph instance

Replace sourcegraph.example.com with your Sourcegraph instance URL:

curl -L https://sourcegraph.example.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src

Installation: Linux

Latest version

curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src

Version compatible with your Sourcegraph instance

Replace sourcegraph.example.com with your Sourcegraph instance URL:

curl -L https://sourcegraph.example.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src
chmod +x /usr/local/bin/src

Installation: Windows

See Sourcegraph CLI for Windows.

Log into your Sourcegraph instance

Run src login SOURCEGRAPH-URL to authenticate src to access your Sourcegraph instance with your user credentials.

Examples src login https://sourcegraph.example.com src login https://sourcegraph.com

src consults the following environment variables:

  • SRC_ENDPOINT: the URL to your Sourcegraph instance (such as https://sourcegraph.example.com)
  • SRC_ACCESS_TOKEN: your Sourcegraph access token (on your Sourcegraph instance, click your user menu in the top right, then select Settings > Access tokens to create one)

For convenience, you can export these environment variables in your shell profile. To configure them as environment variables, add the following to your terminal profile file, typically accessible at ~/.bash_profile (if using Bash) or ~/.zprofile (if using Zsh):

export SRC_ACCESS_TOKEN=my-token
export SRC_ENDPOINT=https://sourcegraph.example.com 

Replace my-token and https://sourcegraph.example.com with the appropriate values for your account and instance.

You can also inline them in a single command with:

SRC_ENDPOINT=https://sourcegraph.example.com SRC_ACCESS_TOKEN=my-token src search 'foo'

Is your Sourcegraph instance behind a custom auth proxy? See auth proxy configuration docs.

Usage

src provides different subcommands to interact with different parts of Sourcegraph:

  • src login - authenticate to a Sourcegraph instance with your user credentials
  • 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
  • src repos - manage repositories
  • src users - manage users
  • src orgs - manages organization
  • src config - manage global, org, and user settings
  • src extsvc - manage external services (repository configuration)
  • src extensions - manage extensions
  • src lsif - manages LSIF data
  • src serve-git - serves your local git repositories over HTTP for Sourcegraph to pull
  • src version - check version and guaranteed-compatible version for your Sourcegraph instance

Run src -h and src <subcommand> -h for more detailed usage information.

Optional: Renaming src

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:

mv /usr/local/bin/src /usr/local/bin/src-cli

You can then invoke it via src-cli.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].