nvs agent
nvs agent is how a coding agent (an AI assistant that writes code) looks up the Novis language and its library.
nvs agent index prints one line for each Core method, enum, exception and attribute, and for each chapter and heading of the reference. nvs agent find <query> prints the index lines whose name matches the query. nvs agent show <symbol> prints the full entry: for a method, the signature, the description, the parameters and the errors.
The commands read from the nvs binary, so a result always describes the installed version. The usual order is find, then show, then write the program, then nvs check.
With --json, index, find and show print one JSON document for a tool to read.
Good to know: when no name matches, find prints nothing and the exit status is 0. When show does not find a symbol, it exits with an error and prints the nearest names.
Examples
A program written from index lines
<?nvs// Shows a program written from lines that `nvs agent find` printed.// Each step names the command and the line that the step uses.
array<string> $tags = ['urgent', 'billing', 'eu'];
// `nvs agent find count` lists `Core\Arr::count(array<T> $a): uint`.// This prints `3 tags`.echo Core\Arr::count($tags), " tags\n";
// `nvs agent find join` lists `Core\Str::join(array<string> $parts, string $separator = ""): string`.// The part `= ""` is a default value, so the second argument is optional.echo Core\Str::join($tags, ', '), "\n";echo Core\Str::join($tags), "\n";
// `nvs agent find strtoupper` prints nothing. No function has that name.// `nvs agent find upper` lists `Core\Str::upper(string $s): string`. This prints `URGENT`.echo Core\Str::upper($tags[0]), "\n";3 tagsurgent, billing, euurgentbillingeuURGENTChangelog
| Version | Change |
|---|---|
0.0.6 | nvs agent show prints the help of a built-in name. For an enum of Novis\Image, Novis\Intl, Novis\Pdf or Novis\Spreadsheet, it now also lists the enum's cases. |
