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.
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 (overridesHOSES).--no-legacy— disable the legacy raw-upsert fallback (overridesINDEX_LEGACY_KINDS).--legacy— force it on.--help/-h— usage, then exit.Example:
node index.js --hoses profiles --no-legacyDesign
parseArgs(argv)→ an env-overlay object ({ HOSES?, INDEX_LEGACY_KINDS?, help? }); only keys the user passed are present.runIndexerbuildsenv = { ...process.env, ...parseArgs() }and passes it toplanIngest— so flags win, env is the fallback, andplanIngeststays pure.--helphandled at the CLI entry points (index.js,src/indexer.js), printing usage and exiting.Acceptance
node index.js --hoses profiles --no-legacyruns the profiles hose only, no legacy kinds.--helpprints usage.npm testgreen incl. newparseArgstests.