@getxflow/cli 0.34.1 → 0.34.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/dist/bin.js +5 -0
- package/dist/commands/db.js +1 -1
- package/dist/help.js +8 -6
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/xflow/SKILL.md +6 -5
package/dist/bin.js
CHANGED
|
@@ -343,6 +343,11 @@ async function main() {
|
|
|
343
343
|
const hint = e instanceof errors_1.CliError ? e.hint : undefined;
|
|
344
344
|
if (hint)
|
|
345
345
|
(0, ui_1.fatalNote)((0, ui_1.dim)(` ${hint}`));
|
|
346
|
+
// The command may exist in a newer release: this path never reaches the platform,
|
|
347
|
+
// so the update notice below has no version to go on and stays silent.
|
|
348
|
+
if (e instanceof errors_1.CliError && e.message.startsWith('Unknown command')) {
|
|
349
|
+
(0, ui_1.fatalNote)((0, ui_1.dim)(' If the command is new, this CLI may be behind: run xflow update'));
|
|
350
|
+
}
|
|
346
351
|
return 1;
|
|
347
352
|
}
|
|
348
353
|
(0, ui_1.fatal)(e instanceof Error ? e.message : String(e));
|
package/dist/commands/db.js
CHANGED
|
@@ -273,7 +273,7 @@ async function dbQuery(args) {
|
|
|
273
273
|
? (0, text_file_1.readTextFile)(typed, 'An argument ending in .sql is read as a file: check the path, or end the query with ;')
|
|
274
274
|
: typed;
|
|
275
275
|
if (!sql) {
|
|
276
|
-
throw new errors_1.CliError(typed ? `${typed} is empty` : 'A query is required',
|
|
276
|
+
throw new errors_1.CliError(typed ? `${typed} is empty` : 'A query is required', "For example: xflow db query 'select * from orders order by created_at desc limit 20', " +
|
|
277
277
|
'or a long one from a file outside the project: xflow db query ../report.sql');
|
|
278
278
|
}
|
|
279
279
|
const { projectId, client } = await (0, session_1.projectTarget)(args);
|
package/dist/help.js
CHANGED
|
@@ -85,7 +85,7 @@ ${(0, ui_1.bold)('Database')}
|
|
|
85
85
|
xflow db status which migrations are applied and which are waiting
|
|
86
86
|
xflow db list databases of the organization, servers, projects
|
|
87
87
|
xflow db schema [table] tables of the project, or the columns of one
|
|
88
|
-
xflow db query
|
|
88
|
+
xflow db query 'select ...' read data, in a read-only transaction
|
|
89
89
|
xflow db migrate [--dry-run] [--allow-destructive]
|
|
90
90
|
apply the migrations from migrations/*.sql
|
|
91
91
|
xflow db move --to <server> --confirm <database>
|
|
@@ -161,7 +161,7 @@ check ${(0, ui_1.bold)('xflow org')}.`,
|
|
|
161
161
|
Every command that only talks to the platform takes it, so a service project needs
|
|
162
162
|
no working copy of its own:
|
|
163
163
|
|
|
164
|
-
xflow db query --project 3f2a…
|
|
164
|
+
xflow db query --project 3f2a… 'select id, title from tasks where done = false'
|
|
165
165
|
xflow functions invoke kanban --project 3f2a… --data-file card.json
|
|
166
166
|
|
|
167
167
|
Which commands: ${(0, ui_1.bold)('db status')}, ${(0, ui_1.bold)('db query')}, ${(0, ui_1.bold)('db schema')}, ${(0, ui_1.bold)('db move')}, ${(0, ui_1.bold)('functions list')},
|
|
@@ -297,7 +297,7 @@ will work.`,
|
|
|
297
297
|
xflow db status what is applied, what is waiting, the server
|
|
298
298
|
xflow db list databases of the organization: servers, projects
|
|
299
299
|
xflow db schema [table] tables of the project, or the columns of one
|
|
300
|
-
xflow db query
|
|
300
|
+
xflow db query 'select ...' read data (--limit N: 50 by default, 300 at most;
|
|
301
301
|
--json prints the values whole)
|
|
302
302
|
xflow db query <file>.sql the same, the query read from a file
|
|
303
303
|
xflow db migrate apply migrations/*.sql
|
|
@@ -329,9 +329,11 @@ paying for and deleting servers stay with the person, in the web interface.
|
|
|
329
329
|
${(0, ui_1.bold)('schema')} answers a different question than the ${(0, ui_1.bold)('migrations/')} directory: one logical
|
|
330
330
|
database is shared by several projects, so the files say what you did, and the schema
|
|
331
331
|
says what is actually in there. ${(0, ui_1.bold)('query')} runs inside a READ ONLY transaction, so
|
|
332
|
-
writes are rejected by the database itself, not by us reading your SQL.
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
writes are rejected by the database itself, not by us reading your SQL. Single quotes around
|
|
333
|
+
the query hold in PowerShell, bash and zsh, while cmd.exe wants double ones; a query that
|
|
334
|
+
needs quotes of its own goes in a .sql file outside the project, because Windows PowerShell
|
|
335
|
+
strips double quotes from arguments and a file in migrations/ would be taken for a
|
|
336
|
+
migration. Its table cuts
|
|
335
337
|
long values to keep the columns readable; ${(0, ui_1.bold)('--json')} prints them whole, together with
|
|
336
338
|
the applied limit and its ceiling. ${(0, ui_1.bold)('status')} named by id (${(0, ui_1.bold)('--project')}) answers with
|
|
337
339
|
the applied history alone: comparing against ${(0, ui_1.bold)('migrations/')} needs the folder.
|
package/dist/version.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_API_URL = exports.CLI_VERSION = void 0;
|
|
4
4
|
/** Keep in sync with cli/package.json. */
|
|
5
|
-
exports.CLI_VERSION = '0.34.
|
|
5
|
+
exports.CLI_VERSION = '0.34.2';
|
|
6
6
|
/** Overridden by XFLOW_API_URL or the `api` field in xflow.json. */
|
|
7
7
|
exports.DEFAULT_API_URL = 'https://app.getxflow.com';
|
package/package.json
CHANGED
package/skills/xflow/SKILL.md
CHANGED
|
@@ -22,7 +22,7 @@ contains the fix.
|
|
|
22
22
|
|
|
23
23
|
## Keeping these instructions current
|
|
24
24
|
|
|
25
|
-
These instructions ship with xflow CLI 0.34.
|
|
25
|
+
These instructions ship with xflow CLI 0.34.2, so the copy you are reading can be older than
|
|
26
26
|
the CLI answering your commands.
|
|
27
27
|
|
|
28
28
|
When the CLI says this file does not match it, run `xflow skills --refresh` and then **read
|
|
@@ -482,10 +482,11 @@ One logical database can be shared by several projects, so your migration can br
|
|
|
482
482
|
do not see: `xflow db status` lists applied migrations with no file in your repository (that is
|
|
483
483
|
somebody else's project), and `xflow db list` names who else is on yours. For the same reason
|
|
484
484
|
`migrations/` is not the schema. It says what you did; `xflow db schema [table]` says what is in
|
|
485
|
-
the database right now, and `xflow db query
|
|
486
|
-
transaction (50 rows by default, `--limit` up to 300; `--json` prints long values whole).
|
|
487
|
-
|
|
488
|
-
|
|
485
|
+
the database right now, and `xflow db query 'select ...'` reads it inside a READ ONLY
|
|
486
|
+
transaction (50 rows by default, `--limit` up to 300; `--json` prints long values whole). Single
|
|
487
|
+
quotes hold in PowerShell, bash and zsh, while cmd.exe wants double ones; a query that needs
|
|
488
|
+
quotes of its own goes in a `.sql` file outside the project, `xflow db query ../q.sql`, because
|
|
489
|
+
PowerShell strips double quotes from arguments. Look before you write a migration against a shared database.
|
|
489
490
|
|
|
490
491
|
An organization can have own database servers, several of them for different jobs. `xflow db
|
|
491
492
|
list` names the server of each database (`platform` is the common one) and lists the own servers
|