Skip to content

safiyax/sfm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sfm

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.

Installation

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=ReleaseSafe

Install somewhere in your path:

install -m755 ./sfm /usr/local/bin/sfm

This works on Mac, not sure if it's POSIX compliant though. Read the man page for your system (man 1 install).

Usage

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.

Instances

# 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]

Notes

  • 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.MultiArrayList may help here)

References

  1. Shadeform API Documentation
  2. Zigcli - Simargs - Command line parsing
  3. Zig Cookbook - JSON deserialization

About

Basic CLI for interacting with Shadeform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages