@getxflow/cli 1.0.8 → 1.0.9

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 CHANGED
@@ -309,7 +309,8 @@ async function main() {
309
309
  const args = (0, args_1.parseArgs)(process.argv.slice(2));
310
310
  // Decided here rather than in each command: the header of --project, the nudges and
311
311
  // every progress line are written on the way to a payload that has to stand alone.
312
- (0, ui_1.setQuiet)((0, args_1.flagBool)(args, 'json'));
312
+ // An invoke is always such a payload: its answer goes straight into a pipe.
313
+ (0, ui_1.setQuiet)((0, args_1.flagBool)(args, 'json') || (args.words[0] === 'functions' && args.words[1] === 'invoke'));
313
314
  if ((0, args_1.flagBool)(args, 'version')) {
314
315
  (0, ui_1.out)(version_1.CLI_VERSION);
315
316
  return 0;
@@ -50,9 +50,8 @@ async function functionsInvoke(args) {
50
50
  body: { method, ...(data !== undefined && method !== 'GET' && method !== 'HEAD' ? { body: data } : {}) },
51
51
  timeoutMs: 15 * 60_000,
52
52
  });
53
- (0, ui_1.note)((0, ui_1.dim)(`${answer.status} in ${answer.elapsedMs} ms`));
54
53
  if (answer.body)
55
- (0, ui_1.out)((0, args_1.flagBool)(args, 'json') ? answer.body : prettyBody(answer.body));
54
+ (0, ui_1.out)(prettyBody(answer.body));
56
55
  if (answer.status >= 400)
57
56
  throw new errors_1.CliError(`The function answered ${answer.status}`, answer.hint);
58
57
  }
package/dist/flags.js CHANGED
@@ -57,7 +57,7 @@ exports.KNOWN = {
57
57
  'mcp install': ['show-token'],
58
58
  functions: ['project'],
59
59
  'functions list': ['project'],
60
- 'functions invoke': ['data', 'data-file', 'json', 'method', 'project'],
60
+ 'functions invoke': ['data', 'data-file', 'method', 'project'],
61
61
  'functions logs': ['limit', 'project'],
62
62
  logs: ['limit', 'project', 'app'],
63
63
  env: ['project'],
package/dist/help.js CHANGED
@@ -634,14 +634,13 @@ ${(0, ui_1.bold)("event.xflow.caller === 'platform'")} and the person in ${(0, u
634
634
  --data '{"a":1}' request body (the method becomes POST by default)
635
635
  --data-file body.json the same body from a file
636
636
  --method GET a different method
637
- --json the answer of the function alone, exactly as it came
638
637
 
639
638
  The body has to be JSON, and it is checked before the call goes out: PowerShell
640
639
  strips double quotes from a native call, so ${(0, ui_1.bold)('--data')} needs them escaped there
641
640
  (${(0, ui_1.bold)('--data \'{\\"a\\":1}\'')}) and a file needs nothing.
642
641
 
643
- Prints the status, the response time and the body; under ${(0, ui_1.bold)('--json')} the body
644
- alone. A non-zero exit code on 4xx and 5xx: in CI such a call has to fail the step. A
642
+ Prints the body of the answer and nothing else, so it goes straight into a pipe
643
+ (${(0, ui_1.bold)('| jq')}, ${(0, ui_1.bold)('| python')}). A non-zero exit code on 4xx and 5xx: in CI such a call has to fail the step. A
645
644
  refusal of the guard names its reason in the body (${(0, ui_1.bold)('not_bound')}, ${(0, ui_1.bold)('no_access')},
646
645
  ${(0, ui_1.bold)('functions_stopped')}); for a crash the hint points at ${(0, ui_1.bold)('xflow functions logs <name>')}.`,
647
646
  mcp: `${(0, ui_1.bold)('xflow mcp install')}: connect the agent to the platform directly
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 = '1.0.8';
5
+ exports.CLI_VERSION = '1.0.9';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getxflow/cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "CLI for the XFlow platform: projects with apps, functions and a database; source sync, deployment and publishing",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -23,7 +23,7 @@ contains the fix.
23
23
 
24
24
  ## Keeping these instructions current
25
25
 
26
- These instructions ship with xflow CLI 1.0.8, so the copy you are reading can be older than
26
+ These instructions ship with xflow CLI 1.0.9, so the copy you are reading can be older than
27
27
  the CLI answering your commands.
28
28
 
29
29
  When the CLI says this file does not match it, run `xflow skills --refresh` and then **read
@@ -377,8 +377,9 @@ A function whose code and variables did not change is not shipped again, and one
377
377
  ship fails the whole deploy.
378
378
 
379
379
  Debugging a deployed function is two commands: `xflow functions invoke <name>` calls it as you,
380
- through the platform, and prints status, timing and body (`--data '{"a":1}'`, `--data-file
381
- body.json`, `--method GET`, `--json` for the body alone); `xflow functions logs <name>` shows
380
+ through the platform, and prints the body alone, ready for a pipe (`--data '{"a":1}'`, `--data-file
381
+ body.json`, `--method GET`; 4xx and 5xx exit non-zero; Windows PowerShell 5.1 prepends a BOM when
382
+ piping to another program, so read it with `ConvertFrom-Json` or Python's `utf-8-sig`); `xflow functions logs <name>` shows
382
383
  the crashes and 5xx answers with stacks and console output, the latest 10 (`--limit N` for more).
383
384
  Only failed calls are logged. Empty output does not clear a function that fails at module start,
384
385
  runs over its time cap or out of memory: those never reach the logs, `invoke` shows them.