Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csilctl

A curl/grpcurl-style CLI for sending arbitrary CSIL messages.

Installing

You can head over to the releases page, download the .tar.gz file for your system, unpack, and get the executable from inside.

How it works

csilctl parses a .csil source file directly (see the CSIL spec) to discover services, their messages, and each message's request/response/error fields. list simply shows you a filtered version of whats in this file. send works directly from the CSIL file to send and show responses for RPC messages via the csilgen_transport crate.

  1. --client is a global flag, set before the subcommand. It's a path to the CSIL file.

  2. List messages — by default, just service and method names plus the file's other types:

    csilctl --client ./corndogs.csil list

    Or name a method or type to see the details for just that item:

    csilctl --client ./corndogs.csil list SubmitTask
    csilctl --client ./corndogs.csil list Task
  3. Build a message — pass a JSON-like payload; any required field you leave out is prompted for interactively:

    csilctl --client ./corndogs.csil send --message CreateWidget --data '{"name": "widget-1", "count": 3}'
  4. Send it — the payload is marshaled into the client's generated message type and sent to a host:port:

    csilctl --client ./corndogs.csil send --message CreateWidget --data '{"name": "widget-1"}' --host example.com:9000

Usage

Flag Scope Description
--client global Path to a .csil source file
--disable-color global Disable colorized output (see priority order below)
--message send Name of the message/operation to send
--data send JSON-like payload for the message; missing required fields are prompted for
--host send Destination host/domain + port in host:port format
Environment variable Description
NO_COLOR Any value disables colorized output, overriding FORCE_COLOR and --disable-color
FORCE_COLOR Any value enables colorized output, overriding --disable-color (but not NO_COLOR)

list output is colorized by default. NO_COLOR beats FORCE_COLOR beats --disable-color — e.g. FORCE_COLOR=1 csilctl --client ./corndogs.csil --disable-color list still prints in color, since FORCE_COLOR wins over the flag.

Dev flow

CI/CD runs on Reactorcide, with releases versioned and tagged via semver-tags. Pull requests will be checked to use conventional commits

Project structure

  • cli/ the main CLI code. I imagine everything is in there for now.

Status

Currently in development, and dogfooding as I use this tool to debug some stuff. CLI is built on clap. Just chat first if you wanna make changes.

About

A curl-like CLI for sending arbitrary CSIL messages

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages