Crates.io | spyglass-cli |
lib.rs | spyglass-cli |
version | 0.1.0 |
source | src |
created_at | 2023-10-06 18:41:44.327832 |
updated_at | 2023-10-06 18:41:44.327832 |
description | A cli tool designed to make substreams development a more ergonomic and type safe experience. |
homepage | |
repository | |
max_upload_size | |
id | 995314 |
size | 461,346 |
spyglass-cli
is a command-line interface (CLI) tool written in Rust, designed to provide type-safe helpers for working with substreams, specifically when using substreams to sink into a subgraph. This tool lets users seamlessly integrate with and generate helpers from different formats such as .spkg
and .graphql
.
.spkg
and .graphql
files.To get started with spyglass-cli
, make sure you have Rust and Cargo installed. If you haven't installed Rust, refer to the official installation guide.
Once Rust and Cargo are set up simply run:
$ cargo install spyglass-cli
Using spyglass-cli
is straightforward. Here's a quick guide:
Generates Rust code from the provided .spkg
or .graphql
input file.
$ spyglass-cli generate <spkg_or_graphql_path> [--output-dir <output_directory>]
spkg_or_graphql_path
: The path to the input .spkg
or .graphql
file.--output-dir
: (Optional) The directory where the generated Rust code will be saved. Defaults to ./src/spyglass/
.To generate code from a .spkg
file:
$ spyglass-cli generate /path/to/file.spkg
To generate code from a .graphql
file and specify an output directory:
$ spyglass-cli generate /path/to/file.graphql --output-dir /desired/output/dir/
clap
: For parsing and handling command line arguments.nom
: Used for working with byte-level and streaming data.prost
: A Protocol Buffers implementation for encoding/decoding.anyhow
: For easy error handling.syn
: A parsing library for Rust source code.prettyplease
: A utility for generating prettified Rust code.We welcome contributors to spyglass-cli
! Feel free to fork the repository, make changes, and submit pull requests. Make sure to follow the Rust code guidelines and maintain the overall architecture and design of the tool.
Author: Alexander Gusev
Version: 0.1.0