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


## Pre-flight Dependencies (auto-injected by Plugin Store CI)

> Run once per session before first use. These checks ensure required tools are installed.

### Install onchainos CLI + Skills (auto-injected)

```bash
# 1. Install onchainos CLI
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh

# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global

# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add okx/plugin-store --skill plugin-store --yes --global
```

### Install rust-cli-inspector binary (auto-injected)

```bash
if ! command -v rust-cli-inspector >/dev/null 2>&1; then
OS=$(uname -s | tr A-Z a-z)
ARCH=$(uname -m)
case "${OS}_${ARCH}" in
darwin_arm64) TARGET="aarch64-apple-darwin" ;;
darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
linux_x86_64) TARGET="x86_64-unknown-linux-gnu" ;;
linux_aarch64) TARGET="aarch64-unknown-linux-gnu" ;;
esac
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/rust-cli-inspector@1.0.0/rust-cli-inspector-${TARGET}" -o ~/.local/bin/rust-cli-inspector
chmod +x ~/.local/bin/rust-cli-inspector
fi
```

### Report install (auto-injected, runs once)

```bash
REPORT_FLAG="$HOME/.plugin-store/reported/rust-cli-inspector"
if [ ! -f "$REPORT_FLAG" ]; then
mkdir -p "$HOME/.plugin-store/reported"
# Device fingerprint → SHA256 → 32-char device ID
DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
# HMAC signature (obfuscated key, same as CLI binary)
_K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
DIV_ID="${DEV_ID}${HMAC_SIG}"
unset _K
# Report to Vercel stats
curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
-H "Content-Type: application/json" \
-d '{"name":"rust-cli-inspector","version":"1.0.0"}' >/dev/null 2>&1 || true
# Report to OKX API (with HMAC-signed device token)
curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
-H "Content-Type: application/json" \
-d '{"pluginName":"rust-cli-inspector","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
touch "$REPORT_FLAG"
fi
```

---


# Rust CLI Inspector

## Overview
Queries ETH price via OnchainOS token price-info.

## Pre-flight Checks
1. Install onchainos CLI
2. Ensure rust-cli-inspector binary is installed

## Commands

### Query ETH Price
`rust-cli-inspector --query eth-price`

**When to use:** When user asks about ETH price.

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

## Error Handling
| Error | Cause | Resolution |
|-------|-------|------------|
| Binary not found | CLI not installed | Run pre-flight |
| Command not found | onchainos not installed | Install onchainos |
17 changes: 17 additions & 0 deletions skills/rust-cli-inspector/SKILL_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# rust-cli-inspector -- Skill Summary

## Overview
This skill provides a Rust-based command-line tool for querying ETH price information through OnchainOS token price-info service. It offers both a custom CLI interface and direct OnchainOS command integration for retrieving Ethereum price data from the blockchain.

## Usage
Install the rust-cli-inspector binary and onchainos CLI, then use the provided commands to query ETH price data. The tool provides both simplified and direct query options for flexibility.

## Commands
| Command | Description |
|---------|-------------|
| `rust-cli-inspector --query eth-price` | Query current ETH price using the custom CLI |
| `onchainos token price-info --address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 --chain ethereum` | Direct OnchainOS query for ETH price data |

## Triggers
Activate this skill when users ask about ETH price or need current Ethereum price information. Use when cryptocurrency price data is requested for Ethereum specifically.
13 changes: 13 additions & 0 deletions skills/rust-cli-inspector/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# rust-cli-inspector
A Rust CLI tool that queries ETH price data via OnchainOS integration.

## Highlights
- Query ETH price through OnchainOS token price-info service
- Direct command-line interface for cryptocurrency price checking
- Built with Rust for performance and reliability
- Integrated with OnchainOS infrastructure
- Simple binary installation and usage
- Error handling for common setup issues
- Support for Ethereum mainnet price queries
- Lightweight utility for price monitoring

16 changes: 16 additions & 0 deletions skills/rust-cli-inspector/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
schema_version: 1
name: rust-cli-inspector
version: "1.0.0"
description: "Rust CLI querying ETH price via OnchainOS"
author:
name: "OKX"
github: "okx"
license: MIT
category: utility
tags: [rust, onchainos, eth]
components:
skill:
dir: .
build:
lang: rust
binary_name: rust-cli-inspector
18 changes: 18 additions & 0 deletions skills/rust-cli-inspector/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use std::process::Command;

fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() > 1 && args[1] == "--help" {
println!("rust-cli-inspector v1.0.0");
println!("Usage: rust-cli-inspector --query eth-price");
} else {
println!("rust-cli-inspector 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: {}", e),
}
}
}