idx-cli/web/src/content/docs/start/install.mdx
hermes 29f143fa1b feat: foreign flow (idx stocks flow, get_foreign_flow)
`idx stocks flow SYMBOL` shows what foreign investors bought and sold of a
stock, session by session, from IDX's own daily trading summary: foreign
buy, sell and net volume, net value at the session's average price, and
the share of value traded outside the regular board, with range totals.
Latest 10 sessions by default (--days, at most 60) or --from/--to. The MCP
server exposes it as get_foreign_flow.

- api/idx: pure parser for GetStockSummary (rows dated another session
  are dropped) and a provider over curl-impersonate's profile fallback
  with a 30 s limit; Cloudflare passes only some fingerprints.
- flow: each session is cached whole by date, so other stocks' flows for
  the same sessions need no request. Weekends are never requested.
- Idx::idx_code is shared by broker and flow for the .JK-only check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh
2026-10-18 05:39:12 +00:00

98 lines
2.8 KiB
Text

---
title: Install
description: Install idx with npm, the install script, Cargo or Nix.
---
import { Tabs, TabItem } from '@astrojs/starlight/components';
Prebuilt binaries cover Linux x64/arm64 (static) and macOS arm64/x64. On
Windows, use WSL.
:::tip[Let your agent do it]
Paste this into Claude Code, Codex, Cursor or another coding agent:
```text wrap
Install idx-cli and its MCP server for me by following https://idx.rasyidanaf.com/agents/install.md, then show me that it works.
```
:::
<Tabs syncKey="install">
<TabItem label="npm">
```bash
npm install --global idx-cli
npx idx-cli --help # or run without installing
```
The package downloads the checksum-verified release binary during
`postinstall`, or on first run when the package manager skips install scripts
(npm 12 under `npx`, pnpm 10+, bun).
</TabItem>
<TabItem label="Install script">
```bash
curl -fsSL https://raw.githubusercontent.com/0xrsydn/idx-cli/main/install.sh | sh
```
Downloads the binary for your platform from GitHub Releases, verifies it
against the release `SHA256SUMS`, and installs it into `~/.local/bin` without
sudo. Pin a version or change the directory:
```bash
curl -fsSL https://raw.githubusercontent.com/0xrsydn/idx-cli/main/install.sh | sh -s -- --version v0.3.3 --dir ~/bin
```
</TabItem>
<TabItem label="Cargo">
```bash
cargo install idx-cli
```
Builds from source. Requires Rust 1.89 or newer.
</TabItem>
<TabItem label="Nix">
```bash
nix profile install github:0xrsydn/idx-cli
nix run github:0xrsydn/idx-cli -- version # or run without installing
```
The Nix package bundles the helper tools below.
</TabItem>
</Tabs>
Check it works:
```bash
idx version
```
## Helper tools
Everyday use needs nothing else: stock data with the default MSN provider,
price history, broker summaries and bandarmology, `ownership sync` and every
local ownership query. A few commands call external tools:
| Tool | Needed for |
| --- | --- |
| `curl_chrome*` from [curl-impersonate](https://github.com/lexiforest/curl-impersonate), or `IDX_CURL_IMPERSONATE_BIN` | `ownership discover` and `ownership import --url` (IDX sits behind Cloudflare), and Yahoo fundamentals with `IDX_PROVIDER=yahoo` |
| the full curl-impersonate set, with its `curl_safari*` and `curl_firefox*` profiles | `stocks flow`: IDX's Cloudflare rules pass only some browser fingerprints, and idx tries each installed profile |
| `mutool` from MuPDF | importing legacy PDF ownership reports |
## The MCP server
`idx-mcp` installs the same ways (`npx -y idx-mcp`, `cargo install idx-mcp`,
or `nix profile install github:0xrsydn/idx-cli#idx-mcp`). See
[MCP setup](/mcp/setup/).
## Shell completions
```bash
idx completions bash > ~/.local/share/bash-completion/completions/idx
idx completions zsh > "${fpath[1]}/_idx"
idx completions fish > ~/.config/fish/completions/idx.fish
```