feat(web): idx website and user docs (Astro Starlight)

Landing page plus docs for install, quickstart, config, the stocks and
ownership CLI, output and exit codes, the MCP server and per-agent setup,
agent usage, and an agent-led install page (agents/install.md) that a
coding agent follows from a one-line prompt.

- Every docs page is also served as Markdown at <path>.md; llms.txt and
  llms-full.txt come from starlight-llms-txt; a SKILL.md for skill-based
  harnesses is under /skills/idx/.
- The CLI reference and MCP tools pages are generated from idx --help and
  the tools golden; a new web-generated flake check fails when they drift.
- nix develop .#web provides bun; Cloudflare Pages builds web/ on pushes.
- Package homepage metadata points at https://idx.rasyidanaf.com.
- .cloudflare/ (the cf CLI's account cache) is git-ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hermes 2026-10-15 05:12:45 +00:00
commit e6805474f5
37 changed files with 3629 additions and 4 deletions

View file

@ -0,0 +1,53 @@
---
title: Output and exit codes
description: Tables, JSON, errors and exit codes; the contract scripts and agents rely on.
---
## Formats
| `-o` | Prints |
| --- | --- |
| `auto` (default) | a table when stdout is a terminal, compact JSON otherwise |
| `table` | a table |
| `json` | one JSON document |
| `jsonl` | one JSON value per line (one per array item) |
Set the default with `IDX_OUTPUT` or `general.output`. Colour is off whenever
stdout is not a terminal, and with `--no-color`.
## The contract
- stdout carries only data; warnings, progress and errors go to stderr.
- On failure stdout is empty.
- In JSON modes an error is one JSON object on stderr:
```json
{"error":true,"code":"INVALIDINPUT","message":"invalid input: invalid ticker symbol '../x'"}
```
## Exit codes
| Exit | Meaning | What to do |
| --- | --- | --- |
| `0` | success | |
| `2` | invalid input or config | fix the command |
| `3` | not found, no data, or no cached data offline | check the ticker or name; go online |
| `4` | upstream unavailable | retry later |
| `5` | unsupported | use another command or provider |
| `1` | anything else | read the message |
## Pipes
```bash
# names and prices
idx stocks quote BBCA BBRI | jq -r '.[] | "\(.symbol) \(.price)"'
# the last five daily closes
idx -o jsonl stocks history BBCA --period 1y | tail -5
# symbols from stdin
idx stocks screen --filter high-dividend | jq -r '.[].symbol' | idx stocks compare -
```
`stocks quote` and `stocks compare` read symbols from stdin when given `-`,
separated by whitespace or commas.

View file

@ -0,0 +1,57 @@
---
title: Ownership
description: KSEI shareholder data, synced once and queried offline.
---
The ownership commands work on the monthly KSEI register of holders above 1%
("Pemegang Saham di Atas 1%") that IDX publishes for every listed company.
idx keeps it in a local SQLite database, so queries are instant and work
offline.
## Get the data
```bash
idx ownership sync
```
This downloads a maintained snapshot (a few MB, currently the latest three
months) and installs it. Run it again any time: it does nothing when you are
already current, and it never replaces a database holding more history than
the snapshot. `idx ownership releases` lists the months you have.
## Queries
```bash
idx ownership ticker BBCA # holders of one stock, with concentration
idx ownership entity "ANTHONI SALIM" # every holding of one investor
idx ownership search salim # find investor names
idx ownership changes --from 2026-08-31 --to 2026-09-30
idx ownership concentration --top 20 # most concentrated stocks (by HHI)
idx ownership cross-holders --min-tickers 3
idx ownership graph BBCA --depth 2 # ownership network; --format dot for Graphviz
```
`changes` lists holders that are new, exited, increased or decreased between
two releases. `ticker` also reports concentration: the top holder's share,
the top three, the Herfindahl index (HHI) and the free float (shares held by
holders below 1%).
## Import reports yourself
The snapshot covers most needs. To load a month it lacks, or older history,
import IDX's reports directly:
```bash
idx ownership discover # find the latest report URLs on IDX
idx ownership import --url <xlsx-or-pdf> # needs curl-impersonate
idx ownership import --file report.xlsx # or a local XLSX, PDF, ZIP or TXT
```
Since June 2026 IDX publishes the register as XLSX; earlier months were PDF
announcements, which need `mutool`. See [helper tools](/start/install/#helper-tools).
## Entity names
The register spells some investors differently from month to month.
`idx ownership resolve` lists unresolved names and lets you map an alias to
an entity or merge two entities.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
---
title: Stocks
description: Quotes, history, company data, analysis and screening.
---
All `stocks` commands take IDX tickers (`BBCA`, or `BBCA.JK`). Every flag is
listed in the [command reference](/cli/reference/).
## Quotes and history
```bash
idx stocks quote BBCA BBRI,BMRI
idx stocks history BBCA --period 1y --interval 1wk
```
`quote` takes several tickers, separated by spaces or commas, or `-` to read
them from stdin. `history` takes `--period` (`1d` to `5y`) and `--interval`
(`1d`, `1wk`, `1mo`).
## Company data
| Command | What it shows |
| --- | --- |
| `profile` | sector, industry, description, contacts and officers |
| `financials` | income, balance sheet and cash flow statements (`--statement income,balance`) |
| `earnings` | reported and estimated earnings |
| `sentiment` | crowd sentiment |
| `insights` | AI insights from the provider |
| `news` | recent news |
## Analysis
| Command | What it computes |
| --- | --- |
| `technical` | trend, RSI, MACD, moving averages and signals |
| `growth` | revenue and earnings growth rating |
| `valuation` | P/E, P/B, ROE, net margin and EV/EBITDA, with a rating |
| `risk` | debt to equity, current ratio and ROA, with a rating |
| `fundamental` | growth, valuation and risk in one report |
| `compare` | `fundamental` for several tickers side by side |
```bash
idx stocks fundamental BBRI
idx stocks compare BBCA BBRI BMRI
```
## Screening
```bash
idx stocks screen --filter high-dividend --limit 20
```
Filters: `top-performers` (default), `worst-performers`, `high-dividend`,
`low-pe`, `52w-high`, `52w-low`, `high-volume`, `large-cap`.
Screen results pipe straight into `compare`:
```bash
idx stocks screen --filter high-dividend | jq -r '.[].symbol' | idx stocks compare -
```
## Providers
MSN is the default for quotes, company data and screening; Yahoo serves
price history. Switch with `IDX_PROVIDER=msn|yahoo` and
`IDX_HISTORY_PROVIDER=auto|yahoo|msn`, or the matching
[config keys](/start/config/).