Skip to content
Closed
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
8 changes: 8 additions & 0 deletions skills/test-rust-cli/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "test-rust-cli",
"description": "E2E test - Rust CLI querying ETH price via OnchainOS",
"version": "1.0.0",
"author": {"name": "E2E Test"},
"license": "MIT",
"keywords": ["test", "e2e", "rust", "onchainos"]
}
4 changes: 4 additions & 0 deletions skills/test-rust-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "test-rust-cli"
version = "1.0.0"
edition = "2021"
1 change: 1 addition & 0 deletions skills/test-rust-cli/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MIT License - Copyright 2026 E2E Test
36 changes: 36 additions & 0 deletions skills/test-rust-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: test-rust-cli
description: "E2E test - Rust CLI querying ETH price via OnchainOS"
version: "1.0.0"
author: "E2E Test"
tags: [test, rust, onchainos]
---

# Test Rust CLI

## Overview
E2E test plugin with Rust CLI binary. Queries ETH price via OnchainOS.

## Pre-flight Checks
1. Install onchainos CLI: `curl -sSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh`
2. Ensure test-rust-cli binary is installed

## Commands

### Query ETH Price via CLI
```bash
test-rust-cli --query eth-price
```
**When to use:** When user asks about ETH price.
**Output:** Calls `onchainos token price-info --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 --chain ethereum` and formats the result.

### Direct OnchainOS Query
```bash
onchainos token price-info --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 --chain ethereum
```

## Error Handling
| Error | Cause | Resolution |
|-------|-------|------------|
| Binary not found | CLI not installed | Install via plugin-store |
| Command not found | onchainos not installed | Run pre-flight install |
16 changes: 16 additions & 0 deletions skills/test-rust-cli/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema_version: 1
name: test-rust-cli
version: "1.0.0"
description: "E2E test - Rust CLI querying ETH price via OnchainOS"
author:
name: "E2E Test"
github: "MigOKG"
license: MIT
category: utility
tags: [test, e2e, rust, onchainos]
components:
skill:
dir: .
build:
lang: rust
binary_name: test-rust-cli
29 changes: 29 additions & 0 deletions skills/test-rust-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use std::process::Command;

fn main() {
let args: Vec<String> = std::env::args().collect();

if args.len() > 1 && args[1] == "--query" && args.get(2).map(|s| s.as_str()) == Some("eth-price") {
println!("Querying ETH price via onchainos...");
let output = Command::new("onchainos")
.args(["token", "price-info", "--address", "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "--chain", "ethereum"])
.output();
match output {
Ok(o) => print!("{}", String::from_utf8_lossy(&o.stdout)),
Err(e) => eprintln!("Error: {}", e),
}
} else if args.len() > 1 && args[1] == "--help" {
println!("test-rust-cli v1.0.0");
println!("Usage: test-rust-cli --query eth-price");
println!("Queries ETH price via onchainos token price-info");
} else {
println!("test-rust-cli v1.0.0 - Querying ETH price via onchainos...");
let output = Command::new("onchainos")
.args(["token", "price-info", "--address", "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "--chain", "ethereum"])
.output();
match output {
Ok(o) => print!("{}", String::from_utf8_lossy(&o.stdout)),
Err(e) => eprintln!("Error running onchainos: {}", e),
}
}
}
Loading