@deepraxis/cli 0.1.1-dev.9beb33a → 0.1.1-dev.a766ddd
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/COMMANDS.md +426 -437
- package/README.md +27 -24
- package/dist/praxis.js +441 -670
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,11 +19,11 @@ The official command line for [知行云 Praxis](https://deepraxis.com), the clo
|
|
|
19
19
|
```sh
|
|
20
20
|
npm install -g @deepraxis/cli
|
|
21
21
|
praxis login
|
|
22
|
-
praxis model chat completion create --model deepseek-flash \
|
|
22
|
+
praxis api model chat completion create --model deepseek-flash \
|
|
23
23
|
--data '{"messages":[{"role":"user","content":"Hello!"}]}'
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Every operation of the Praxis API is a command
|
|
26
|
+
Every operation of the Praxis API is a command under `praxis api`: about 350 of them across models, agents,
|
|
27
27
|
sandboxes, cloud browsers, web search, databases, knowledge bases, files, media, automation
|
|
28
28
|
and hosted applications. The command tree is generated from the same contract as the API and
|
|
29
29
|
the SDK, so a new API capability reaches the CLI on the day it ships.
|
|
@@ -36,7 +36,7 @@ the SDK, so a new API capability reaches the CLI on the day it ships.
|
|
|
36
36
|
AI coding agent runs it, and clean JSON in scripts. The CLI picks the mode by itself.
|
|
37
37
|
- **Signs in through the browser.** `praxis login` approves the session in your browser and
|
|
38
38
|
keeps the credential in the system keychain, never in a dotfile when a keychain exists.
|
|
39
|
-
- **Predictable grammar.** `praxis <domain> <resource> <verb> [id]`, the same shape everywhere,
|
|
39
|
+
- **Predictable grammar.** `praxis api <domain> <resource> <verb> [id]`, the same shape everywhere,
|
|
40
40
|
with `--help` on every level.
|
|
41
41
|
|
|
42
42
|
## Install
|
|
@@ -68,7 +68,7 @@ Belong to several organizations? Every call runs in the active one:
|
|
|
68
68
|
```sh
|
|
69
69
|
praxis org list
|
|
70
70
|
praxis org switch <organization_id>
|
|
71
|
-
praxis model list --org <organization_id> # just this call
|
|
71
|
+
praxis api model list --org <organization_id> # just this call
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
For CI and other headless environments, create an API key in the
|
|
@@ -84,12 +84,12 @@ export PRAXIS_API_KEY=<your-api-key>
|
|
|
84
84
|
### Models
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
praxis model list
|
|
88
|
-
praxis model chat completion create --model deepseek-flash \
|
|
87
|
+
praxis api model list
|
|
88
|
+
praxis api model chat completion create --model deepseek-flash \
|
|
89
89
|
--data '{"messages":[{"role":"user","content":"A haiku"}]}'
|
|
90
|
-
praxis model embedding create --model <embedding_model> \
|
|
90
|
+
praxis api model embedding create --model <embedding_model> \
|
|
91
91
|
--data '{"input":"hello world"}'
|
|
92
|
-
praxis model image generation create --model <image_model> \
|
|
92
|
+
praxis api model image generation create --model <image_model> \
|
|
93
93
|
--prompt "a lighthouse at dawn"
|
|
94
94
|
```
|
|
95
95
|
|
|
@@ -98,53 +98,56 @@ praxis model image generation create --model <image_model> \
|
|
|
98
98
|
Define an agent once, then talk to it in sessions:
|
|
99
99
|
|
|
100
100
|
```sh
|
|
101
|
-
praxis agent create --data '{
|
|
101
|
+
praxis api agent create --data '{
|
|
102
102
|
"name": "helper",
|
|
103
103
|
"model": {"id": "deepseek-flash"},
|
|
104
104
|
"tools": [{"type": "agent_toolset_20260401"}]
|
|
105
105
|
}'
|
|
106
|
-
praxis agent session create --data '{"agent": "<agent_id>"}'
|
|
107
|
-
praxis agent session event send <session_id> --data '{
|
|
106
|
+
praxis api agent session create --data '{"agent": "<agent_id>"}'
|
|
107
|
+
praxis api agent session event send <session_id> --data '{
|
|
108
108
|
"events": [{
|
|
109
109
|
"type": "user.message",
|
|
110
110
|
"content": [{"type": "text", "text": "What can you do?"}]
|
|
111
111
|
}]
|
|
112
112
|
}'
|
|
113
|
-
praxis agent session event stream --session <session_id>
|
|
113
|
+
praxis api agent session event stream --session <session_id>
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
### Sandboxes
|
|
117
117
|
|
|
118
118
|
```sh
|
|
119
|
-
praxis sandbox create --template-id base
|
|
120
|
-
praxis sandbox command run <sandbox_id> \
|
|
119
|
+
praxis api sandbox create --template-id base
|
|
120
|
+
praxis api sandbox command run <sandbox_id> \
|
|
121
121
|
--cmd "python3 -c 'print(6 * 7)'"
|
|
122
|
-
praxis sandbox delete <sandbox_id> --yes
|
|
122
|
+
praxis api sandbox delete <sandbox_id> --yes
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
### Search, data and automation
|
|
126
126
|
|
|
127
127
|
```sh
|
|
128
|
-
praxis search create --query "AI agent frameworks" --max-results 5
|
|
129
|
-
praxis database create --name notes
|
|
130
|
-
praxis automation run create --data '{
|
|
128
|
+
praxis api search create --query "AI agent frameworks" --max-results 5
|
|
129
|
+
praxis api database create --name notes
|
|
130
|
+
praxis api automation run create --data '{
|
|
131
131
|
"source": "export default async (i) => ({ answer: i.n + 1 })",
|
|
132
132
|
"language": "ts", "input": {"n": 41}, "wait": 30
|
|
133
133
|
}'
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
Browse everything with `praxis --help`, `praxis <domain> --help`, or the full
|
|
136
|
+
Browse everything with `praxis --help`, `praxis api --help`, `praxis api <domain> --help`, or the full
|
|
137
137
|
[command reference](https://unpkg.com/@deepraxis/cli/COMMANDS.md) that ships in the package.
|
|
138
138
|
|
|
139
139
|
## How commands work
|
|
140
140
|
|
|
141
|
+
There are two layers. Top-level commands are workflows and session commands (`login`, `logout`,
|
|
142
|
+
`whoami`, `org`, `skill`). Every API operation lives under `praxis api`, so the two never collide.
|
|
143
|
+
|
|
141
144
|
```text
|
|
142
|
-
praxis sandbox command run sbx_123 --cmd "ls" --json
|
|
143
|
-
|
|
145
|
+
praxis api sandbox command run sbx_123 --cmd "ls" --json
|
|
146
|
+
domain resource verb target options global
|
|
144
147
|
```
|
|
145
148
|
|
|
146
149
|
- **One target, positionally.** The object a command acts on comes right after the verb. Parent
|
|
147
|
-
objects are options: `praxis database table list --database <database_id>`.
|
|
150
|
+
objects are options: `praxis api database table list --database <database_id>`.
|
|
148
151
|
- **Request bodies.** Simple fields have their own options. Anything else goes in `--data`, as
|
|
149
152
|
inline JSON, a file (`--data @body.json`) or stdin (`--data -`). Field options win over the
|
|
150
153
|
same field in `--data`.
|
|
@@ -152,7 +155,7 @@ praxis sandbox command run sbx_123 --cmd "ls" --json
|
|
|
152
155
|
resumes from a page you saved.
|
|
153
156
|
- **Safety.** Deleting and other destructive commands ask for confirmation, or need `--yes`
|
|
154
157
|
when no one can answer, for example in a script.
|
|
155
|
-
- **Escape hatch.** `praxis api <METHOD> <path> [--data …]` calls any endpoint with your
|
|
158
|
+
- **Escape hatch.** `praxis api <METHOD> <path> [--data …]` (an uppercase method, such as `praxis api GET /model/v1/models`) calls any endpoint with your
|
|
156
159
|
current credential, including ones that are new since your installed version.
|
|
157
160
|
|
|
158
161
|
## Output for people, AI agents and scripts
|
|
@@ -167,7 +170,7 @@ Errors follow the same rule. In JSON they are one object on stderr with `code`,
|
|
|
167
170
|
`hint`, `status` and `request_id`, so a script or an agent can tell a typo from a quota limit.
|
|
168
171
|
|
|
169
172
|
```sh
|
|
170
|
-
praxis model list --json | jq -r '.data[].id'
|
|
173
|
+
praxis api model list --json | jq -r '.data[].id'
|
|
171
174
|
```
|
|
172
175
|
|
|
173
176
|
## Teach your AI agent to use Praxis
|