Skip to content

feat(cli): Add search, IPO, financial-statement, asset, and ATM commands#185

Draft
hogan-yuan wants to merge 9 commits intolongbridge:mainfrom
hogan-yuan:endless/task-14
Draft

feat(cli): Add search, IPO, financial-statement, asset, and ATM commands#185
hogan-yuan wants to merge 9 commits intolongbridge:mainfrom
hogan-yuan:endless/task-14

Conversation

@hogan-yuan
Copy link
Copy Markdown
Member

@hogan-yuan hogan-yuan commented May 8, 2026

Summary

  • Search — moved under existing subcommands: news search <keyword>, topic search <keyword>
  • IPO (src/cli/ipo.rs): new ipo subcommand group — subscriptions, wait-listing, listed, calendar, info, profile, timeline, order, orders, order-detail, history, eligibility, profit-loss, profit-loss-items, holdings
  • Financial (src/cli/fundamental.rs): financial-statement, financial-report --latest, valuation-rank, analyst-estimates, institution-rating --history / --industry-rank
  • Asset (src/cli/asset.rs): short-margin, holding-period, trade-info, order-stats
  • ATM (src/cli/atm.rs): withdrawal-cards, withdrawals, deposits
  • Fix all API paths to use OpenAPI paths (/v1/...)
  • Remove write operations (ipo submit, ipo withdraw) and pnl-calendar (marked Delete in API docs)
  • Pretty mode: single-object commands now render key-value table instead of raw JSON
  • Time fields (created_at) now formatted as RFC 3339 timestamps

Test plan

Use LONGBRIDGE_ENV=staging for all commands below.

Search

  • longbridge news search "TSLA" --limit 5 — returns news list with id, title, time
  • longbridge topic search "Trump" --limit 5 — returns topic list with id, author, excerpt

IPO

  • longbridge ipo subscriptions — lists active subscriptions
  • longbridge ipo wait-listing — lists grey market stocks
  • longbridge ipo listed — lists recently listed IPOs
  • longbridge ipo calendar — shows full IPO calendar
  • longbridge ipo detail 6871.HK — shows IPO detail
  • longbridge ipo orders — lists active IPO orders
  • longbridge ipo orders detail <order_id> — shows order detail (use ID from orders)
  • longbridge ipo profit-loss --period all — shows P&L summary

Financial

  • longbridge financial-statement AAPL.US --kind IS --report qf — income statement
  • longbridge financial-report AAPL.US --latest — latest report summary
  • longbridge valuation-rank AAPL.US --start 2025-01-01 --end 2025-03-31 — valuation rank
  • longbridge analyst-estimates AAPL.US — analyst consensus
  • longbridge institution-rating AAPL.US --history — rating history
  • longbridge institution-rating AAPL.US --industry-rank — industry rank

Asset

  • longbridge short-margin — short margin deposit details
  • longbridge holding-period 700.HK — holding period breakdown
  • longbridge trade-info 700.HK — trade info (key-value in pretty mode)
  • longbridge order-stats — order statistics

ATM

  • longbridge bank-cards — bank cards list
  • longbridge withdrawals — withdrawal history with formatted dates
  • longbridge deposits — deposit history with formatted dates

🤖 Generated with Claude Code

endless-bot and others added 9 commits May 7, 2026 03:38
目标:基于 `docs/api-reference.md` 中的接口,为 `longbridge-terminal` CLI 开发对应的子命令, commit 和 pr 都使用英文

---

##

🤖 Generated with Endless

Co-authored-by: 老袁 Yuan Zhanghong <zhanghong.yuan@longbridge-inc.com>
`crate::openapi::quote().member_id()` returns `Result<i64, longbridge::Error>`,
but the helper declared `Result<i64>` (i.e. `anyhow::Result`). Add
`.map_err(anyhow::Error::from)` to convert the error type explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
目标:基于 `docs/api-reference.md` 中的接口,为 `longbridge-terminal` CLI 开发对应的子命令, commit 和 pr 都使用英文

---

##

🤖 Generated with Endless

Co-authored-by: 老袁 Yuan Zhanghong <zhanghong.yuan@longbridge-inc.com>
- Fix all new command API paths to use OpenAPI paths (/v1/...)
- Remove delete-marked features: pnl-calendar, ipo submit/withdraw
- Move search under news/topic subcommands (news search, topic search)
- Fix val_str null handling to return "-" consistently
- Add fmt_ts() for RFC 3339 timestamp formatting of created_at fields
- Fix Pretty mode for single-object commands to use print_json_value
- Add empty-array guard in institution-rating --history Pretty output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants