This is a super low priority idea, but our CLI could be even smaller by dropping yargs and moving to https://nodejs.org/api/util.html#utilparseargsconfig that is native in node 18+ (and bun/deno). Most of the code is already more less easy to swap argument parsing around, so it should be an easy-ish task.
[partially regret not doing that from the get go but alas]
Realistically, what would need to change is:
- in
entrypoints/_shared.ts, handle the main process.argv.slice(2) to extract out -h / --help and -v / --version. Depending on remaining positionals, the messages would print.
- Otherwise, try to get commands from the command registry and call _run accordingly.
- ApifyCommand will need changes to build the options object for parseArgs per command (but that should be easy enough with minimal code changes)
- ??? other things I don't know at 2am
This is a super low priority idea, but our CLI could be even smaller by dropping yargs and moving to https://nodejs.org/api/util.html#utilparseargsconfig that is native in node 18+ (and bun/deno). Most of the code is already more less easy to swap argument parsing around, so it should be an easy-ish task.
[partially regret not doing that from the get go but alas]
Realistically, what would need to change is:
entrypoints/_shared.ts, handle the main process.argv.slice(2) to extract out-h/--helpand-v/--version. Depending on remaining positionals, the messages would print.