-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usability of the NEAR CLI in scripting? #437
Comments
@artob What is your use case? Wouldn't it be easier to use near-api-rs, py-near, or near-api-js instead of shelling out CLI commands? |
@frol The category of use cases is shell scripting, which is the single largest and most significant category for any CLI tool. The novel, explicit command structure of near-cli-rs is in principle uniquely well suited to scripting, as compared to most CLI tools including the old JS-based CLI. In fact, arguably near-cli-rs would be even better suited to scripting than to actual use by humans, since for the latter it tends to be rather verbose which goes against the grain for the supermajority of CLI utilities in wide use. However, near-cli-rs's inherent high potential for scripting is right now being held back by the incidental issues identified above. Suggest it would be a good idea to take a clear decision on whether scripting is supported or not. If not, consider removing "to script it" from the following output printed on every invocation:
|
@artob Thank you for surfacing your experience! I think Just FYI, I also use NEAR CLI for scripting, but I use the scripts interactively - so I setup aliases and finish the command in interactive mode, so I rely on human output. |
For exit codes, suggest adopting the sysexits(3) standard codes. They are granular enough to be useful discriminators, without requiring tons of work. There isn't really any other comparable set of standard codes. For a Rust implementation, see e.g. github.com/dryrust/clientele.rs/blob/master/lib/clientele/src/sysexits.rs. |
❓ What is the plan to make the CLI usable for scripting? Because as it stands currently, that seems rather difficult:
Invoking:
near account view-account-summary near network-config testnet now
Invoking:
near account view-account-summary notfound network-config testnet now
The specific difficulties encountered here are:
--quiet
or--silent
) for silencing all spurious output--output json
) for printing machine-readable outputThe text was updated successfully, but these errors were encountered: