Closed userquin closed 2 months ago
don't merge yet, I'm going to add an utility helper to allow return the CommandType in all commands, that's, all new agents commands actions will be functions like npm.run
: will also handle {0}
This is the current ni
behavior, generated commands here with same behavior:
it would be helpful to update the readme showing how to use the new functionality
I refactored it a bit. So the COMMANDS
is now an object of arrays. Which means it would be a breaking change. I also provided a utility constructCommand
to make it easier to construct.
@benmccann could you help to confirm how much it would affect your usage? If not much I am thinking to have it as 0.2 and then update the usage side on ni
Description
This PR converts every command in
COMMANDS
to command and argument pairs.And provide a new utility,
constructCommand
, to make the resolution easier.Linked Issues
https://github.com/antfu-collective/ni/pull/231#discussion_r1718864647
Additional context
I do my best to keep types similar to
COMMANDS
inagents.ts
, I guess it is fine usingsatisfies
in thebuildCommands
return type.