@coinbase/coinbase-cli 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,8 @@ coinbase products get product_id=BTC-USD
59
59
  coinbase orders list
60
60
  coinbase orders create product_id=BTC-USD side=BUY ...
61
61
  coinbase balance
62
+ coinbase products ticker BTC-USDC \
63
+ --until "price BTC-USDC >= 65000" # block on a live stream until true, then exit 0
62
64
  ```
63
65
 
64
66
  Use `--template` to see the expected request shape before writing, and `--dry-run` to preview without sending:
@@ -89,8 +91,31 @@ coinbase orders create --dry-run # preview the assembled request
89
91
  | `--edit` | Open request body in `$EDITOR` |
90
92
  | `--jq <expr>` | Filter JSON response (requires [jq](https://jqlang.github.io/jq/)) |
91
93
  | `--paginate` | Auto-follow pagination for full results |
94
+ | `--watch` | Render a live terminal surface fed by a WebSocket stream |
95
+ | `--until <predicate>` | Block on a live stream until the predicate is true, then exit |
96
+ | `--until-timeout <seconds>` | Cap how long `--until` waits before giving up |
92
97
  | `-e <env>` | Use a specific environment |
93
98
 
99
+ ### Streaming (`--watch` / `--until`)
100
+
101
+ Read commands like `products ticker`, `products book`, and `orders list` can subscribe to a live WebSocket feed instead of making a one-shot request.
102
+
103
+ `--watch` renders a live terminal surface. `--until` blocks until a predicate becomes true, prints the matching event as JSON, and exits — composable with `&&`:
104
+
105
+ ```bash
106
+ # Live ticker surface
107
+ coinbase products ticker BTC-USDC ETH-USDC --watch
108
+
109
+ # Block until BTC crosses 65k, then place an order
110
+ coinbase products ticker BTC-USDC --until "price BTC-USDC >= 65000" --until-timeout 3600 \
111
+ && coinbase orders create product_id=BTC-USDC side=SELL ...
112
+
113
+ # Wait for an order to fill
114
+ coinbase orders list --until "status == FILLED"
115
+ ```
116
+
117
+ Exit codes: `0` predicate matched, `124` timed out, `2` permanent stream failure.
118
+
94
119
  ### `coinbase history` — Request history
95
120
 
96
121
  View and manage a log of recent API requests made through the CLI.