@trends-fun/trends-cli
v0.1.3
Published
Trends CLI for create/buy/sell Solana bonding curve coins
Downloads
154
Readme
@trends-fun/trends-cli
@trends-fun/trends-cli is the official CLI for Trends operations on Solana:
coin creation, quote, trading, wallet setup, reward claim, and feed queries.
- Official website: https://trends.fun
- Simplified Chinese guide: docs/README-zh.md
- Acceptance and validation checklist: docs/cli-usage-and-acceptance.md
Prerequisites
- Node.js
>= 20
Install
npm install -g @trends-fun/trends-cliQuick Start
trends --version
trends --help
trends wallet init
trends wallet address
trends balanceCommand Groups
- Trading:
create,buy,sell,quote buy,quote sell - Feed and portfolio:
balance,holdings,created,transactions - Reward:
reward status,reward claim - Wallet:
wallet init,wallet address - Config:
config list|get|set|reset
Global Options
--rpc-url <url>
--api-base-url <url>
--keypair <path>
--commitment <processed|confirmed|finalized>
--compute-unit-limit <units>
--compute-unit-price <microLamports>
--jsonCommand Reference
trends create --name <name> --symbol <symbol> [--image-path <path>] [--url <url>] [--desc <desc>] [--first-buy <sol>] [--dev-bps <bps>]
trends buy <mint> (--in-sol <amount> | --out-token <amount>) [--slippage-bps <bps>]
trends sell <mint> (--in-token <amount> | --out-sol <amount>) [--slippage-bps <bps>]
trends quote buy <mint> (--in-sol <amount> | --out-token <amount>) [--slippage-bps <bps>]
trends quote sell <mint> (--in-token <amount> | --out-sol <amount>) [--slippage-bps <bps>]
trends balance [address] [--mint <mint>]
trends holdings [address] [--count <count>]
trends created [address] [--count <count>] [--cursor <cursor>]
trends transactions [address] [--count <count>] [--cursor <cursor>]
trends reward status
trends reward claim
trends wallet init [--path <path>] [--force] [--no-set-default]
trends wallet address
trends config list
trends config get <key>
trends config set <key> <value>
trends config resetOutput Modes
Use --json for automation and parsing; default output is human-readable.
- With
--json:- returns raw result payloads in a stable wrapper
{ ok, command, input, result, tx/error } - no compact feed filtering is applied
- returns raw result payloads in a stable wrapper
- Without
--json:holdings/created/transactionsreturn compact, user-facing output- compact feed output uses
next_cursorwhen pagination cursor is available
Feed Amount Rules
For user-facing feed interpretation:
holdings/created:owner_context.balanceis rawdecimals=6- display value = raw value
/ 1_000_000
transactions:sol_amountis raw lamports (decimals=9)- display value = raw value
/ 1_000_000_000 token_amountis raw token base units (decimals=6)- display value = raw value
/ 1_000_000
Configuration
Configuration priority (high to low):
- CLI arguments
- Environment variables
- Local config file
- Built-in defaults
Environment variables:
TRENDS_RPC_URLTRENDS_API_BASE_URLTRENDS_KEYPAIR_PATHTRENDS_COMMITMENT
Config file path:
~/.config/trends-cli/config.json
Supported config keys:
rpcUrlapiBaseUrlkeypairPathcommitmentdefaultSlippageBpscomputeUnitLimitcomputeUnitPriceMicroLamports
Defaults:
rpcUrl:https://api.mainnet-beta.solana.comapiBaseUrl:https://api.trends.fun/v1keypairPath:~/.config/solana/id.jsoncommitment:confirmeddefaultSlippageBps:100
Behavior Notes
buy,sell,quote buy,quote selleach require exactly one route option.- Strict integer options reject scientific notation, trailing text, decimals, and negative values.
--count:holdings: integer>= 1created/transactions: integer in1..25
- Default pagination size:
holdings:count=20created/transactions:count=20
create --dev-bpsis ignored when--urlis not provided (warning in non-JSON mode).create --image-pathis optional; image is auto-generated from symbol when omitted.reward claimonly submits when reward account exists and reward is greater than0.
Dependency
@trends-fun/bonding-curve-solana-sdk
