Skip to content

kintoproj/kinto-cli

Repository files navigation

Kinto CLI

slack

Kinto CLI is a command line utility for accessing kinto-core. Kinto CLI is written in Golang.

Index

Installation

Linux / MacOS

Requirements :

  • Make sure you use bash to run this script.
  • unzip should be installed. If you don't already have it install it using sudo apt-get install -y unzip or similar command depending on your linux distro.

Run the installation script to install kinto CLI to its default location usr/local/bin

curl -L https://raw.githubusercontent.com/kintoproj/kinto-cli/main/install.sh | bash

Windows

Requirements :

  • Windows 7 SP1+ / Windows Server 2008+
  • PowerShell 5 (or later, include PowerShell Core)
  • PowerShell must be enabled for your user account e.g. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Run PowerShell as Administrator to avoid any errors.

Run the following command from your PowerShell to install Kinto CLI to its default location C:\Users\<user>\kinto

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/kintoproj/kinto-cli/main/install.ps1')

OR

iwr -useb raw.githubusercontent.com/kintoproj/kinto-cli/main/install.ps1 | iex

Note : You can also download the latest available release for your Operating System from releases and add it to your global PATH manually.

Development

Kinto CLI is written in GoLang using the popular package Cobra and it uses Go Modules to make working with external dependencies easy.

Requirements

Project Structure

Kinto CLI follows the following structure

kinto-cli
 |── internal
     ├── api
     ├── cli
     ├── config
     ├── controller
     └── utils

  • internal houses all the code for the CLI
    • api provides access to different components of the CLI such as environments, services/blocks, etc.
    • cli contains the root file that houses all the command declarations.
    • config stores the consts and configs for the CLI.
    • controller hosts the business logic for all the functions declared in cli
    • utils contains the basic utility functions needed by the CLI.

Local Setup

Follow the below-given instructions to set up the project locally.

  • Clone the repo and cd into it

    git clone https://github.com/kintoproj/kinto-cli
    
    cd kinto-cli
    
  • Once you have a local copy of Kinto-CLI repo on your machine, you can use an IDE such as Goland to make working with GoLang easier or you can do the setup manually by -

    cd kinto-cli
    
    go mod download
    
  • You can build the CLI binary file for your Operating system by running the command

    go build
    
  • And install it to $GOPATH/go/bin/ by

    go install
    

CLI Commands

For a detailed overview of the available CLI commands see CLI docs.