@tarout/cli 0.2.0 → 0.2.2
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 +62 -18
- package/dist/api-735LN7BA.js +11 -0
- package/dist/billing-WOKNOS4N.js +11 -0
- package/dist/chunk-5XBVQICT.js +996 -0
- package/dist/chunk-7YS2WBLB.js +669 -0
- package/dist/chunk-CJMIX35A.js +127 -0
- package/dist/chunk-KL3JNPAY.js +203 -0
- package/dist/index.js +17849 -3317
- package/dist/{prompts-B53LIJLG.js → prompts-QQ2FZKQT.js} +4 -1
- package/package.json +3 -3
- package/dist/chunk-GSKD67K4.js +0 -41
- package/dist/chunk-VO4OYJW3.js +0 -53
- package/dist/spinner-2NALE2OE.js +0 -14
package/README.md
CHANGED
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tarout/cli)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
The official command-line interface for [Tarout](https://tarout.sa)
|
|
6
|
+
The official command-line interface for [Tarout](https://tarout.sa) — the Saudi cloud platform built for coding agents. Your agent writes code and defines infrastructure; Tarout provisions it instantly.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
curl -fsSL https://tarout.sa/install.sh | sh
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Or with other package managers:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
+
# Using npm
|
|
18
|
+
npm install -g @tarout/cli
|
|
19
|
+
|
|
17
20
|
# Using yarn
|
|
18
21
|
yarn global add @tarout/cli
|
|
19
22
|
|
|
@@ -30,14 +33,10 @@ bun add -g @tarout/cli
|
|
|
30
33
|
# 1. Login via browser (opens authentication page)
|
|
31
34
|
tarout login
|
|
32
35
|
|
|
33
|
-
# 2.
|
|
34
|
-
tarout
|
|
36
|
+
# 2. Inspect and deploy from your project root
|
|
37
|
+
tarout deploy --wait --source upload
|
|
35
38
|
|
|
36
|
-
#
|
|
37
|
-
tarout deploy my-app
|
|
38
|
-
|
|
39
|
-
# 4. View logs
|
|
40
|
-
tarout logs my-app --follow
|
|
39
|
+
# The first deploy prompts to create or link an app, and to create detected resources.
|
|
41
40
|
```
|
|
42
41
|
|
|
43
42
|
## Commands
|
|
@@ -51,8 +50,8 @@ tarout logs my-app --follow
|
|
|
51
50
|
| `tarout whoami` | Show current user, organization, and environment |
|
|
52
51
|
|
|
53
52
|
```bash
|
|
54
|
-
# Login with custom API URL (
|
|
55
|
-
tarout login --api-url https://
|
|
53
|
+
# Login with a custom API URL (e.g. staging)
|
|
54
|
+
tarout login --api-url https://staging.tarout.sa
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
### Applications
|
|
@@ -80,14 +79,14 @@ tarout apps delete my-api --yes
|
|
|
80
79
|
|
|
81
80
|
| Command | Description |
|
|
82
81
|
|---------|-------------|
|
|
83
|
-
| `tarout deploy
|
|
82
|
+
| `tarout deploy [app]` | Deploy an application |
|
|
84
83
|
| `tarout deploy:status <app>` | Check deployment status |
|
|
85
84
|
| `tarout deploy:cancel <app>` | Cancel running deployment |
|
|
86
85
|
| `tarout deploy:list <app>` | List recent deployments |
|
|
87
86
|
|
|
88
87
|
```bash
|
|
89
|
-
#
|
|
90
|
-
tarout deploy
|
|
88
|
+
# Inspect and deploy the current folder
|
|
89
|
+
tarout deploy --wait --source upload
|
|
91
90
|
|
|
92
91
|
# Deploy and wait for completion
|
|
93
92
|
tarout deploy my-app --wait
|
|
@@ -96,6 +95,8 @@ tarout deploy my-app --wait
|
|
|
96
95
|
tarout deploy:status my-app
|
|
97
96
|
```
|
|
98
97
|
|
|
98
|
+
`tarout deploy` inspects the current folder for database, file storage, and Git signals before it asks questions. If Git exists, local upload remains available, so users without GitHub can still deploy. If the user chooses GitHub, run `tarout providers github connect` to open Tarout's Git provider setup page, then connect the repository to the app and deploy with `--source configured`.
|
|
99
|
+
|
|
99
100
|
### Logs
|
|
100
101
|
|
|
101
102
|
| Command | Description |
|
|
@@ -157,9 +158,6 @@ tarout db create mydb --type postgres
|
|
|
157
158
|
# Create MySQL database
|
|
158
159
|
tarout db create mydb --type mysql
|
|
159
160
|
|
|
160
|
-
# Create Redis instance
|
|
161
|
-
tarout db create cache --type redis
|
|
162
|
-
|
|
163
161
|
# Get connection string
|
|
164
162
|
tarout db info mydb
|
|
165
163
|
|
|
@@ -241,6 +239,7 @@ APP_ID=$(tarout apps list --json | jq -r '.[0].id')
|
|
|
241
239
|
| 3 | Authentication error (not logged in) |
|
|
242
240
|
| 4 | Resource not found |
|
|
243
241
|
| 5 | Permission denied |
|
|
242
|
+
| 6 | Needs input — see `needs_input` event below |
|
|
244
243
|
|
|
245
244
|
### JSON Output Format
|
|
246
245
|
|
|
@@ -257,6 +256,51 @@ All `--json` output follows a consistent structure:
|
|
|
257
256
|
{ "success": true, "data": [...], "meta": { "total": 10 } }
|
|
258
257
|
```
|
|
259
258
|
|
|
259
|
+
### Agent Input Relay (`needs_input`)
|
|
260
|
+
|
|
261
|
+
When `tarout up --json` hits a choice point and the value wasn't passed as a
|
|
262
|
+
flag, it emits a single `needs_input` line on stdout and exits with code `6`
|
|
263
|
+
instead of crashing or silently defaulting. The external agent reads that
|
|
264
|
+
event, asks the human user in its chat UI, then re-invokes `tarout up` with
|
|
265
|
+
the same arguments plus the new flag.
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"type": "needs_input",
|
|
270
|
+
"field": "name",
|
|
271
|
+
"kind": "input",
|
|
272
|
+
"question": "Application name:",
|
|
273
|
+
"default": "my-project",
|
|
274
|
+
"flag": "--name",
|
|
275
|
+
"sensitive": false,
|
|
276
|
+
"context": { "step": "app_name", "defaultName": "my-project" }
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Fields:
|
|
281
|
+
- `field` — stable id (e.g. `name`, `region`, `token`, `source`).
|
|
282
|
+
- `kind` — `"input" | "select" | "confirm" | "password"`.
|
|
283
|
+
- `question` — show verbatim to the user.
|
|
284
|
+
- `choices` — present when `kind: "select"`.
|
|
285
|
+
- `default` — pre-fill suggestion.
|
|
286
|
+
- `flag` — the CLI flag to pass on the next invocation.
|
|
287
|
+
- `sensitive` — `true` for tokens / passwords (mask in UI, omit from logs).
|
|
288
|
+
- `context` — free-form metadata the agent can use to phrase a richer prompt.
|
|
289
|
+
|
|
290
|
+
Loop pattern for an agent:
|
|
291
|
+
|
|
292
|
+
```text
|
|
293
|
+
1. invoke `tarout up --json [flags]`
|
|
294
|
+
2. read stdout line-by-line
|
|
295
|
+
3. if line.type === "needs_input":
|
|
296
|
+
- ask the user for `question`
|
|
297
|
+
- re-invoke with the same flags + `${flag} ${answer}`
|
|
298
|
+
4. otherwise treat the final JSON envelope as success / error
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Flags currently supported by `tarout up` for skipping the relay:
|
|
302
|
+
`--token`, `--name`, `--plan`, `--source`, `--repo`, `--branch`, `--region`, `--yes`.
|
|
303
|
+
|
|
260
304
|
## Configuration
|
|
261
305
|
|
|
262
306
|
Configuration is stored at `~/.tarout/config.json`:
|
|
@@ -286,7 +330,7 @@ Configuration is stored at `~/.tarout/config.json`:
|
|
|
286
330
|
|
|
287
331
|
## Support
|
|
288
332
|
|
|
289
|
-
- Documentation: [
|
|
333
|
+
- Documentation: [tarout.sa/docs](https://tarout.sa/docs)
|
|
290
334
|
- Issues: [GitHub Issues](https://github.com/tarout/platform/issues)
|
|
291
335
|
- Discord: [Join our community](https://discord.gg/2tBnJ3jDJc)
|
|
292
336
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pollCheckoutUntilTerminal,
|
|
3
|
+
registerBillingCommands
|
|
4
|
+
} from "./chunk-5XBVQICT.js";
|
|
5
|
+
import "./chunk-7YS2WBLB.js";
|
|
6
|
+
import "./chunk-CJMIX35A.js";
|
|
7
|
+
import "./chunk-KL3JNPAY.js";
|
|
8
|
+
export {
|
|
9
|
+
pollCheckoutUntilTerminal,
|
|
10
|
+
registerBillingCommands
|
|
11
|
+
};
|