api-client

module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT

README

api-client

This repository contains the ReSim API command-line interface (CLI). It is written in Go and produced via code generation with openapi-cli-generator from the publicly-available API spec.

Installation

Pre-built binaries are available for linux-amd64, darwin-amd64 (Mac OS) and darwin-arm64 (Mac OS on Apple Silicon/ARM):

For Linux on AMD64:

curl -L https://github.com/resim-ai/api-client/releases/download/v0.1.4/resim-linux-amd64 -o resim
chmod +x resim

For Mac OS on Apple Silicon/ARM:

curl -L https://github.com/resim-ai/api-client/releases/download/v0.1.4/resim-darwin-arm64 -o resim
chmod +x resim

For Mac OS on Intel:

curl -L https://github.com/resim-ai/api-client/releases/download/v0.1.4/resim-darwin-amd64 -o resim
chmod +x resim

Or you can install using go install:

go install github.com/resim-ai/api-client/cmd/resim@latest

Authentication

The ReSim CLI authenticates using client credentials (a client ID and a client secret). These are obtained by contacting ReSim.

Client credentials can be specified on the commandline with the --client_id and --client_secret flags, or in the environment as RESIM_CLIENT_ID and RESIM_CLIENT_SECRET.

Usage

To get a list of available commands, just type

resim

To call a particular endpoint, use

RESIM_CLIENT_ID=<client ID> RESIM_CLIENT_SECRET=<client secret> resim create project <flags> 

Developing

You will need Go installed.

Regenerating the client

Whenever the API spec changes, you will need to regenerate the generated code:

go generate ./...

Directories

Path Synopsis
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
cmd
resim command
Package ptr contains a small utility function for inlining pointers.
Package ptr contains a small utility function for inlining pointers.

Jump to

Keyboard shortcuts

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