tkcli

command module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Turnkey CLI

Go Build Status

Building the CLI

If you simply want to build a binary locally, run

$ make build/turnkey

We use GoReleaser to build and release our binaries.

To build a release locally:

$ goreleaser release --snapshot --rm-dist

To release:

# Generate a Github token with "write:packages"
# ==> https://github.com/settings/tokens
$ export GITHUB_TOKEN=<your token>
$ git tag -s -a vx.y.z -m "New release: x.y.z" # create a signed tag
$ git tag -v vx.y.z # verify the tag
$ git push origin vx.y.z
$ goreleaser release --rm-dist

Installing the CLI

brew tap tkhq/tap
brew install turnkey

Usage

Create a new API key:

$ turnkey gen --name my-test-key
{
    "privateKeyFile": "/Users/rno/.config/turnkey/keys/my-test-key.private",
    "publicKeyFile": "/Users/rno/.config/turnkey/keys/my-test-key.public"
}

Sign a request:

$ turnkey approve-request --host api.turnkey.io --path /api/v1/sign --body '{"payload": "hello from TKHQ"}' --key=my-test-key
{
    "curlCommand": "curl -X POST -d'{\"payload\": \"hello from TKHQ\"}' -H'X-Stamp: eyJwdWJsaWNLZXkiOiIwM2JmMTYyNTc2ZWI4ZGZlY2YzM2Q5Mjc1ZDA5NTk1Mjg0ZjZjNGRmMGRiNjE1NmMzYzU4Mjc3Nzg4NmEwZWUwYWMiLCJzaWduYXR1cmUiOiIzMDQ0MDIyMDZiMmRlYmIwYjA3YmYwMDJlMjI1ZmQ4NTgzZjZmNGUxNGE5YTUxYWRiYWJjNDAyYzY5YTZlN2Q4N2ViNWNjMDgwMjIwMjE0ZTdkMGJlODFjMGYyNDEyOWE0MmNkZGFlOTUxYTBmZTViMGM1Mzc3YjM2NzZiOTUyNDgyNmYwODdhMWU4ZiIsInNjaGVtZSI6IlNJR05BVFVSRV9TQ0hFTUVfVEtfQVBJX1AyNTYifQ' -v 'https://api.turnkey.io/api/v1/sign'",
    "message": "{\"payload\": \"hello from TKHQ\"}",
    "stamp": "eyJwdWJsaWNLZXkiOiIwM2JmMTYyNTc2ZWI4ZGZlY2YzM2Q5Mjc1ZDA5NTk1Mjg0ZjZjNGRmMGRiNjE1NmMzYzU4Mjc3Nzg4NmEwZWUwYWMiLCJzaWduYXR1cmUiOiIzMDQ0MDIyMDZiMmRlYmIwYjA3YmYwMDJlMjI1ZmQ4NTgzZjZmNGUxNGE5YTUxYWRiYWJjNDAyYzY5YTZlN2Q4N2ViNWNjMDgwMjIwMjE0ZTdkMGJlODFjMGYyNDEyOWE0MmNkZGFlOTUxYTBmZTViMGM1Mzc3YjM2NzZiOTUyNDgyNmYwODdhMWU4ZiIsInNjaGVtZSI6IlNJR05BVFVSRV9TQ0hFTUVfVEtfQVBJX1AyNTYifQ"
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
clifs
Package to encapsulate CLI filesystem operations
Package to encapsulate CLI filesystem operations
src module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL