@relyio/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 +6 -586
- package/dist/index.js +47 -58
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,589 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @relyio/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**RelyIO is coming soon.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package is on npm so its name is reserved and the release pipeline stays exercised end to
|
|
6
|
+
end. It is not ready for general use yet, and its documentation is deliberately not published
|
|
7
|
+
here.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
# Install globally
|
|
9
|
-
npm install -g @relyio/cli
|
|
10
|
-
|
|
11
|
-
# Or use with npx
|
|
12
|
-
npx @relyio/cli
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Quick Start
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Initialize a new project
|
|
19
|
-
relyio init
|
|
20
|
-
|
|
21
|
-
# Log in to your account
|
|
22
|
-
relyio login
|
|
23
|
-
|
|
24
|
-
# Link to an existing project
|
|
25
|
-
relyio link --project_id <id>
|
|
26
|
-
|
|
27
|
-
# Check schema status
|
|
28
|
-
relyio status
|
|
29
|
-
|
|
30
|
-
# Deploy schemas
|
|
31
|
-
relyio deploy
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Schema Definition
|
|
35
|
-
|
|
36
|
-
RelyIO supports two ways to define your content schemas:
|
|
37
|
-
|
|
38
|
-
### TypeScript Schemas (Recommended)
|
|
39
|
-
|
|
40
|
-
Define your schemas with full type safety using the RelyIO SDK:
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
// relyio/schema.ts
|
|
44
|
-
import { defineSchema, defineContentType, fields } from '@relyio/sdk/schema'
|
|
45
|
-
|
|
46
|
-
const blogPost = defineContentType('blogPost', {
|
|
47
|
-
displayName: 'Blog Post',
|
|
48
|
-
fields: [
|
|
49
|
-
fields.shortText('title', { config: { required: true } }),
|
|
50
|
-
fields.richText('content'),
|
|
51
|
-
fields.media('featuredImage'),
|
|
52
|
-
],
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
export const schema = defineSchema({
|
|
56
|
-
contentTypes: { blogPost },
|
|
57
|
-
})
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### YAML Schemas
|
|
61
|
-
|
|
62
|
-
Define schemas in YAML format for GitOps workflows:
|
|
63
|
-
|
|
64
|
-
```yaml
|
|
65
|
-
# relyio/contentTypes/blogPost.yaml
|
|
66
|
-
name: blogPost
|
|
67
|
-
displayName: Blog Post
|
|
68
|
-
fields:
|
|
69
|
-
- name: title
|
|
70
|
-
type: shortText
|
|
71
|
-
config:
|
|
72
|
-
required: true
|
|
73
|
-
- name: content
|
|
74
|
-
type: richText
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The CLI automatically detects which format you're using—no configuration required.
|
|
78
|
-
|
|
79
|
-
## Commands
|
|
80
|
-
|
|
81
|
-
### Authentication
|
|
82
|
-
|
|
83
|
-
| Command | Description |
|
|
84
|
-
| -------- | ------------------------------ |
|
|
85
|
-
| `login` | Log in to your RelyIO account |
|
|
86
|
-
| `logout` | Log out of your RelyIO account |
|
|
87
|
-
| `whoami` | Show current user info |
|
|
88
|
-
|
|
89
|
-
### Project Management
|
|
90
|
-
|
|
91
|
-
| Command | Description |
|
|
92
|
-
| ---------------- | ---------------------------------------- |
|
|
93
|
-
| `init` | Initialize a new RelyIO project |
|
|
94
|
-
| `link` | Link to an existing RelyIO project |
|
|
95
|
-
| `status` | Check local schema status against remote |
|
|
96
|
-
| `validate` | Validate schemas locally |
|
|
97
|
-
| `deploy` | Deploy schemas to a branch environment |
|
|
98
|
-
| `diff` | Show detailed schema differences |
|
|
99
|
-
| `generate-types` | Generate TypeScript/Python types |
|
|
100
|
-
|
|
101
|
-
### Branch Environments
|
|
102
|
-
|
|
103
|
-
| Command | Description |
|
|
104
|
-
| --------------- | --------------------------- |
|
|
105
|
-
| `branch list` | List branch environments |
|
|
106
|
-
| `branch create` | Create a branch environment |
|
|
107
|
-
| `branch delete` | Delete a branch environment |
|
|
108
|
-
|
|
109
|
-
### AI
|
|
110
|
-
|
|
111
|
-
| Command | Description |
|
|
112
|
-
| -------- | -------------------------------------------------------------- |
|
|
113
|
-
| `ai` | Start an interactive AI REPL session in the current project |
|
|
114
|
-
| `schema` | One-shot schema edits with the schema-architect agent |
|
|
115
|
-
| `draft` | One-shot content drafting with the content-editor agent |
|
|
116
|
-
| `query` | Ask a natural-language question about your content (read-only) |
|
|
117
|
-
|
|
118
|
-
### Utilities
|
|
119
|
-
|
|
120
|
-
| Command | Description |
|
|
121
|
-
| ------------ | ------------------------------------ |
|
|
122
|
-
| `doctor` | Diagnose common configuration issues |
|
|
123
|
-
| `open` | Open RelyIO URLs in your browser |
|
|
124
|
-
| `alias` | Manage command shortcuts |
|
|
125
|
-
| `completion` | Generate shell completion scripts |
|
|
126
|
-
| `version` | Show CLI version |
|
|
127
|
-
|
|
128
|
-
## Command Reference
|
|
129
|
-
|
|
130
|
-
### `relyio status`
|
|
131
|
-
|
|
132
|
-
Check your local schema status with enhanced validation insights.
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Check status once
|
|
136
|
-
relyio status
|
|
137
|
-
|
|
138
|
-
# Check status for a specific branch
|
|
139
|
-
relyio status -b my-branch
|
|
140
|
-
|
|
141
|
-
# Watch mode - automatically update when schema files change
|
|
142
|
-
relyio status --watch
|
|
143
|
-
|
|
144
|
-
# Output as JSON (for CI/CD)
|
|
145
|
-
relyio status --json
|
|
146
|
-
|
|
147
|
-
# Verbose output with detailed validation
|
|
148
|
-
relyio status --verbose
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**Options:**
|
|
152
|
-
|
|
153
|
-
- `-b, --branch <branch>` - Target branch (defaults to current Git branch)
|
|
154
|
-
- `-w, --watch` - Watch for schema file changes
|
|
155
|
-
- `--json` - Output as JSON for CI/CD integration
|
|
156
|
-
- `-v, --verbose` - Show detailed validation insights
|
|
157
|
-
|
|
158
|
-
### `relyio deploy`
|
|
159
|
-
|
|
160
|
-
Deploy your schema to a branch environment.
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# Deploy to current branch
|
|
164
|
-
relyio deploy
|
|
165
|
-
|
|
166
|
-
# Deploy to a specific branch
|
|
167
|
-
relyio deploy -b development
|
|
168
|
-
|
|
169
|
-
# Skip confirmation prompt
|
|
170
|
-
relyio deploy --yes
|
|
171
|
-
|
|
172
|
-
# Output as JSON (for CI/CD)
|
|
173
|
-
relyio deploy --json
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
**Options:**
|
|
177
|
-
|
|
178
|
-
- `-b, --branch <branch>` - Target branch (defaults to current Git branch)
|
|
179
|
-
- `-y, --yes` - Skip confirmation prompt
|
|
180
|
-
- `--skip-notes` - Skip deployment notes prompt
|
|
181
|
-
- `--json` - Output result as JSON
|
|
182
|
-
|
|
183
|
-
### `relyio diff`
|
|
184
|
-
|
|
185
|
-
Show detailed differences between local and remote schemas.
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# Show diff for current branch
|
|
189
|
-
relyio diff
|
|
190
|
-
|
|
191
|
-
# Show diff for a specific branch
|
|
192
|
-
relyio diff -b production
|
|
193
|
-
|
|
194
|
-
# Output as JSON
|
|
195
|
-
relyio diff --json
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
**Options:**
|
|
199
|
-
|
|
200
|
-
- `-b, --branch <branch>` - Target branch (defaults to current Git branch)
|
|
201
|
-
- `--json` - Output diff as JSON
|
|
202
|
-
|
|
203
|
-
### `relyio validate`
|
|
204
|
-
|
|
205
|
-
Validate your local schema without connecting to the API.
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
# Validate schema
|
|
209
|
-
relyio validate
|
|
210
|
-
|
|
211
|
-
# Output as JSON
|
|
212
|
-
relyio validate --json
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
**Options:**
|
|
216
|
-
|
|
217
|
-
- `--json` - Output validation result as JSON
|
|
218
|
-
|
|
219
|
-
### `relyio generate-types`
|
|
220
|
-
|
|
221
|
-
Generate typed code from your schema.
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
# Generate TypeScript types
|
|
225
|
-
relyio generate-types
|
|
226
|
-
|
|
227
|
-
# Generate for a specific language
|
|
228
|
-
relyio generate-types -l python
|
|
229
|
-
|
|
230
|
-
# Generate multiple languages
|
|
231
|
-
relyio generate-types --languages typescript,python
|
|
232
|
-
|
|
233
|
-
# Custom output directory
|
|
234
|
-
relyio generate-types -o ./src/types
|
|
235
|
-
|
|
236
|
-
# Watch mode
|
|
237
|
-
relyio generate-types --watch
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Options:**
|
|
241
|
-
|
|
242
|
-
- `-l, --language <language>` - Target language (default: typescript)
|
|
243
|
-
- `--languages <list>` - Comma-separated list of languages
|
|
244
|
-
- `-o, --output <dir>` - Output directory (default: ./types)
|
|
245
|
-
- `-c, --config <path>` - Path to codegen configuration file
|
|
246
|
-
- `-b, --branch <branch>` - Generate types from a specific branch schema
|
|
247
|
-
- `--naming-convention <style>` - Naming style (camelCase, PascalCase, snake_case)
|
|
248
|
-
- `--include-api-types` - Generate API response wrapper types
|
|
249
|
-
- `--include-helpers` - Generate utility functions
|
|
250
|
-
- `--module-format <format>` - Module format (esm, commonjs, both)
|
|
251
|
-
- `-w, --watch` - Watch for schema changes
|
|
252
|
-
|
|
253
|
-
### `relyio ai`
|
|
254
|
-
|
|
255
|
-
Open an interactive AI REPL where you can chat with RelyIO agents about
|
|
256
|
-
your project. The REPL loads the active branch's schema, lets the agent
|
|
257
|
-
read/write files in the project (gated by your permission mode), and
|
|
258
|
-
supports slash commands like `/agent`, `/deploy`, `/undo`,
|
|
259
|
-
`/diff-history`.
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
# Start a fresh session in the current project
|
|
263
|
-
relyio ai
|
|
264
|
-
|
|
265
|
-
# Pick the permission mode up front
|
|
266
|
-
relyio ai --mode safe # ask before every file mutation (default)
|
|
267
|
-
relyio ai --mode trust # remember per-tool decisions for the session
|
|
268
|
-
relyio ai --mode plan # read-only, no mutations
|
|
269
|
-
relyio ai --mode auto # run unattended (CI-friendly)
|
|
270
|
-
|
|
271
|
-
# Start with a specific agent
|
|
272
|
-
relyio ai --agent schema-architect
|
|
273
|
-
|
|
274
|
-
# Resume the most recent session
|
|
275
|
-
relyio ai --resume
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
**Options:**
|
|
279
|
-
|
|
280
|
-
- `-m, --mode <mode>` — permission mode (`safe`, `trust`, `plan`, `auto`)
|
|
281
|
-
- `-a, --agent <slug>` — start with a specific agent (e.g. `schema-architect`, `content-editor`)
|
|
282
|
-
- `--resume` — resume the most recent local session
|
|
283
|
-
|
|
284
|
-
### `relyio schema "<instruction>"`
|
|
285
|
-
|
|
286
|
-
One-shot schema edits via the `schema-architect` agent. The agent reads
|
|
287
|
-
the local schema, proposes edits as a unified diff, and (with
|
|
288
|
-
confirmation) writes them back to disk.
|
|
289
|
-
|
|
290
|
-
```bash
|
|
291
|
-
# Add a field interactively
|
|
292
|
-
relyio schema "add a video field to blogPost"
|
|
293
|
-
|
|
294
|
-
# Target a non-default branch
|
|
295
|
-
relyio schema "rename the hero component to banner" --branch staging
|
|
296
|
-
|
|
297
|
-
# Apply changes without prompts (CI)
|
|
298
|
-
relyio schema "add SEO fields" --no-confirm
|
|
299
|
-
|
|
300
|
-
# Apply *and* deploy on success
|
|
301
|
-
relyio schema "add a tags field to blogPost" --deploy
|
|
302
|
-
|
|
303
|
-
# Plan-only mode — agent describes changes without writing anything
|
|
304
|
-
relyio schema "review my schema for missing required fields" --dry-run
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**Options:**
|
|
308
|
-
|
|
309
|
-
- `-b, --branch <name>` — override branch detection
|
|
310
|
-
- `--no-confirm` — auto-apply file changes without prompting
|
|
311
|
-
- `--dry-run` — plan-only mode (no writes, no deploy)
|
|
312
|
-
- `--deploy` — deploy the resolved branch on success
|
|
313
|
-
|
|
314
|
-
### `relyio draft "<instruction>"`
|
|
315
|
-
|
|
316
|
-
One-shot content drafting via the `content-editor` agent. The agent
|
|
317
|
-
creates entries against the active dataset using the deployed schema.
|
|
318
|
-
Drafts go through the same proposal flow as the AI REPL, so you can
|
|
319
|
-
review every entry before applying.
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
# Draft 5 blog posts
|
|
323
|
-
relyio draft "create 5 blog posts about AI development workflows"
|
|
324
|
-
|
|
325
|
-
# Draft against a specific dataset / branch
|
|
326
|
-
relyio draft "add 3 product reviews for the laptop SKU" --dataset prod
|
|
327
|
-
|
|
328
|
-
# Auto-commit the drafts (CI / scripted bulk ops)
|
|
329
|
-
relyio draft "translate every blog post to Spanish" --auto-commit
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
**Options:**
|
|
333
|
-
|
|
334
|
-
- `-d, --dataset <name>` — dataset to draft into
|
|
335
|
-
- `-b, --branch <name>` — override branch detection
|
|
336
|
-
- `--no-confirm` — auto-approve incidental confirmations
|
|
337
|
-
- `--auto-commit` — apply every drafted proposal without prompting
|
|
338
|
-
|
|
339
|
-
> Note: drafting requires the local schema to be in sync with the
|
|
340
|
-
> remote branch. If you have uncommitted schema changes, `relyio
|
|
341
|
-
draft` blocks with a `schema-dirty` error and asks you to run
|
|
342
|
-
> `/deploy` (in the REPL) or `relyio deploy` first.
|
|
343
|
-
|
|
344
|
-
### `relyio query "<question>"`
|
|
345
|
-
|
|
346
|
-
Ask a natural-language question about your content. Read-only — never
|
|
347
|
-
mutates anything. Results render as a table by default, or as JSON / CSV
|
|
348
|
-
/ count for piping into other tools.
|
|
349
|
-
|
|
350
|
-
```bash
|
|
351
|
-
# Default table view
|
|
352
|
-
relyio query "all published blog posts by John, sorted by date"
|
|
353
|
-
|
|
354
|
-
# Filter / sort / limit, table-rendered
|
|
355
|
-
relyio query "products under \$50 with low stock" --format table
|
|
356
|
-
|
|
357
|
-
# Just the count
|
|
358
|
-
relyio query "how many draft entries exist" --format count
|
|
359
|
-
|
|
360
|
-
# JSON for piping to jq
|
|
361
|
-
relyio query "entries modified this week" --format json --limit 100
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
**Options:**
|
|
365
|
-
|
|
366
|
-
- `-f, --format <fmt>` — `table` (default), `json`, `csv`, or `count`
|
|
367
|
-
- `-d, --dataset <name>` — dataset to query (skips the picker)
|
|
368
|
-
- `-b, --branch <name>` — override branch detection
|
|
369
|
-
- `-l, --limit <n>` — max results (default 25, capped at 50)
|
|
370
|
-
- `--no-confirm` — auto-approve any incidental confirmations
|
|
371
|
-
|
|
372
|
-
The result table always includes the `entryUid` column so you can copy
|
|
373
|
-
canonical IDs straight into follow-up commands.
|
|
374
|
-
|
|
375
|
-
### `relyio doctor`
|
|
376
|
-
|
|
377
|
-
Diagnose common configuration and connectivity issues.
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
relyio doctor
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
Checks:
|
|
384
|
-
|
|
385
|
-
- Node.js version
|
|
386
|
-
- Git installation
|
|
387
|
-
- Authentication status
|
|
388
|
-
- API connectivity
|
|
389
|
-
- Project configuration
|
|
390
|
-
- Schema files
|
|
391
|
-
|
|
392
|
-
### `relyio open`
|
|
393
|
-
|
|
394
|
-
Open RelyIO URLs in your default browser.
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
# Open dashboard
|
|
398
|
-
relyio open dashboard
|
|
399
|
-
|
|
400
|
-
# Open current project
|
|
401
|
-
relyio open project
|
|
402
|
-
|
|
403
|
-
# Open current branch
|
|
404
|
-
relyio open branch
|
|
405
|
-
|
|
406
|
-
# Open documentation
|
|
407
|
-
relyio open docs
|
|
408
|
-
|
|
409
|
-
# Open API docs
|
|
410
|
-
relyio open api
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
### `relyio alias`
|
|
414
|
-
|
|
415
|
-
Create shortcuts for frequently used commands.
|
|
416
|
-
|
|
417
|
-
```bash
|
|
418
|
-
# List all aliases
|
|
419
|
-
relyio alias
|
|
420
|
-
|
|
421
|
-
# Create an alias
|
|
422
|
-
relyio alias set d deploy
|
|
423
|
-
relyio alias set sw "status --watch"
|
|
424
|
-
|
|
425
|
-
# Remove an alias
|
|
426
|
-
relyio alias remove d
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
### `relyio completion`
|
|
430
|
-
|
|
431
|
-
Generate shell completion scripts for tab completion.
|
|
432
|
-
|
|
433
|
-
```bash
|
|
434
|
-
# Generate for your current shell
|
|
435
|
-
relyio completion
|
|
436
|
-
|
|
437
|
-
# Generate for a specific shell
|
|
438
|
-
relyio completion --shell zsh
|
|
439
|
-
|
|
440
|
-
# Install (add to your shell config)
|
|
441
|
-
# For bash:
|
|
442
|
-
eval "$(relyio completion --shell bash)"
|
|
443
|
-
|
|
444
|
-
# For zsh:
|
|
445
|
-
eval "$(relyio completion --shell zsh)"
|
|
446
|
-
|
|
447
|
-
# For fish:
|
|
448
|
-
relyio completion --shell fish | source
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
## Configuration
|
|
452
|
-
|
|
453
|
-
The CLI uses a three-tier configuration system:
|
|
454
|
-
|
|
455
|
-
1. **Global User Configuration** - `~/.relyio/config.json`
|
|
456
|
-
|
|
457
|
-
- Stores non-secret state (project link, PAT metadata)
|
|
458
|
-
- Auth tokens themselves are kept in the OS keychain whenever
|
|
459
|
-
possible — see [Secret storage](#secret-storage) below
|
|
460
|
-
|
|
461
|
-
2. **Project Link Configuration** - `.relyio-context.json`
|
|
462
|
-
|
|
463
|
-
- Stores project ID and organization ID
|
|
464
|
-
- Created when you run `relyio link` or `relyio init`
|
|
465
|
-
|
|
466
|
-
3. **Local Project Configuration** - `relyio/config.yaml`
|
|
467
|
-
- Stores project-specific settings
|
|
468
|
-
- Created when you run `relyio init`
|
|
469
|
-
|
|
470
|
-
## CI/CD Integration
|
|
471
|
-
|
|
472
|
-
All major commands support `--json` output for easy integration with CI/CD pipelines:
|
|
473
|
-
|
|
474
|
-
```bash
|
|
475
|
-
# Check status in CI
|
|
476
|
-
STATUS=$(relyio status --json)
|
|
477
|
-
if echo "$STATUS" | jq -e '.hasChanges' > /dev/null; then
|
|
478
|
-
echo "Schema changes detected"
|
|
479
|
-
relyio deploy --yes --json
|
|
480
|
-
fi
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
### Exit Codes
|
|
484
|
-
|
|
485
|
-
The one-shot AI commands (`relyio schema`, `relyio draft`, `relyio
|
|
486
|
-
query`) follow a stable exit-code contract so shell pipelines and CI
|
|
487
|
-
jobs can branch reliably without parsing stdout:
|
|
488
|
-
|
|
489
|
-
| Code | Meaning |
|
|
490
|
-
| ----- | ------------------------------------------------------------------------------------------------------------------- |
|
|
491
|
-
| `0` | Success — agent finished and the user resolved everything that needed resolving. |
|
|
492
|
-
| `1` | Unrecoverable error — auth missing, project not linked, network failure, agent crashed. |
|
|
493
|
-
| `2` | Cannot proceed — schema is dirty (run `relyio deploy`), validation failed, or `--auto-commit` had nothing to apply. |
|
|
494
|
-
| `130` | User pressed `Ctrl-C` (POSIX `128 + SIGINT`). |
|
|
495
|
-
|
|
496
|
-
Other commands follow the standard `0 = ok`, `1 = error` convention.
|
|
497
|
-
|
|
498
|
-
```bash
|
|
499
|
-
# Example: deploy schema only if drafting succeeds
|
|
500
|
-
relyio schema "add a tags field" --no-confirm
|
|
501
|
-
case $? in
|
|
502
|
-
0) relyio deploy --yes ;;
|
|
503
|
-
2) echo "schema is dirty — please run 'relyio deploy' first" >&2; exit 1 ;;
|
|
504
|
-
*) echo "drafting failed" >&2; exit 1 ;;
|
|
505
|
-
esac
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
## Configuration Details
|
|
509
|
-
|
|
510
|
-
### Secret storage
|
|
511
|
-
|
|
512
|
-
The CLI persists auth tokens (login PAT, API keys) in your operating
|
|
513
|
-
system's secure credential store via [`keytar`][keytar] when available
|
|
514
|
-
— Keychain on macOS, Credential Vault on Windows, libsecret on Linux.
|
|
515
|
-
|
|
516
|
-
If the native module fails to load (commonly on headless Linux without
|
|
517
|
-
`libsecret-1-dev`, or in Docker images without build prerequisites),
|
|
518
|
-
the CLI prints a one-time stderr warning and falls back to plaintext
|
|
519
|
-
storage in `~/.relyio/config.json`. Run `relyio doctor` to see which
|
|
520
|
-
backend is currently active.
|
|
521
|
-
|
|
522
|
-
[keytar]: https://github.com/atom/node-keytar
|
|
523
|
-
|
|
524
|
-
### Override URLs
|
|
525
|
-
|
|
526
|
-
| Variable | Default | Purpose |
|
|
527
|
-
| -------------------------- | ------------------------------ | --------------------------------------- |
|
|
528
|
-
| `RELYIO_API_URL` | `https://api.relyio.com` | Manage API base URL |
|
|
529
|
-
| `RELYIO_AI_GATEWAY_URL` | `https://ai.relyio.com` | AI gateway streaming endpoint |
|
|
530
|
-
| `RELYIO_DASHBOARD_URL` | `https://dashboard.relyio.com` | Dashboard URL used by `relyio open` |
|
|
531
|
-
| `RELYIO_BRANCH` | _(detected from git)_ | Force branch detection (CI containers) |
|
|
532
|
-
| `RELYIO_CLI_TEMPLATES_DIR` | _(bundled with CLI)_ | Override the `init` templates location |
|
|
533
|
-
| `DEBUG` | _(off)_ | Set to `true` to enable verbose logging |
|
|
534
|
-
|
|
535
|
-
## Development
|
|
536
|
-
|
|
537
|
-
### Setup
|
|
538
|
-
|
|
539
|
-
```bash
|
|
540
|
-
# Clone the repository
|
|
541
|
-
git clone https://github.com/relyio/relyio.git
|
|
542
|
-
cd relyio
|
|
543
|
-
|
|
544
|
-
# Install dependencies
|
|
545
|
-
pnpm install
|
|
546
|
-
|
|
547
|
-
# Build the CLI
|
|
548
|
-
pnpm --filter @relyio/cli build
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
### Local Testing
|
|
552
|
-
|
|
553
|
-
```bash
|
|
554
|
-
# Link the CLI globally
|
|
555
|
-
cd packages/customer/cli
|
|
556
|
-
pnpm local-test
|
|
557
|
-
|
|
558
|
-
# Now you can use the CLI from anywhere
|
|
559
|
-
relyio --help
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
### Running Tests
|
|
563
|
-
|
|
564
|
-
```bash
|
|
565
|
-
# Run tests
|
|
566
|
-
pnpm --filter @relyio/cli test
|
|
567
|
-
|
|
568
|
-
# Run tests in watch mode
|
|
569
|
-
pnpm --filter @relyio/cli test:watch
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
## Publishing
|
|
573
|
-
|
|
574
|
-
This package is published as `@relyio/cli` on npm. To publish a new version:
|
|
575
|
-
|
|
576
|
-
```bash
|
|
577
|
-
# Create a new changeset
|
|
578
|
-
pnpm changeset
|
|
579
|
-
|
|
580
|
-
# Build before publish
|
|
581
|
-
pnpm --filter @relyio/cli build
|
|
582
|
-
|
|
583
|
-
# Publishing (handled by CI)
|
|
584
|
-
pnpm publish -r
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
## License
|
|
588
|
-
|
|
589
|
-
MIT
|
|
9
|
+
There is nothing to follow yet — watch [relyio.com](https://relyio.com) for the launch.
|
package/dist/index.js
CHANGED
|
@@ -4060,12 +4060,6 @@ var init_deploy_service = __esm({
|
|
|
4060
4060
|
};
|
|
4061
4061
|
}
|
|
4062
4062
|
});
|
|
4063
|
-
|
|
4064
|
-
// ../../domain/schema/dist/chunk-QSWR2YJN.js
|
|
4065
|
-
var init_chunk_QSWR2YJN = __esm({
|
|
4066
|
-
"../../domain/schema/dist/chunk-QSWR2YJN.js"() {
|
|
4067
|
-
}
|
|
4068
|
-
});
|
|
4069
4063
|
function normalizeReferenceTargets(to) {
|
|
4070
4064
|
if (to == null) return [];
|
|
4071
4065
|
return Array.isArray(to) ? [...to] : [to];
|
|
@@ -4126,15 +4120,6 @@ var init_chunk_YL47KAP2 = __esm({
|
|
|
4126
4120
|
});
|
|
4127
4121
|
}
|
|
4128
4122
|
});
|
|
4129
|
-
|
|
4130
|
-
// ../../domain/schema/dist/chunk-ILN7T4KB.js
|
|
4131
|
-
var init_chunk_ILN7T4KB = __esm({
|
|
4132
|
-
"../../domain/schema/dist/chunk-ILN7T4KB.js"() {
|
|
4133
|
-
init_chunk_QSWR2YJN();
|
|
4134
|
-
init_chunk_YL47KAP2();
|
|
4135
|
-
init_chunk_NB2NTUXG();
|
|
4136
|
-
}
|
|
4137
|
-
});
|
|
4138
4123
|
var init_chunk_KWUTF26B = __esm({
|
|
4139
4124
|
"../../domain/schema/dist/chunk-KWUTF26B.js"() {
|
|
4140
4125
|
init_chunk_YL47KAP2();
|
|
@@ -4369,14 +4354,34 @@ var init_chunk_KWUTF26B = __esm({
|
|
|
4369
4354
|
z.record(z.any());
|
|
4370
4355
|
}
|
|
4371
4356
|
});
|
|
4357
|
+
var init_chunk_XTMEVLMJ = __esm({
|
|
4358
|
+
"../../domain/schema/dist/chunk-XTMEVLMJ.js"() {
|
|
4359
|
+
}
|
|
4360
|
+
});
|
|
4361
|
+
|
|
4362
|
+
// ../../domain/schema/dist/chunk-QSWR2YJN.js
|
|
4363
|
+
var init_chunk_QSWR2YJN = __esm({
|
|
4364
|
+
"../../domain/schema/dist/chunk-QSWR2YJN.js"() {
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
|
|
4368
|
+
// ../../domain/schema/dist/chunk-N5M2EZW6.js
|
|
4369
|
+
var init_chunk_N5M2EZW6 = __esm({
|
|
4370
|
+
"../../domain/schema/dist/chunk-N5M2EZW6.js"() {
|
|
4371
|
+
init_chunk_YL47KAP2();
|
|
4372
|
+
init_chunk_QSWR2YJN();
|
|
4373
|
+
init_chunk_NB2NTUXG();
|
|
4374
|
+
}
|
|
4375
|
+
});
|
|
4372
4376
|
var init_dist = __esm({
|
|
4373
4377
|
"../../domain/schema/dist/index.js"() {
|
|
4374
|
-
init_chunk_ILN7T4KB();
|
|
4375
|
-
init_chunk_QSWR2YJN();
|
|
4376
4378
|
init_chunk_KWUTF26B();
|
|
4377
4379
|
init_chunk_OOMXKJZA();
|
|
4380
|
+
init_chunk_XTMEVLMJ();
|
|
4378
4381
|
init_chunk_VGBOPF6G();
|
|
4382
|
+
init_chunk_N5M2EZW6();
|
|
4379
4383
|
init_chunk_YL47KAP2();
|
|
4384
|
+
init_chunk_QSWR2YJN();
|
|
4380
4385
|
init_chunk_NB2NTUXG();
|
|
4381
4386
|
new Set(FORBIDDEN_ASSET_TYPE_FIELD_TYPES);
|
|
4382
4387
|
}
|
|
@@ -6659,16 +6664,23 @@ var init_diff_service = __esm({
|
|
|
6659
6664
|
}
|
|
6660
6665
|
});
|
|
6661
6666
|
|
|
6662
|
-
// src/ai/core/
|
|
6667
|
+
// src/ai/core/gateway-url.ts
|
|
6663
6668
|
function getGatewayUrl() {
|
|
6664
6669
|
if (process.env.RELYIO_AI_GATEWAY_URL) {
|
|
6665
6670
|
return process.env.RELYIO_AI_GATEWAY_URL.replaceAll("http://localhost", "http://127.0.0.1");
|
|
6666
6671
|
}
|
|
6667
|
-
if (process.env.RELYIO_API_URL)
|
|
6668
|
-
|
|
6669
|
-
}
|
|
6670
|
-
return "https://ai-gateway.relyio.com";
|
|
6672
|
+
if (process.env.RELYIO_API_URL) return LOCAL_GATEWAY_URL;
|
|
6673
|
+
return PRODUCTION_GATEWAY_URL;
|
|
6671
6674
|
}
|
|
6675
|
+
var PRODUCTION_GATEWAY_URL, LOCAL_GATEWAY_URL;
|
|
6676
|
+
var init_gateway_url = __esm({
|
|
6677
|
+
"src/ai/core/gateway-url.ts"() {
|
|
6678
|
+
PRODUCTION_GATEWAY_URL = "https://ai.relyio.com";
|
|
6679
|
+
LOCAL_GATEWAY_URL = "http://127.0.0.1:3600";
|
|
6680
|
+
}
|
|
6681
|
+
});
|
|
6682
|
+
|
|
6683
|
+
// src/ai/core/stream-client.ts
|
|
6672
6684
|
function getAuthToken3() {
|
|
6673
6685
|
const token = config_default.getAuthToken();
|
|
6674
6686
|
if (token) return token;
|
|
@@ -6680,6 +6692,7 @@ var AI_GATEWAY_PATH, MAX_RETRIES, RETRY_DELAY_MS, REQUEST_TIMEOUT_MS, GatewayStr
|
|
|
6680
6692
|
var init_stream_client = __esm({
|
|
6681
6693
|
"src/ai/core/stream-client.ts"() {
|
|
6682
6694
|
init_config();
|
|
6695
|
+
init_gateway_url();
|
|
6683
6696
|
AI_GATEWAY_PATH = "/ai/cli";
|
|
6684
6697
|
MAX_RETRIES = 2;
|
|
6685
6698
|
RETRY_DELAY_MS = 1e3;
|
|
@@ -6830,13 +6843,6 @@ var init_stream_client = __esm({
|
|
|
6830
6843
|
});
|
|
6831
6844
|
|
|
6832
6845
|
// src/ai/services/handoff-client.ts
|
|
6833
|
-
function getGatewayUrl2() {
|
|
6834
|
-
if (process.env.RELYIO_AI_GATEWAY_URL) {
|
|
6835
|
-
return process.env.RELYIO_AI_GATEWAY_URL.replaceAll("http://localhost", "http://127.0.0.1");
|
|
6836
|
-
}
|
|
6837
|
-
if (process.env.RELYIO_API_URL) return "http://127.0.0.1:3600";
|
|
6838
|
-
return "https://ai-gateway.relyio.com";
|
|
6839
|
-
}
|
|
6840
6846
|
function getAuthToken4() {
|
|
6841
6847
|
const token = config_default.getAuthToken();
|
|
6842
6848
|
return token ?? null;
|
|
@@ -6847,7 +6853,7 @@ async function fetchHandoffSummary(req) {
|
|
|
6847
6853
|
const controller = new AbortController();
|
|
6848
6854
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS2);
|
|
6849
6855
|
try {
|
|
6850
|
-
const response = await fetch(`${
|
|
6856
|
+
const response = await fetch(`${getGatewayUrl()}${AI_GATEWAY_HANDOFF_PATH}`, {
|
|
6851
6857
|
method: "POST",
|
|
6852
6858
|
headers: {
|
|
6853
6859
|
"Content-Type": "application/json",
|
|
@@ -6873,6 +6879,7 @@ var init_handoff_client = __esm({
|
|
|
6873
6879
|
"src/ai/services/handoff-client.ts"() {
|
|
6874
6880
|
init_wire();
|
|
6875
6881
|
init_config();
|
|
6882
|
+
init_gateway_url();
|
|
6876
6883
|
AI_GATEWAY_HANDOFF_PATH = "/ai/cli/handoff/summary";
|
|
6877
6884
|
REQUEST_TIMEOUT_MS2 = 15e3;
|
|
6878
6885
|
}
|
|
@@ -10205,7 +10212,7 @@ var init_banner = __esm({
|
|
|
10205
10212
|
init_dev_cockpit_context();
|
|
10206
10213
|
init_dev_cockpit_format();
|
|
10207
10214
|
init_startup_info();
|
|
10208
|
-
CLI_VERSION2 = "0.2.
|
|
10215
|
+
CLI_VERSION2 = "0.2.2" ;
|
|
10209
10216
|
BRAND_GLYPH = "\u25B6";
|
|
10210
10217
|
BRAND_NAME = "RelyIO";
|
|
10211
10218
|
LABEL_WIDTH = 9;
|
|
@@ -12459,13 +12466,6 @@ var init_agent_picker = __esm({
|
|
|
12459
12466
|
});
|
|
12460
12467
|
|
|
12461
12468
|
// src/ai/services/models-client.ts
|
|
12462
|
-
function getGatewayUrl3() {
|
|
12463
|
-
if (process.env.RELYIO_AI_GATEWAY_URL) {
|
|
12464
|
-
return process.env.RELYIO_AI_GATEWAY_URL.replaceAll("http://localhost", "http://127.0.0.1");
|
|
12465
|
-
}
|
|
12466
|
-
if (process.env.RELYIO_API_URL) return "http://127.0.0.1:3600";
|
|
12467
|
-
return "https://ai-gateway.relyio.com";
|
|
12468
|
-
}
|
|
12469
12469
|
function getAuthToken5() {
|
|
12470
12470
|
const token = config_default.getAuthToken();
|
|
12471
12471
|
if (token) return token;
|
|
@@ -12500,6 +12500,7 @@ var init_models_client = __esm({
|
|
|
12500
12500
|
"src/ai/services/models-client.ts"() {
|
|
12501
12501
|
init_wire();
|
|
12502
12502
|
init_config();
|
|
12503
|
+
init_gateway_url();
|
|
12503
12504
|
AI_GATEWAY_MODELS_PATH = "/models";
|
|
12504
12505
|
ModelsClient = class {
|
|
12505
12506
|
// In-process cache. Lifetime = CLI process. See file header for rationale.
|
|
@@ -12520,7 +12521,7 @@ var init_models_client = __esm({
|
|
|
12520
12521
|
this.cached = null;
|
|
12521
12522
|
}
|
|
12522
12523
|
async fetchModels() {
|
|
12523
|
-
const url = `${
|
|
12524
|
+
const url = `${getGatewayUrl()}${AI_GATEWAY_MODELS_PATH}`;
|
|
12524
12525
|
const response = await fetch(url, {
|
|
12525
12526
|
method: "GET",
|
|
12526
12527
|
headers: {
|
|
@@ -14621,13 +14622,6 @@ var init_use_session_persistence = __esm({
|
|
|
14621
14622
|
});
|
|
14622
14623
|
|
|
14623
14624
|
// src/ai/services/proposals-client.ts
|
|
14624
|
-
function getGatewayUrl4() {
|
|
14625
|
-
if (process.env.RELYIO_AI_GATEWAY_URL) {
|
|
14626
|
-
return process.env.RELYIO_AI_GATEWAY_URL.replaceAll("http://localhost", "http://127.0.0.1");
|
|
14627
|
-
}
|
|
14628
|
-
if (process.env.RELYIO_API_URL) return "http://127.0.0.1:3600";
|
|
14629
|
-
return "https://ai-gateway.relyio.com";
|
|
14630
|
-
}
|
|
14631
14625
|
function getAuthToken6() {
|
|
14632
14626
|
const token = config_default.getAuthToken();
|
|
14633
14627
|
if (token) return token;
|
|
@@ -14642,10 +14636,11 @@ var init_proposals_client = __esm({
|
|
|
14642
14636
|
"src/ai/services/proposals-client.ts"() {
|
|
14643
14637
|
init_wire();
|
|
14644
14638
|
init_config();
|
|
14639
|
+
init_gateway_url();
|
|
14645
14640
|
AI_GATEWAY_PROPOSALS_PATH = "/ai/proposals";
|
|
14646
14641
|
ProposalsClient = class {
|
|
14647
14642
|
async request(method, path23, init = {}) {
|
|
14648
|
-
const url = new URL(`${
|
|
14643
|
+
const url = new URL(`${getGatewayUrl()}${AI_GATEWAY_PROPOSALS_PATH}${path23}`);
|
|
14649
14644
|
if (init.query) {
|
|
14650
14645
|
for (const [k, v] of Object.entries(init.query)) url.searchParams.set(k, v);
|
|
14651
14646
|
}
|
|
@@ -19708,7 +19703,7 @@ function sandboxCommands(program2) {
|
|
|
19708
19703
|
}
|
|
19709
19704
|
|
|
19710
19705
|
// src/commands/version.ts
|
|
19711
|
-
var CLI_VERSION = "0.2.
|
|
19706
|
+
var CLI_VERSION = "0.2.2" ;
|
|
19712
19707
|
async function handleVersion(_options) {
|
|
19713
19708
|
console.log(heading("RelyIO CLI Version Information"));
|
|
19714
19709
|
const versionInfo = [
|
|
@@ -21902,7 +21897,7 @@ Configuration:
|
|
|
21902
21897
|
relyio config set dashboardUrl <url>
|
|
21903
21898
|
|
|
21904
21899
|
For local development:
|
|
21905
|
-
relyio config set dashboardUrl http://localhost:
|
|
21900
|
+
relyio config set dashboardUrl http://localhost:3920
|
|
21906
21901
|
|
|
21907
21902
|
For production:
|
|
21908
21903
|
relyio config set dashboardUrl https://dashboard.relyio.com
|
|
@@ -22932,14 +22927,8 @@ init_session_manager();
|
|
|
22932
22927
|
// src/ai/services/conversations-client.ts
|
|
22933
22928
|
init_wire();
|
|
22934
22929
|
init_config();
|
|
22930
|
+
init_gateway_url();
|
|
22935
22931
|
var AI_GATEWAY_CONVERSATIONS_PATH = "/ai/conversations";
|
|
22936
|
-
function getGatewayUrl5() {
|
|
22937
|
-
if (process.env.RELYIO_AI_GATEWAY_URL) {
|
|
22938
|
-
return process.env.RELYIO_AI_GATEWAY_URL.replaceAll("http://localhost", "http://127.0.0.1");
|
|
22939
|
-
}
|
|
22940
|
-
if (process.env.RELYIO_API_URL) return "http://127.0.0.1:3600";
|
|
22941
|
-
return "https://ai-gateway.relyio.com";
|
|
22942
|
-
}
|
|
22943
22932
|
function getAuthToken7() {
|
|
22944
22933
|
const token = config_default.getAuthToken();
|
|
22945
22934
|
if (token) return token;
|
|
@@ -22947,7 +22936,7 @@ function getAuthToken7() {
|
|
|
22947
22936
|
}
|
|
22948
22937
|
var ConversationsClient = class {
|
|
22949
22938
|
async request(method, path23, init = {}) {
|
|
22950
|
-
const url = new URL(`${
|
|
22939
|
+
const url = new URL(`${getGatewayUrl()}${AI_GATEWAY_CONVERSATIONS_PATH}${path23}`);
|
|
22951
22940
|
if (init.query) {
|
|
22952
22941
|
for (const [k, v] of Object.entries(init.query)) {
|
|
22953
22942
|
if (v === void 0) continue;
|
|
@@ -24048,7 +24037,7 @@ Examples:
|
|
|
24048
24037
|
}
|
|
24049
24038
|
|
|
24050
24039
|
// src/index.ts
|
|
24051
|
-
var CLI_VERSION3 = "0.2.
|
|
24040
|
+
var CLI_VERSION3 = "0.2.2" ;
|
|
24052
24041
|
var program = new Command();
|
|
24053
24042
|
program.name("relyio").description("RelyIO CLI - Content Management, Simplified").version(CLI_VERSION3);
|
|
24054
24043
|
registerGlobalOptions(program);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relyio/cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "RelyIO is coming soon — this package is not ready for general use yet.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "team@relyio.com"
|
|
7
7
|
},
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
"ink-testing-library": "^4.0.0",
|
|
63
63
|
"rimraf": "6.1.3",
|
|
64
64
|
"tsup": "8.5.1",
|
|
65
|
-
"typescript": "
|
|
65
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
66
66
|
"typescript-eslint": "8.69.0",
|
|
67
67
|
"vitest": "4.1.11",
|
|
68
|
+
"@relyio/api-contract": "0.1.0",
|
|
69
|
+
"@relyio/codegen-python": "0.1.0",
|
|
68
70
|
"@relyio/codegen-core": "1.0.0",
|
|
69
71
|
"@relyio/codegen-typescript": "1.0.0",
|
|
70
|
-
"@relyio/api-contract": "0.1.0",
|
|
71
|
-
"@relyio/schema": "0.0.1",
|
|
72
|
-
"@relyio/tenancy": "0.1.0",
|
|
73
72
|
"@relyio/eslint-config": "0.0.0",
|
|
74
|
-
"@relyio/
|
|
73
|
+
"@relyio/schema": "0.0.1",
|
|
74
|
+
"@relyio/tenancy": "0.1.0"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "tsup && chmod +x dist/index.js",
|
|
85
85
|
"dev": "tsup --watch",
|
|
86
|
-
"lint:check": "
|
|
87
|
-
"lint:write": "
|
|
86
|
+
"lint:check": "relyio-lint",
|
|
87
|
+
"lint:write": "relyio-lint --fix",
|
|
88
88
|
"clean": "rimraf dist",
|
|
89
89
|
"type:check": "tsc --noEmit",
|
|
90
90
|
"test": "vitest run",
|