Skip to content

docs(schema): document the options the CLI already accepts - #491

Open
boleklebovski wants to merge 1 commit into
nansen-ai:mainfrom
boleklebovski:docs/schema-missing-options
Open

docs(schema): document the options the CLI already accepts#491
boleklebovski wants to merge 1 commit into
nansen-ai:mainfrom
boleklebovski:docs/schema-missing-options

Conversation

@boleklebovski

Copy link
Copy Markdown
Contributor

Problem

src/schema.json is the machine-readable description of the CLI surface, but several groups of options that the code already implements are missing from it. Anything that consumes the schema (shell completions, the MCP surface, --help tooling, docs generation) therefore cannot see them.

Concretely, on main the schema is missing:

Command Schema options Options the code reads
alerts create 11 53
alerts update 12 54
alerts list 0 (no options key at all) 7
research profiler batch 3 5
research token screener 3 4

Evidence

The 42 type-specific alert flags are built in src/commands/alerts.js — e.g. buildSmTokenFlowsData() iterates a flowFields list and reads options['<field>-min'] / options['<field>-max'] for each of inflow-1h/1d/7d, outflow-1h/1d/7d, netflow-1h/1d/7d:

const flowFields = ['inflow-1h','inflow-1d','inflow-7d','outflow-1h','outflow-1d','outflow-7d','netflow-1h','netflow-1d','netflow-7d'];
for (const field of flowFields) {
  const range = buildRange(options[`${field}-min`], options[`${field}-max`]);
  if (range) data[field.replace(/-/g,'_')] = range;
}

The alerts list handler reads exactly flags.enabled, flags.disabled, options.type, options['token-address'], options.chain, options.offset and options.limit — none of which were described.

Change

Adds the missing option entries only. No option is renamed, removed or re-typed; no runtime code is touched. The additions were derived from the command implementations themselves (the alert set matches the code's own typeSpecificFlags table entry-for-entry), so nothing here is invented.

Verification

  • src/schema.json parses, has no duplicate keys, keeps 2-space indentation and the existing key ordering.
  • Diffed schema-vs-code both ways: 94 options added, 0 removed, and every added option name resolves to a real read in src/**/*.js.

A changeset is included (patch).

@nansen-pr-reviewer

nansen-pr-reviewer Bot commented Aug 13, 2026

Copy link
Copy Markdown

pr-reviewer Summary for #1aee8cb

No issues found

The code review completed successfully with no findings.

Review effort: 2/5 (Simple)

Summary

This PR is a clean schema sync — it adds 94 previously-missing option entries to src/schema.json that the CLI already implemented but had never documented in the machine-readable schema. No runtime code is modified.

I verified every addition against the source:

  • alerts list options (type, enabled, disabled, token-address, chain, offset, limit) — all seven map exactly to the options/flags reads in the list handler in src/commands/alerts.js.
  • alerts create/alerts update type-specific flags — the 42 flow/filter/counterparty flags match the typeSpecificFlags table and the three build*Data() functions entry-for-entry. Option counts land at 53 (create) and 54 (update), matching the PR's claim (the +1 in update is the enabled flag, which is correct since create only has disabled).
  • research profiler batch --addresses/--file — both are read unconditionally in the batch branch of cli.js (lines 1265–1280).
  • research token screener --search — the search variable is read from options.search at line 1348 of cli.js and used for client-side filtering.
  • Schema JSON parses cleanly with no syntax errors and maintains 2-space indentation throughout.
  • Changeset is present, correctly named nansen-cli, and uses patch — appropriate for a documentation/schema sync with no user-visible behavior change.

Token usage: 2,156 input, 5,218 output, 750,445 cache read, 51,313 cache write | Usage Guide

New pushes are reviewed automatically with a 10-minute cooldown between reviews. To request a review at any time, comment @nansen-pr-reviewer re-review.

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a moderate effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected
  • Review comment contains non-blocking feedback

If you have any concerns, please request a manual review.

@boleklebovski
boleklebovski force-pushed the docs/schema-missing-options branch from 7ef9283 to da9b5c3 Compare August 13, 2026 18:35

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a moderate effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected

If you have any concerns, please request a manual review.

The machine-readable schema was missing the 42 type-specific alerts
flags, the seven `alerts list` filters, `--addresses`/`--file` on
`research profiler batch` and `--search` on `research token screener`.
All are already read by the command implementations.

Signed-off-by: boleklebovski <160799963+boleklebovski@users.noreply.github.com>
@boleklebovski
boleklebovski force-pushed the docs/schema-missing-options branch from da9b5c3 to 1aee8cb Compare August 14, 2026 22:17

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a moderate effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected

If you have any concerns, please request a manual review.

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.

1 participant