Skip to content

Indexer: CLI flags for the firehose switches (override env) #13

Description

@melvincarvalho

The firehose switches (HOSES, INDEX_LEGACY_KINDS) are env-only. Add CLI flags for ad-hoc runs, with flags overriding env (env stays the default so pm2/.env keep working).

Flags

  • --hoses <list> / --hoses=<list> — comma list of hose names (overrides HOSES).
  • --no-legacy — disable the legacy raw-upsert fallback (overrides INDEX_LEGACY_KINDS).
  • --legacy — force it on.
  • --help / -h — usage, then exit.

Example: node index.js --hoses profiles --no-legacy

Design

  • parseArgs(argv) → an env-overlay object ({ HOSES?, INDEX_LEGACY_KINDS?, help? }); only keys the user passed are present.
  • runIndexer builds env = { ...process.env, ...parseArgs() } and passes it to planIngest — so flags win, env is the fallback, and planIngest stays pure.
  • --help handled at the CLI entry points (index.js, src/indexer.js), printing usage and exiting.

Acceptance

  • node index.js --hoses profiles --no-legacy runs the profiles hose only, no legacy kinds.
  • Env still works unchanged when no flags are given; flags override env when both are set.
  • --help prints usage. npm test green incl. new parseArgs tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions