🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@2oolkit/grvt-cli

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@2oolkit/grvt-cli - npm Package Compare versions

Comparing version
0.1.0
to
0.1.1
+206
README.md
# @2oolkit/grvt-cli
Command-line toolkit for the [GRVT](https://grvt.io) derivatives exchange. Trade perpetuals, manage orders, and query market data — all from your terminal.
## Prerequisites
- **Node.js** >= 20
- A **GRVT account** at [grvt.io](https://grvt.io)
- An **API key** (generate one in your GRVT dashboard under Settings > API Keys)
## Installation
```bash
npm install -g @2oolkit/grvt-cli
```
Verify the installation:
```bash
grvt-cli --version
```
## Quick Start
### 1. Run the setup wizard
```bash
grvt-cli config init
```
You will be prompted for:
| Prompt | Description | Where to find it |
|---|---|---|
| **API Key** | Your GRVT API key | Dashboard > Settings > API Keys |
| **API Secret** | Private key associated with your API key | Shown once when you create the API key |
| **Sub-account ID** | Numeric sub-account ID for trading | Dashboard > Sub-accounts |
The wizard saves your config to `~/.grvt-cli/config.json` (file permissions `0600`) and automatically logs you in.
### 2. Check your authentication status
```bash
grvt-cli auth status
```
### 3. Start trading
```bash
# Check BTC price
grvt-cli market ticker BTC_USDT_Perp
# Place a limit buy order
grvt-cli order create --instrument BTC_USDT_Perp --side buy --size 0.001 --price 60000
# View open orders
grvt-cli order list
```
## Configuration
### Interactive setup (recommended)
```bash
grvt-cli config init
```
### Manual setup
```bash
grvt-cli config set --api-key <key> --api-secret <secret> --sub-account-id <id>
grvt-cli auth login
```
### Update a single value
```bash
grvt-cli config set --api-key <new-key>
```
### Environment variables (alternative)
You can also configure via environment variables. These are used as fallback when a config file value is not set.
```bash
export GRVT_API_KEY=<your-api-key>
export GRVT_SECRET_KEY=<your-api-secret>
export GRVT_SUB_ACCOUNT_ID=<your-sub-account-id>
```
### View current config
```bash
grvt-cli config list
```
Secrets are automatically masked in the output.
## Commands
### Auth
```bash
grvt-cli auth login # Login and create a session
grvt-cli auth status # Check session status
grvt-cli auth logout # Clear saved session
```
### Market Data
```bash
# List instruments
grvt-cli market instruments
grvt-cli market instruments --kind PERPETUAL
grvt-cli market instruments --base BTC
# Ticker
grvt-cli market ticker BTC_USDT_Perp
# Orderbook
grvt-cli market orderbook BTC_USDT_Perp
grvt-cli market orderbook BTC_USDT_Perp --depth 20
```
### Orders
```bash
# Create orders
grvt-cli order create --instrument BTC_USDT_Perp --side buy --size 0.001 --price 60000
grvt-cli order create --instrument BTC_USDT_Perp --side sell --size 0.001 --type market
grvt-cli order create --instrument ETH_USDT_Perp --side buy --size 0.1 --price 3000 --post-only
# Cancel orders
grvt-cli order cancel --order-id <id>
grvt-cli order cancel-all
grvt-cli order cancel-all --kind PERPETUAL
# Query orders
grvt-cli order get --order-id <id>
grvt-cli order list
grvt-cli order history --limit 50
```
#### Order options
| Option | Description | Default |
|---|---|---|
| `--instrument` | Instrument name (e.g., `BTC_USDT_Perp`) | required |
| `--side` | `buy` or `sell` | required |
| `--size` | Order size | required |
| `--type` | `limit` or `market` | `limit` |
| `--price` | Limit price (required for limit orders) | — |
| `--post-only` | Maker-only order | `false` |
| `--reduce-only` | Reduce-only order | `false` |
| `--time-in-force` | `GOOD_TILL_TIME`, `IMMEDIATE_OR_CANCEL`, `FILL_OR_KILL` | `GOOD_TILL_TIME` |
| `--client-order-id` | Custom client order ID | auto-generated |
### Positions
```bash
grvt-cli position list
grvt-cli position list --kind PERPETUAL
grvt-cli position list --instrument BTC_USDT_Perp
```
### Account
```bash
grvt-cli account summary # Funding account summary
grvt-cli account sub-account # Sub-account summary (balances, margin)
```
### Funding
```bash
grvt-cli funding rate BTC_USDT_Perp # Current funding rate
grvt-cli funding history --limit 10 # Funding payment history
```
## Output Formats
All commands support `-o json` for JSON output, which is useful for scripting and piping:
```bash
# Table output (default)
grvt-cli market ticker BTC_USDT_Perp
# JSON output
grvt-cli market ticker BTC_USDT_Perp -o json
# Pipe to jq
grvt-cli order list -o json | jq '.[].order_id'
```
## Config File Location
| File | Path | Description |
|---|---|---|
| Config | `~/.grvt-cli/config.json` | API key, secret, sub-account ID |
| Session | `~/.grvt-cli/session.json` | Login session cookie (auto-managed) |
Both files are created with `0600` permissions (owner read/write only).
## License
MIT
+1
-1

@@ -1199,3 +1199,3 @@ #!/usr/bin/env node

var program = new import_commander.Command();
program.name("grvt-cli").description("CLI toolkit for GRVT derivatives exchange").version("0.1.0");
program.name("grvt-cli").description("CLI toolkit for GRVT derivatives exchange").version("0.1.1");
registerConfigCommands(program);

@@ -1202,0 +1202,0 @@ registerAuthCommands(program);

{
"name": "@2oolkit/grvt-cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "CLI toolkit for GRVT derivatives exchange",

@@ -21,3 +21,4 @@ "homepage": "https://github.com/haeminmoon/grvt-cli#readme",

"files": [
"dist/index.js"
"dist/index.js",
"README.md"
],

@@ -24,0 +25,0 @@ "keywords": [