@engini/cli 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/cli.js +55 -5
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Engini AI Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ engini login --api-key eng_… # or run interactively on a TTY
|
|
|
19
19
|
engini applications list --available # discover connector apps
|
|
20
20
|
engini tools list --application monday # discover tools
|
|
21
21
|
engini tools call monday_create_item --args '{}' --connection 3
|
|
22
|
+
engini tools call gmail_send_mail --args '{}' --file attachmentsarray=@report.pdf # attach a file
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
## Commands
|
package/dist/cli.js
CHANGED
|
@@ -503,8 +503,9 @@ CORE COMMANDS
|
|
|
503
503
|
Discover available tools (one concise summary per tool).
|
|
504
504
|
tools get <tool_id>
|
|
505
505
|
Full input/output schema + capability flags for one tool.
|
|
506
|
-
tools call <tool_id> --args <json|@file|-> [--connection <id>] [--raw] [--llm <vendor>]
|
|
507
|
-
Execute a tool against a connection.
|
|
506
|
+
tools call <tool_id> --args <json|@file|-> [--file <field=@path>] [--connection <id>] [--raw] [--llm <vendor>]
|
|
507
|
+
Execute a tool against a connection. Attach files with --file (repeat for a
|
|
508
|
+
list). Validate first with --dry-run.
|
|
508
509
|
applications list [--search <q>] [--available] [--limit <n>]
|
|
509
510
|
Browse connector apps (slug, categories, tool counts).
|
|
510
511
|
applications get <slug>
|
|
@@ -557,6 +558,9 @@ EXAMPLES
|
|
|
557
558
|
engini tools call monday_create_item --args @item.json --connection 3
|
|
558
559
|
echo '{"name":"x"}' | engini tools call monday_create_item --args -
|
|
559
560
|
|
|
561
|
+
# Attach files (repeat --file for a list of files)
|
|
562
|
+
engini tools call gmail_send_mail --args '{"to":"a@b.com","subject":"hi","body":"see attached"}' --file attachmentsarray=@report.pdf
|
|
563
|
+
|
|
560
564
|
# Provider-shaped result for an agent loop
|
|
561
565
|
engini tools call monday_create_item --args '{}' --llm openai --tool-call-id call_1
|
|
562
566
|
|
|
@@ -584,6 +588,7 @@ var EXAMPLES = {
|
|
|
584
588
|
engini tools call monday_create_item --args '{}' --dry-run
|
|
585
589
|
engini tools call monday_create_item --args @item.json --connection 3
|
|
586
590
|
echo '{"name":"x"}' | engini tools call monday_create_item --args -
|
|
591
|
+
engini tools call gmail_send_mail --args '{}' --file attachmentsarray=@report.pdf
|
|
587
592
|
engini tools call monday_create_item --args '{}' --llm openai --tool-call-id call_1`,
|
|
588
593
|
"applications list": `Examples:
|
|
589
594
|
engini applications list --available --limit 10
|
|
@@ -697,6 +702,7 @@ function registerLogout(program) {
|
|
|
697
702
|
import { readFileSync as readFileSync2 } from "fs";
|
|
698
703
|
import {
|
|
699
704
|
AnthropicProvider,
|
|
705
|
+
File,
|
|
700
706
|
OpenAIProvider
|
|
701
707
|
} from "@engini/sdk";
|
|
702
708
|
function loadArgs(spec) {
|
|
@@ -723,6 +729,45 @@ function loadArgs(spec) {
|
|
|
723
729
|
}
|
|
724
730
|
return data;
|
|
725
731
|
}
|
|
732
|
+
function loadFiles(specs) {
|
|
733
|
+
const out = {};
|
|
734
|
+
for (const spec of specs ?? []) {
|
|
735
|
+
const eq = spec.indexOf("=");
|
|
736
|
+
if (eq <= 0) {
|
|
737
|
+
return fail(2 /* USAGE */, `--file must be field=@path, got '${spec}'.`);
|
|
738
|
+
}
|
|
739
|
+
const name = spec.slice(0, eq);
|
|
740
|
+
const raw = spec.slice(eq + 1);
|
|
741
|
+
const path = raw.startsWith("@") ? raw.slice(1) : raw;
|
|
742
|
+
let attached;
|
|
743
|
+
try {
|
|
744
|
+
attached = File.fromPath(path);
|
|
745
|
+
} catch (err) {
|
|
746
|
+
return fail(2 /* USAGE */, `Cannot read ${path}: ${err.message}`);
|
|
747
|
+
}
|
|
748
|
+
const existing = out[name];
|
|
749
|
+
if (existing === void 0) out[name] = attached;
|
|
750
|
+
else out[name] = Array.isArray(existing) ? [...existing, attached] : [existing, attached];
|
|
751
|
+
}
|
|
752
|
+
return out;
|
|
753
|
+
}
|
|
754
|
+
function previewArgs(value) {
|
|
755
|
+
if (value instanceof File) {
|
|
756
|
+
return { filename: value.filename, mime_type: value.mimeType, size: value.content.length };
|
|
757
|
+
}
|
|
758
|
+
if (Array.isArray(value)) return value.map((item) => previewArgs(item));
|
|
759
|
+
if (value && typeof value === "object") {
|
|
760
|
+
const out = {};
|
|
761
|
+
for (const [key, item] of Object.entries(value)) {
|
|
762
|
+
out[key] = previewArgs(item);
|
|
763
|
+
}
|
|
764
|
+
return out;
|
|
765
|
+
}
|
|
766
|
+
return value;
|
|
767
|
+
}
|
|
768
|
+
function collectFile(value, previous = []) {
|
|
769
|
+
return [...previous, value];
|
|
770
|
+
}
|
|
726
771
|
function parseConnection(value) {
|
|
727
772
|
if (value === void 0) return void 0;
|
|
728
773
|
const id = Number(value);
|
|
@@ -760,12 +805,13 @@ async function callBody(toolId, opts) {
|
|
|
760
805
|
fail(2 /* USAGE */, "Pass only one of --raw / --llm.");
|
|
761
806
|
}
|
|
762
807
|
const args = loadArgs(opts.args);
|
|
808
|
+
Object.assign(args, loadFiles(opts.file));
|
|
763
809
|
const connection = parseConnection(opts.connection);
|
|
764
810
|
if (dryRun()) {
|
|
765
811
|
printOutput({
|
|
766
812
|
would_call: {
|
|
767
813
|
tool_slug: toolId,
|
|
768
|
-
arguments: args,
|
|
814
|
+
arguments: previewArgs(args),
|
|
769
815
|
connection_id: connection ?? null,
|
|
770
816
|
toolset_id: opts.toolset ?? null
|
|
771
817
|
}
|
|
@@ -789,7 +835,11 @@ async function callBody(toolId, opts) {
|
|
|
789
835
|
);
|
|
790
836
|
}
|
|
791
837
|
function registerToolsCall(tools) {
|
|
792
|
-
const cmd = tools.command("call").description("Execute a tool against a connection.").argument("[tool_id]", "Tool slug").option("--args <args>", "JSON object, @file.json, or - for stdin").option(
|
|
838
|
+
const cmd = tools.command("call").description("Execute a tool against a connection.").argument("[tool_id]", "Tool slug").option("--args <args>", "JSON object, @file.json, or - for stdin").option(
|
|
839
|
+
"--file <spec>",
|
|
840
|
+
"Attach a file: field=@path (repeat the same field for a list of files)",
|
|
841
|
+
collectFile
|
|
842
|
+
).option("--connection <id>", "Connection id to run against").option("--toolset <id>", "Toolset id to resolve the connection").option("--raw", "Emit the tool output verbatim (no envelope)").option("--llm <vendor>", "Provider-shaped result: openai|anthropic").option("--tool-call-id <id>", "Correlation id for --llm output");
|
|
793
843
|
addUniversalOptions(cmd, { mutating: true });
|
|
794
844
|
cmd.action(async (toolId, opts, command) => {
|
|
795
845
|
await runCommand(command, opts, true, () => callBody(toolId, opts));
|
|
@@ -915,7 +965,7 @@ function registerWhoami(program) {
|
|
|
915
965
|
}
|
|
916
966
|
|
|
917
967
|
// src/version.ts
|
|
918
|
-
var VERSION = true ? "0.
|
|
968
|
+
var VERSION = true ? "0.6.0" : "0.0.0";
|
|
919
969
|
|
|
920
970
|
// src/main.ts
|
|
921
971
|
function buildProgram() {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engini/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Engini CLI — machine-first command line over the Engini Public API",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"engini": "./dist/cli.js"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test": "vitest run"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@engini/sdk": "^0.
|
|
24
|
+
"@engini/sdk": "^0.6.0",
|
|
25
25
|
"commander": "^12.1.0",
|
|
26
26
|
"smol-toml": "^1.3.0"
|
|
27
27
|
},
|