mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
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:
parent
e231061820
commit
e6805474f5
37 changed files with 3629 additions and 4 deletions
75
web/src/content/docs/start/config.md
Normal file
75
web/src/content/docs/start/config.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
title: Configuration
|
||||
description: Config file, environment variables and their precedence.
|
||||
---
|
||||
|
||||
idx works without configuration. To change defaults, use the config file,
|
||||
environment variables or flags. When they disagree, the first one wins:
|
||||
|
||||
1. command-line flags
|
||||
2. environment variables
|
||||
3. the config file
|
||||
4. built-in defaults
|
||||
|
||||
## Config file
|
||||
|
||||
`~/.config/idx/config.toml` (or `$XDG_CONFIG_HOME/idx/config.toml`):
|
||||
|
||||
```bash
|
||||
idx config init # write the defaults below
|
||||
idx config set general.output json
|
||||
idx config get cache.quote_ttl
|
||||
idx config path
|
||||
```
|
||||
|
||||
```toml
|
||||
[general]
|
||||
provider = "msn" # msn | yahoo
|
||||
history_provider = "auto" # auto | yahoo | msn
|
||||
exchange = "JK"
|
||||
output = "auto" # auto | table | json | jsonl
|
||||
color = true
|
||||
|
||||
[cache]
|
||||
quote_ttl = 300 # seconds
|
||||
fundamental_ttl = 3600
|
||||
|
||||
[ownership]
|
||||
# db_path = "/path/to/ownership.db"
|
||||
# snapshot_manifest = "https://..."
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Overrides |
|
||||
| --- | --- |
|
||||
| `IDX_PROVIDER` | `general.provider` |
|
||||
| `IDX_HISTORY_PROVIDER` | `general.history_provider` |
|
||||
| `IDX_EXCHANGE` | `general.exchange` |
|
||||
| `IDX_OUTPUT` | `general.output` |
|
||||
| `IDX_NO_COLOR` | `general.color` (`1` or `true` disables colour) |
|
||||
| `IDX_CACHE_QUOTE_TTL` | `cache.quote_ttl` |
|
||||
| `IDX_CACHE_FUNDAMENTAL_TTL` | `cache.fundamental_ttl` |
|
||||
| `IDX_OWNERSHIP_SNAPSHOT_MANIFEST` | `ownership.snapshot_manifest` |
|
||||
| `IDX_CURL_IMPERSONATE_BIN` | path to a `curl_chrome*` binary |
|
||||
|
||||
## Files idx keeps
|
||||
|
||||
| What | Where |
|
||||
| --- | --- |
|
||||
| Config | `~/.config/idx/config.toml` |
|
||||
| Cache | `~/.cache/idx/` (`idx cache info`, `idx cache clear`) |
|
||||
| Ownership database | `~/.local/share/idx/ownership.db` |
|
||||
|
||||
The MCP server reads the same config, cache and database.
|
||||
|
||||
## Offline and caching
|
||||
|
||||
Quotes are cached for `quote_ttl` seconds and fundamentals for
|
||||
`fundamental_ttl`. `--offline` makes no network requests and serves cached
|
||||
data, even when stale; `--no-cache` always fetches.
|
||||
|
||||
:::note
|
||||
A config created by `idx config init` before v0.3 pins `output = "table"`.
|
||||
Run `idx config set general.output auto` to get JSON when piped.
|
||||
:::
|
||||
98
web/src/content/docs/start/install.mdx
Normal file
98
web/src/content/docs/start/install.mdx
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
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`. pnpm 10+ and bun skip install scripts by default; allow them
|
||||
with `pnpm add --global --allow-build=idx-cli idx-cli` or
|
||||
`bun add --global --trust idx-cli`.
|
||||
|
||||
</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.1 --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, `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` |
|
||||
| `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
|
||||
```
|
||||
50
web/src/content/docs/start/quickstart.md
Normal file
50
web/src/content/docs/start/quickstart.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
title: Quickstart
|
||||
description: First stock and ownership commands.
|
||||
---
|
||||
|
||||
## Stocks
|
||||
|
||||
Tickers are IDX codes; the `.JK` suffix is optional.
|
||||
|
||||
```bash
|
||||
idx stocks quote BBCA # one quote
|
||||
idx stocks quote BBCA BBRI BMRI # several (spaces or commas)
|
||||
idx stocks history BBCA --period 1y # daily OHLCV
|
||||
idx stocks technical BBCA # trend, RSI, MACD, moving averages
|
||||
idx stocks fundamental BBCA # growth, valuation and risk together
|
||||
idx stocks compare BBCA BBRI BMRI # fundamentals side by side
|
||||
idx stocks screen --filter high-dividend
|
||||
```
|
||||
|
||||
## Ownership
|
||||
|
||||
Ownership data comes from the monthly KSEI register of holders above 1%.
|
||||
Download the maintained snapshot once; after that every query runs offline.
|
||||
|
||||
```bash
|
||||
idx ownership sync # a few MB, safe to rerun
|
||||
idx ownership ticker BBCA # who holds BBCA
|
||||
idx ownership entity "ANTHONI SALIM" # everything one investor holds
|
||||
idx ownership search salim # find investor names
|
||||
idx ownership releases # which months you have
|
||||
idx ownership changes --from 2026-08-31 --to 2026-09-30
|
||||
```
|
||||
|
||||
## JSON
|
||||
|
||||
In a terminal idx prints tables. When its output is piped or captured it
|
||||
prints JSON, so scripts and agents need no flag:
|
||||
|
||||
```bash
|
||||
idx stocks quote BBCA BBRI | jq -r '.[] | "\(.symbol) \(.price)"'
|
||||
idx -o json stocks quote BBCA # force JSON in a terminal
|
||||
```
|
||||
|
||||
See [Output and exit codes](/cli/output/) for the full contract.
|
||||
|
||||
## Next
|
||||
|
||||
- [Stocks guide](/cli/stocks/) and [ownership guide](/cli/ownership/)
|
||||
- [Configuration](/start/config/)
|
||||
- [Use idx from an AI agent](/mcp/setup/)
|
||||
Loading…
Add table
Add a link
Reference in a new issue