# Eterna CLI Guide: Terminal TypeScript Strategies with `@eterna-hybrid-exchange/cli`

> Install or run `npx @eterna-hybrid-exchange/cli` to authenticate via OAuth 2.1 device flow and invoke Eterna MCP tools (`search_sdk`, `execute_code`) directly from bash, zsh, nushell, cron jobs, or CI pipelines with clean JSON output.

- Canonical URL: https://ai.eterna.exchange/guides/eterna-cli-trading-automation
- Last updated: November 23, 2026
- Author: Eterna Engineering (Security & Agent Architecture Team)
- MCP endpoint: https://mcp.eterna.exchange/mcp

Interactive AI chats are great for research and discretionary execution, while deterministic terminal scripts are ideal for scheduled scans, portfolio snapshots, and automated alerts. Eterna CLI bridges both worlds using the exact same MCP backend.

## Key Facts

| Metric | Value | Notes |
|--------|-------|-------|
| NPM Package | @eterna-hybrid-exchange/cli | MIT licensed, zero subscription fee |
| Login Method | OAuth Device Flow | Works on headless SSH / VPS machines |
| Output Format | Structured JSON | Pipe directly into jq, nushell, or webhooks |
| Runtime | Node.js >= 18 | Trading code runs on remote Deno sandbox |

## 1. Authenticate & Run Your First CLI Query

1. **Run OAuth device login**: Start the CLI login flow once to store your scoped OAuth credentials locally.
   `npx @eterna-hybrid-exchange/cli auth login`
2. **Search SDK methods from the terminal**: Inspect method signatures without opening a browser.
   `npx @eterna-hybrid-exchange/cli search-sdk "rsi macd order"`
3. **Execute a live market scan file**: Run any local `.ts` strategy file inside Eterna's remote sandbox and inspect structured JSON output.
   `npx @eterna-hybrid-exchange/cli exec --file ./scan-watchlist.ts`

## 2. Best Automation Patterns for Eterna CLI

- 15-minute cron watchlist scanner pushing RSI/MACD confluence alerts to Telegram or Slack.
- Hourly portfolio and funding-rate snapshots archived to Postgres, SQLite, or CSV.
- Shell skill backend for OpenClaw, Hermes, or custom coding agents that prefer CLI over HTTP MCP.
- Scheduled spot DCA script buying fixed USDT amounts of BTC/ETH/SOL on weekly intervals.

## Frequently Asked Questions

### Does `@eterna-hybrid-exchange/cli` require installing Bybit or CCXT dependencies?

No. The CLI sends your TypeScript snippet to Eterna's remote MCP gateway, where the `eterna.*` SDK and all technical indicators are already preloaded.

### Is Eterna CLI free to use?

Yes. The CLI is MIT-licensed and free ($0/month). You pay only standard trading fees when orders fill.

## References & Primary Sources

- [Eterna MCP GitHub Repository](https://github.com/EternaHybridExchange/eterna-mcp): CLI source code, flags, and examples.

## Related Guides

- [Claude Code CLI Crypto Trading via Eterna MCP](https://ai.eterna.exchange/integrations/claude-code)
- [OpenClaw & Hermes Autonomous Agent Crypto Trading via Eterna MCP](https://ai.eterna.exchange/integrations/openclaw-hermes)
- [Automated Crypto Spot DCA & Portfolio Rebalance Agent (MCP Script)](https://ai.eterna.exchange/strategies/spot-dca-and-rebalance-agent)
- [OAuth 2.1 & Device Flow for Automated Crypto Trading Agents](https://ai.eterna.exchange/guides/mcp-oauth-authentication-for-agents)
