feat: extract tapp-cli into standalone crate (macOS compatible)#13
feat: extract tapp-cli into standalone crate (macOS compatible)#13Wilbert957 wants to merge 2 commits into
Conversation
Several subcommand args used `#[arg(short, long)]`, auto-deriving a short flag that collided with the global `--server` (-s) / per-command duplicates — clap's debug assert panicked at startup (e.g. `register-onchain` couldn't run at all in debug builds; release builds parsed ambiguously). The colliding shorts never worked, so dropping them (keeping the `--long` forms, which all docs/examples already use) is a pure fix. Made long-only: `service`, `service_name`, `signature`, `chain_id`, `stake_wei` (all auto-derived `-s`/`-c` clashing with `--server`/`--contract`); `recipient` (explicit `-r` clashing with `--rpc-url` in withdraw-balance). Verified: every subcommand's `--help` now runs without panic in a debug build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract tapp-cli from tapp-service into its own workspace member crate, decoupled from TEE attestation dependencies (attestation-agent, bollard, ecies, ring, sysinfo, psutil) that prevent compilation on macOS. Changes: - Add tapp-cli/ as a workspace member with minimal Cargo.toml - Pre-generate proto Rust code (src/proto_gen.rs) to eliminate build-time protoc dependency - Copy only needed modules: onchain, app_key (sign/verify), error - Strip app_key to sign_message/verify_signature only - Remove tapp-cli binary target from tapp-service Cargo.toml - Include fix/cli-short-flag-collisions changes The standalone crate compiles on macOS with only: cargo build --release No protoc, OpenSSL, or Docker needed.
|
Closing in favor of the shared-crate SDK approach (#9, design in #15). Why: this PR extracts the CLI by copying modules ( The macOS-buildability goal is still wanted; we'll get it the cleaner way: extract |
Summary
Extracts
tapp-clifromtapp-serviceinto its own workspace member crate, fully decoupled from TEE attestation dependencies that prevent compilation on macOS.Problem
tapp-cliwas a binary target insidetapp-service, sharing its full dependency tree including:attestation-agent(TDX/SGX/SNP/CCA/CSV attesters — Linux kernel interfaces)bollard(Docker client)ecies(OpenSSL dependency)sysinfo/psutilThese make
cargo buildfail on macOS. However,tapp-clionly needsethers,clap,tonic, andk256— none of the TEE/Docker stack.Changes
tapp-cli/as a workspace member with minimalCargo.tomlsrc/proto_gen.rs) to eliminate build-timeprotocdependencyonchain,app_key(sign/verify only),errortapp-clibinary target fromtapp-serviceCargo.tomlfix/cli-short-flag-collisionschangesTesting
cargo buildsucceeds (0 errors, 4 pre-existing warnings)--helpwork correctlysign-message/verify-signaturefunctional test passedprotoc, OpenSSL, or Docker needed at build timeOn macOS, simply: