This project is the seed for CircleCI's new command-line application.
- Go 1.10+
- Make
- ...
You should already have installed Go and setup your workspace.
This includes setting a valid $GOPATH
.
TODO: make this easier once repo is public
# Setup circleci source in your $GOPATH
$ mkdir -p $GOPATH/src/github.com/circleci
$ cd $GOPATH/src/github.com/circleci
# Clone the repo
$ git clone git@github.com/circleci/circleci-cli
$ cd circleci-cli
$ make
$ ./build/target/darwin/amd64/circleci-cli diagnostic
Please enter your CircleCI API token:
OK.
Your configuration has been created in `/home/zzak/.circleci/cli.yml`.
It can edited manually for advanced settings.
---
CircleCI CLI Diagnostics
---
Config found: `/home/zzak/.circleci/cli.yml`
Host is: https://circleci.com
OK, got a token.
After you've setup the CLI, you can try executing a GraphQL query against the client.
Given we've written the following query in a file called query.gql
:
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
description
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
}
}
You can now pipe that file to the query
command to send it.
$ cat query.gql | ./build/target/darwin/amd64/circleci-cli query
This should pretty-print back a JSON response from the server:
{
"__schema": {
# ...Tons O' Schema
}
}