@deepraxis/cli 0.1.1-dev.f0ef747 → 0.2.0-dev.3c36146
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 +425 -423
- package/README.md +39 -24
- package/dist/praxis.js +732 -60
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,15 +19,27 @@ 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.
|
|
30
30
|
|
|
31
|
+
## Build and deploy an application
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
praxis app create my-app # standard template, dependencies installed
|
|
35
|
+
cd my-app && praxis app deploy # build, publish, create declared secrets, health check, print the URL
|
|
36
|
+
praxis app rollback # deploy the previous version again
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`praxis.jsonc` at the project root names the app and may declare `"secrets": {"SESSION_SECRET": "generate"}`
|
|
40
|
+
(created once, kept by every later deploy) and `"healthcheck": "/api/health"` (a failing check fails the deploy).
|
|
41
|
+
In computers and sandboxes the CLI signs in with `PRAXIS_API_TOKEN`; `PRAXIS_API_KEY` takes precedence when both are set.
|
|
42
|
+
|
|
31
43
|
## Why Praxis CLI
|
|
32
44
|
|
|
33
45
|
- **One account, every capability.** Chat with models from many providers, start a sandbox,
|
|
@@ -36,7 +48,7 @@ the SDK, so a new API capability reaches the CLI on the day it ships.
|
|
|
36
48
|
AI coding agent runs it, and clean JSON in scripts. The CLI picks the mode by itself.
|
|
37
49
|
- **Signs in through the browser.** `praxis login` approves the session in your browser and
|
|
38
50
|
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,
|
|
51
|
+
- **Predictable grammar.** `praxis api <domain> <resource> <verb> [id]`, the same shape everywhere,
|
|
40
52
|
with `--help` on every level.
|
|
41
53
|
|
|
42
54
|
## Install
|
|
@@ -68,7 +80,7 @@ Belong to several organizations? Every call runs in the active one:
|
|
|
68
80
|
```sh
|
|
69
81
|
praxis org list
|
|
70
82
|
praxis org switch <organization_id>
|
|
71
|
-
praxis model list --org <organization_id> # just this call
|
|
83
|
+
praxis api model list --org <organization_id> # just this call
|
|
72
84
|
```
|
|
73
85
|
|
|
74
86
|
For CI and other headless environments, create an API key in the
|
|
@@ -84,12 +96,12 @@ export PRAXIS_API_KEY=<your-api-key>
|
|
|
84
96
|
### Models
|
|
85
97
|
|
|
86
98
|
```sh
|
|
87
|
-
praxis model list
|
|
88
|
-
praxis model chat completion create --model deepseek-flash \
|
|
99
|
+
praxis api model list
|
|
100
|
+
praxis api model chat completion create --model deepseek-flash \
|
|
89
101
|
--data '{"messages":[{"role":"user","content":"A haiku"}]}'
|
|
90
|
-
praxis model embedding create --model <embedding_model> \
|
|
102
|
+
praxis api model embedding create --model <embedding_model> \
|
|
91
103
|
--data '{"input":"hello world"}'
|
|
92
|
-
praxis model image generation create --model <image_model> \
|
|
104
|
+
praxis api model image generation create --model <image_model> \
|
|
93
105
|
--prompt "a lighthouse at dawn"
|
|
94
106
|
```
|
|
95
107
|
|
|
@@ -98,53 +110,56 @@ praxis model image generation create --model <image_model> \
|
|
|
98
110
|
Define an agent once, then talk to it in sessions:
|
|
99
111
|
|
|
100
112
|
```sh
|
|
101
|
-
praxis agent create --data '{
|
|
113
|
+
praxis api agent create --data '{
|
|
102
114
|
"name": "helper",
|
|
103
115
|
"model": {"id": "deepseek-flash"},
|
|
104
116
|
"tools": [{"type": "agent_toolset_20260401"}]
|
|
105
117
|
}'
|
|
106
|
-
praxis agent session create --data '{"agent": "<agent_id>"}'
|
|
107
|
-
praxis agent session event send <session_id> --data '{
|
|
118
|
+
praxis api agent session create --data '{"agent": "<agent_id>"}'
|
|
119
|
+
praxis api agent session event send <session_id> --data '{
|
|
108
120
|
"events": [{
|
|
109
121
|
"type": "user.message",
|
|
110
122
|
"content": [{"type": "text", "text": "What can you do?"}]
|
|
111
123
|
}]
|
|
112
124
|
}'
|
|
113
|
-
praxis agent session event stream --session <session_id>
|
|
125
|
+
praxis api agent session event stream --session <session_id>
|
|
114
126
|
```
|
|
115
127
|
|
|
116
128
|
### Sandboxes
|
|
117
129
|
|
|
118
130
|
```sh
|
|
119
|
-
praxis sandbox create --template-id base
|
|
120
|
-
praxis sandbox command run <sandbox_id> \
|
|
131
|
+
praxis api sandbox create --template-id base
|
|
132
|
+
praxis api sandbox command run <sandbox_id> \
|
|
121
133
|
--cmd "python3 -c 'print(6 * 7)'"
|
|
122
|
-
praxis sandbox delete <sandbox_id> --yes
|
|
134
|
+
praxis api sandbox delete <sandbox_id> --yes
|
|
123
135
|
```
|
|
124
136
|
|
|
125
137
|
### Search, data and automation
|
|
126
138
|
|
|
127
139
|
```sh
|
|
128
|
-
praxis search create --query "AI agent frameworks" --max-results 5
|
|
129
|
-
praxis database create --name notes
|
|
130
|
-
praxis automation run create --data '{
|
|
140
|
+
praxis api search create --query "AI agent frameworks" --max-results 5
|
|
141
|
+
praxis api database create --name notes
|
|
142
|
+
praxis api automation run create --data '{
|
|
131
143
|
"source": "export default async (i) => ({ answer: i.n + 1 })",
|
|
132
144
|
"language": "ts", "input": {"n": 41}, "wait": 30
|
|
133
145
|
}'
|
|
134
146
|
```
|
|
135
147
|
|
|
136
|
-
Browse everything with `praxis --help`, `praxis <domain> --help`, or the full
|
|
148
|
+
Browse everything with `praxis --help`, `praxis api --help`, `praxis api <domain> --help`, or the full
|
|
137
149
|
[command reference](https://unpkg.com/@deepraxis/cli/COMMANDS.md) that ships in the package.
|
|
138
150
|
|
|
139
151
|
## How commands work
|
|
140
152
|
|
|
153
|
+
There are two layers. Top-level commands are workflows and session commands (`login`, `logout`,
|
|
154
|
+
`whoami`, `org`, `skill`). Every API operation lives under `praxis api`, so the two never collide.
|
|
155
|
+
|
|
141
156
|
```text
|
|
142
|
-
praxis sandbox command run sbx_123 --cmd "ls" --json
|
|
143
|
-
|
|
157
|
+
praxis api sandbox command run sbx_123 --cmd "ls" --json
|
|
158
|
+
domain resource verb target options global
|
|
144
159
|
```
|
|
145
160
|
|
|
146
161
|
- **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>`.
|
|
162
|
+
objects are options: `praxis api database table list --database <database_id>`.
|
|
148
163
|
- **Request bodies.** Simple fields have their own options. Anything else goes in `--data`, as
|
|
149
164
|
inline JSON, a file (`--data @body.json`) or stdin (`--data -`). Field options win over the
|
|
150
165
|
same field in `--data`.
|
|
@@ -152,7 +167,7 @@ praxis sandbox command run sbx_123 --cmd "ls" --json
|
|
|
152
167
|
resumes from a page you saved.
|
|
153
168
|
- **Safety.** Deleting and other destructive commands ask for confirmation, or need `--yes`
|
|
154
169
|
when no one can answer, for example in a script.
|
|
155
|
-
- **Escape hatch.** `praxis api <METHOD> <path> [--data …]` calls any endpoint with your
|
|
170
|
+
- **Escape hatch.** `praxis api <METHOD> <path> [--data …]` (an uppercase method, such as `praxis api GET /model/v1/models`) calls any endpoint with your
|
|
156
171
|
current credential, including ones that are new since your installed version.
|
|
157
172
|
|
|
158
173
|
## Output for people, AI agents and scripts
|
|
@@ -167,7 +182,7 @@ Errors follow the same rule. In JSON they are one object on stderr with `code`,
|
|
|
167
182
|
`hint`, `status` and `request_id`, so a script or an agent can tell a typo from a quota limit.
|
|
168
183
|
|
|
169
184
|
```sh
|
|
170
|
-
praxis model list --json | jq -r '.data[].id'
|
|
185
|
+
praxis api model list --json | jq -r '.data[].id'
|
|
171
186
|
```
|
|
172
187
|
|
|
173
188
|
## Teach your AI agent to use Praxis
|