@agentearth.ai/cli 0.1.0-beta.3 → 0.1.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentearth.ai/cli",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "Agent-first CLI that helps AI agents discover, inspect, and execute AgentEarth tools from any shell.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,30 +1,92 @@
1
- # AgentEarth CLI Skill
1
+ ---
2
+ name: agentearth
3
+ description: >-
4
+ Discover, inspect, and execute AgentEarth marketplace tools through the AgentEarth CLI.
5
+ Use when the user explicitly asks to use AgentEarth/agentearth, asks for AgentEarth tools,
6
+ or needs an external tool workflow such as live data retrieval, structured web/API results,
7
+ document or media conversion, translation, calculations, image/video generation,
8
+ presentation editing, or other tool-backed services. Follow host approval, credential,
9
+ network, and safety policies before invoking external commands.
2
10
 
3
- Use AgentEarth CLI when the user asks you to discover, inspect, or execute AgentEarth tools.
11
+ requirements:
12
+ env:
13
+ - AGENTEARTH_API_KEY
4
14
 
5
- ## Commands
15
+ credentials:
16
+ type: api_key
17
+ env: AGENTEARTH_API_KEY
18
+ injection: environment
19
+ required: true
20
+ ---
6
21
 
7
- - Use `ae list` when the user task clearly belongs to a known tool category, such as image generation, video generation, or PPT editing.
8
- - For filtered list queries, write the query JSON to `query.json` and run `ae list @query.json`; do not hand-write inline JSON in PowerShell.
9
- - Use `ae recommend "<query>"` when the user task is ambiguous and you are not sure which tool category should be used.
10
- - Use `ae detail <tool_name>` before execution to read the tool input schema.
11
- - Use `ae execute <tool_name> @params.json` to execute the selected tool.
12
- - Use `ae update` only after the user confirms they want to update the CLI.
22
+ # AgentEarth
13
23
 
14
- ## Rules
24
+ Use AgentEarth as an external tool marketplace. Treat the user's request as the task to solve, then discover the best matching tool, inspect its schema, validate parameters, execute it, and summarize the result.
15
25
 
16
- - All agent-facing commands output JSON by default.
17
- - Select tools by `tool_name`.
18
- - Do not use `tool_url` as an argument.
19
- - Do not call the removed `ae schema` command.
20
- - Do not pass API keys to normal tool commands; `ae login` stores credentials for later use.
21
- - If login is required, read the API key only from the caller-provided `AGENTEARTH_API_KEY` environment variable and pipe it to `ae login --api-key-stdin`; do not search the filesystem for API keys.
26
+ ## Command Surface
22
27
 
23
- ## Typical Flows
28
+ Prefer `ae` on Unix-like shells and `ae.cmd` in Windows PowerShell when the PowerShell shim is blocked by execution policy.
24
29
 
25
- Known category:
30
+ Use these commands:
26
31
 
27
- Create `query.json`:
32
+ - `ae recommend "<task>"` to discover tools for ambiguous or natural-language tasks.
33
+ - `ae list @query.json` to list tools for a known category or keyword.
34
+ - `ae detail <tool_name>` to inspect a selected tool's schema before execution.
35
+ - `ae execute <tool_name> @params.json` to run the selected tool with validated parameters.
36
+ - `ae update` only when the user confirms they want to update the CLI.
37
+
38
+ All agent-facing commands return JSON by default. Select tools by `tool_name`; never use `tool_url` as a CLI argument. Do not call removed or undocumented commands such as `ae schema`.
39
+
40
+ ## Credential Handling
41
+
42
+ Use credentials only through the active host environment.
43
+
44
+ - Read the API key from `AGENTEARTH_API_KEY` when the host provides it.
45
+ - If login is required, pipe the caller-provided key to `ae login --api-key-stdin`.
46
+ - Never ask the user to paste a key unless the host explicitly requires manual credential setup.
47
+ - Never search the filesystem, shell history, logs, or config files for API keys.
48
+ - Never print, log, echo, or include secrets in generated files.
49
+
50
+ If authentication fails, report that AgentEarth authentication failed and ask the user to verify the configured API key or login state. Do not expose request headers or secret values.
51
+
52
+ ## Execution Workflow
53
+
54
+ 1. Restate the task internally as a concise AgentEarth query.
55
+ 2. Discover candidate tools with `ae recommend "<task>"`, or `ae list @query.json` when the category is already clear.
56
+ 3. Inspect the best candidate with `ae detail <tool_name>`.
57
+ 4. Build `params.json` strictly from the inspected input schema.
58
+ 5. Validate required fields, types, enums, formats, and `additionalProperties` when present.
59
+ 6. Execute with `ae execute <tool_name> @params.json`.
60
+ 7. Summarize the useful result for the user and omit internal command noise unless it is needed for troubleshooting.
61
+
62
+ Use a fallback tool only when the first suitable tool fails for a recoverable reason or clearly does not satisfy the task.
63
+
64
+ ## Tool Selection
65
+
66
+ Choose the tool that best matches the task intent and can be safely executed with available context.
67
+
68
+ Prefer candidates with:
69
+
70
+ - clear task relevance;
71
+ - complete and understandable input schema;
72
+ - required parameters that can be filled from the user's request or conversation context;
73
+ - lower cost when otherwise equivalent;
74
+ - narrower, more specialized behavior for the requested job.
75
+
76
+ If no candidate is suitable, refine the query once. If discovery still fails, tell the user that AgentEarth did not return a suitable tool.
77
+
78
+ ## Parameter Rules
79
+
80
+ Build parameter files as JSON objects matching the selected tool schema.
81
+
82
+ - Use only values from the user's request, conversation context, or deterministic transformations of those values.
83
+ - Do not invent required values such as URLs, IDs, tokens, locations, dates, file paths, or account-specific inputs.
84
+ - Ask a concise clarification question when a required value is missing.
85
+ - Remove keys not defined by the schema when `additionalProperties` is `false`.
86
+ - Do not reuse example keys unless they exist in the selected schema.
87
+ - Write query or execution payloads to JSON files instead of hand-writing inline JSON in PowerShell.
88
+
89
+ Known-category list example:
28
90
 
29
91
  ```json
30
92
  {"keyword":"image"}
@@ -36,10 +98,29 @@ ae detail <tool_name>
36
98
  ae execute <tool_name> @params.json
37
99
  ```
38
100
 
39
- Ambiguous task:
101
+ Ambiguous-task example:
40
102
 
41
103
  ```text
42
- ae recommend "<user task>"
104
+ ae recommend "find current hotel prices in Sapporo for next weekend"
43
105
  ae detail <tool_name>
44
106
  ae execute <tool_name> @params.json
45
107
  ```
108
+
109
+ ## Error Handling
110
+
111
+ On command or tool failure:
112
+
113
+ - Read the JSON error message before retrying.
114
+ - Retry once only when the failure is likely transient or caused by a fixable parameter issue.
115
+ - Correct parameters only when the correction is supported by the schema and available context.
116
+ - Try a fallback candidate only when it is clearly relevant to the original task.
117
+ - Stop and explain the failure when the error is authentication, authorization, missing user input, unsupported task, or repeated tool failure.
118
+
119
+ ## Result Presentation
120
+
121
+ Return the final answer, not a transcript of internal discovery.
122
+
123
+ - Summarize key facts, generated asset links, converted file paths, or tool outputs.
124
+ - Include caveats from the tool result when relevant.
125
+ - Mention AgentEarth only when useful for provenance or when troubleshooting is needed.
126
+ - Do not expose raw credentials, internal request headers, or irrelevant JSON fields.