Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,955 changes: 1,888 additions & 67 deletions rust/Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"crates/sift_error",
"crates/sift_connect",
"crates/sift_stream_bindings",
"crates/sift_cli",
]

[workspace.package]
Expand Down
33 changes: 33 additions & 0 deletions rust/crates/sift_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "sift_cli"
authors.workspace = true
version.workspace = true
edition.workspace = true
categories.workspace = true
homepage.workspace = true
repository.workspace = true
keywords.workspace = true
readme.workspace = true
license.workspace = true
description = "CLI to streamline programmatic workflows with Sift's API"

[dependencies]
anyhow = "1.0.100"
chrono.workspace = true
clap = { version = "4.5.48", features = ["cargo", "derive", "wrap_help"] }
clap_complete = "4.5.58"
crossterm = "0.29.0"
csv = "1.3.1"
dirs = "6.0.0"
flate2 = "1.1.2"
indicatif = "0.18.0"
parquet = "56.2.0"
pbjson-types = { workspace = true }
reqwest = "0.12.23"
sift_rs = { workspace = true }
tokio = { version = "1.47.1", features = ["full", "net", "time"] }
toml = "0.8.23"
zip = "6.0.0"

[dev-dependencies]
indoc = "2.0.6"
39 changes: 39 additions & 0 deletions rust/crates/sift_cli/src/cli/channel.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use clap::ValueEnum;
use sift_rs::common::r#type::v1::ChannelDataType;

#[derive(Debug, Clone, ValueEnum)]
pub enum DataType {
/// Asks the program to infer the type so user can just focus on setting things like unit,
/// description, etc.
Infer,
Double,
String,
Enum,
BitField,
Bool,
Float,
Int32,
Uint32,
Int64,
Uint64,
Bytes,
}

impl From<DataType> for ChannelDataType {
fn from(dt: DataType) -> Self {
match dt {
DataType::Double => Self::Double,
DataType::String => Self::String,
DataType::Enum => Self::Enum,
DataType::BitField => Self::BitField,
DataType::Bool => Self::Bool,
DataType::Float => Self::Float,
DataType::Int32 => Self::Int32,
DataType::Uint32 => Self::Uint32,
DataType::Int64 => Self::Int64,
DataType::Uint64 => Self::Uint64,
DataType::Bytes => Self::Bytes,
DataType::Infer => Self::Unspecified,
}
}
}
17 changes: 17 additions & 0 deletions rust/crates/sift_cli/src/cli/export.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use clap::ValueEnum;
use sift_rs::exports::v1::ExportOutputFormat;

#[derive(Debug, Copy, Clone, ValueEnum)]
pub enum Format {
Csv,
Sun,
}

impl From<Format> for ExportOutputFormat {
fn from(val: Format) -> Self {
match val {
Format::Csv => ExportOutputFormat::Csv,
Format::Sun => ExportOutputFormat::Sun,
}
}
}
Loading
Loading