Skip to content

A simple CLI written in Kotlin/Native to retrieve resources from The Star Wars API

Notifications You must be signed in to change notification settings

rodolphocouto/swapi-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swapi-cli

A simple CLI written in Kotlin/Native to retrieve resources from The Star Wars API

Build

Prerequisites:

  • Java >= 8
  • cURL
  • ncurses5-compat-libs
./gradlew clean build

The binary executable swapi-cli.kexe will be generated in the dir build/bin/native/releaseExecutable.

Usage

The CLI expects the following command format:

./swapi-cli.kexe [resource] [operation] [param]
  • resource is the API resource to retrieve (people, films, starships, vehicles, species and planets)
  • operation is the operation to retrieve the resource (count, list, search and get)
  • param is only required for search and get operations

Examples

People:

./swapi-cli.kexe people count
./swapi-cli.kexe people list
./swapi-cli.kexe people search Luke
./swapi-cli.kexe people get 1

Films:

./swapi-cli.kexe films count
./swapi-cli.kexe films list
./swapi-cli.kexe films search Hope
./swapi-cli.kexe films get 1

Starships:

./swapi-cli.kexe starships count
./swapi-cli.kexe starships list
./swapi-cli.kexe starships search Star
./swapi-cli.kexe starships get 1

Vehicles:

./swapi-cli.kexe vehicles count
./swapi-cli.kexe vehicles list
./swapi-cli.kexe vehicles search Crawler
./swapi-cli.kexe vehicles get 1

Species:

./swapi-cli.kexe species count
./swapi-cli.kexe species list
./swapi-cli.kexe species search Rod
./swapi-cli.kexe species get 1

Planets:

./swapi-cli.kexe planets count
./swapi-cli.kexe planets list
./swapi-cli.kexe planets search Yavin
./swapi-cli.kexe planets get 1

About

A simple CLI written in Kotlin/Native to retrieve resources from The Star Wars API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages