@plori/cli 0.1.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/README.md +61 -0
- package/bin/plori.js +40 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# plori CLI
|
|
2
|
+
|
|
3
|
+
`plori` drives your hosted agents (each one a cloud computer with its own
|
|
4
|
+
disk, tools, and memory) from a terminal or a script. It is the CLI+skills
|
|
5
|
+
counterpart to the remote MCP server at `https://api.plori.ai/mcp`: same
|
|
6
|
+
account, same agents, same REST API underneath, and the commands mirror the
|
|
7
|
+
MCP tool names (create_agent → `create`, invoke_agent → `run`,
|
|
8
|
+
get_run_result → `result`, …).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Build from this repository (Go ≥ 1.25):
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
go build -o plori ./cli/cmd/plori
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Binary releases and an npm wrapper (`@plori/cli`) are published per
|
|
19
|
+
`docs/release-channels.md`.
|
|
20
|
+
|
|
21
|
+
## Authenticate
|
|
22
|
+
|
|
23
|
+
Create an API key at <https://plori.ai/settings>, then either:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
plori login # prompts for the key, validates it, stores it 0600
|
|
27
|
+
export PLORI_API_KEY=… # or: environment (CI, agents)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`PLORI_BASE_URL` (or `--base-url`) points the CLI at a non-production
|
|
31
|
+
control-plane, e.g. a local `uat-server`.
|
|
32
|
+
|
|
33
|
+
## Use
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
plori create mate # get-or-create an agent named "mate"
|
|
37
|
+
plori run mate "clone repo X and run the tests"
|
|
38
|
+
plori run mate "long job" --no-wait # returns a run id immediately
|
|
39
|
+
plori result mate <run-id> --wait # poll it later
|
|
40
|
+
plori run mate "build it" --follow # stream the turn live (tools on stderr)
|
|
41
|
+
echo "summarize this" | plori run mate - # message from stdin
|
|
42
|
+
plori schedule mate "daily report" --in 86400
|
|
43
|
+
plori inputs mate # runs paused on a human question
|
|
44
|
+
plori answer <run-id> <tool-call-id> --approve
|
|
45
|
+
plori credits && plori disk
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Agents are addressed by name or UUID. Every command accepts `--json`; when
|
|
49
|
+
stdout is not a TTY the output is JSON automatically, so scripts and agents
|
|
50
|
+
can parse without flags. Errors go to stderr; exit codes: 0 success, 1 API
|
|
51
|
+
failure, 2 usage error.
|
|
52
|
+
|
|
53
|
+
## For agent authors
|
|
54
|
+
|
|
55
|
+
The reply text of `plori run` is the only thing written to stdout (tool
|
|
56
|
+
narration streams to stderr), so a calling agent can pipe it directly. A run
|
|
57
|
+
that pauses on a human approval reports `status: "awaiting_input"`; surface
|
|
58
|
+
it and answer with `plori answer`. Prefer one long-lived agent (`create`
|
|
59
|
+
returns the existing agent for a reused name) over creating new ones.
|
|
60
|
+
|
|
61
|
+
Wire-level acceptance cases live in [UAT.md](UAT.md).
|
package/bin/plori.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npm shim for the plori CLI. The real program is a Go binary shipped in a
|
|
3
|
+
// platform-specific optionalDependency (the esbuild distribution pattern);
|
|
4
|
+
// this script only locates it and execs it with stdio inherited.
|
|
5
|
+
"use strict";
|
|
6
|
+
const { spawnSync } = require("node:child_process");
|
|
7
|
+
|
|
8
|
+
const PLATFORM_PACKAGES = {
|
|
9
|
+
"darwin-arm64": "@plori/cli-darwin-arm64",
|
|
10
|
+
"darwin-x64": "@plori/cli-darwin-x64",
|
|
11
|
+
"linux-x64": "@plori/cli-linux-x64",
|
|
12
|
+
"linux-arm64": "@plori/cli-linux-arm64",
|
|
13
|
+
"win32-x64": "@plori/cli-win32-x64",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function binPath() {
|
|
17
|
+
const key = `${process.platform}-${process.arch}`;
|
|
18
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
19
|
+
if (!pkg) {
|
|
20
|
+
console.error(`plori: unsupported platform ${key}; build from source with \`go build ./cli/cmd/plori\` (https://plori.ai)`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const exe = process.platform === "win32" ? "plori.exe" : "plori";
|
|
24
|
+
try {
|
|
25
|
+
return require.resolve(`${pkg}/bin/${exe}`);
|
|
26
|
+
} catch {
|
|
27
|
+
console.error(
|
|
28
|
+
`plori: the platform binary package ${pkg} is missing.\n` +
|
|
29
|
+
"It installs as an optionalDependency; reinstall without --no-optional / --omit=optional.",
|
|
30
|
+
);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const result = spawnSync(binPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
36
|
+
if (result.error) {
|
|
37
|
+
console.error(`plori: ${result.error.message}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plori/cli",
|
|
3
|
+
"description": "plori on the command line: give your AI agent its own cloud computer.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://plori.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/plori-ai/plori.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"plori",
|
|
13
|
+
"ai-agents",
|
|
14
|
+
"cloud-computer",
|
|
15
|
+
"agent-hosting",
|
|
16
|
+
"cli",
|
|
17
|
+
"mcp"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"plori": "bin/plori.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"@plori/cli-darwin-arm64": "0.1.0",
|
|
30
|
+
"@plori/cli-darwin-x64": "0.1.0",
|
|
31
|
+
"@plori/cli-linux-x64": "0.1.0",
|
|
32
|
+
"@plori/cli-linux-arm64": "0.1.0",
|
|
33
|
+
"@plori/cli-win32-x64": "0.1.0"
|
|
34
|
+
}
|
|
35
|
+
}
|