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
53
web/src/content/docs/cli/output.md
Normal file
53
web/src/content/docs/cli/output.md
Normal 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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue