Basic command line interface for interacting with the Shadeform API.
I used the comand + subcommand style from the AWS CLI since it's what I use most often. The API client Client{} (from src/shadeform.zig) is fairly atomic but watch out for longer-lived memory bugs from JSON serde.
Note: I have no idea if this will compile or run on Windows but it should be fine under WSL.
Build it from source, I doubt this tool will live long enough to justify spending effort on automated builds:
git clone https://github.com/zhooda/sfm && cd sfm
zig build -Doptimize=ReleaseSafeInstall somewhere in your path:
install -m755 ./sfm /usr/local/bin/sfmThis works on Mac, not sure if it's POSIX compliant though. Read the man page for your system (man 1 install).
Set the SHADEFORM_API_KEY environment variable to your API key:
# bash/zsh
echo 'export SHADEFORM_API_KEY="[YOUR_KEY_HERE]"' >> ~/.profile
source ~/.profile
# fish
set -Ux SHADEFORM_API_KEY "[YOUR_KEY_HERE]"Note: not all API features are currently implemented.
# list all active and pending instances
sfm instances list
# list all instance types
sfm instances list-types
# describe an instance
sfm instances describe --id [INSTANCE_ID]
# delete an instance
sfm instances delete --id [INSTANCE_ID]- Command line parsing can panic sometimes
- Memory bugs probably exist where JSON serde is used (
std.json.parseFromSliceLeaky) - Poor cache-line locality (SoA pattern of
std.MultiArrayListmay help here)
- Shadeform API Documentation
- Zigcli - Simargs - Command line parsing
- Zig Cookbook - JSON deserialization