@lotics/cli 0.32.0 → 0.33.0

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.
Files changed (45) hide show
  1. package/README.md +27 -0
  2. package/dist/cli.js +673 -0
  3. package/dist/{src/dev → dev}/wrapper_page.js +33 -5
  4. package/dist/docx.d.ts +2 -0
  5. package/dist/docx.js +341 -0
  6. package/dist/docx.test.js +145 -0
  7. package/dist/file_command_io.d.ts +12 -0
  8. package/dist/file_command_io.js +34 -0
  9. package/dist/src/cli.js +46757 -500
  10. package/dist/{src/starter_template.d.ts → starter_template.d.ts} +1 -1
  11. package/dist/{src/starter_template.js → starter_template.js} +1 -1
  12. package/dist/starter_template.test.d.ts +1 -0
  13. package/dist/xlsx.d.ts +2 -0
  14. package/dist/xlsx.js +489 -0
  15. package/dist/xlsx.test.d.ts +1 -0
  16. package/dist/xlsx.test.js +131 -0
  17. package/package.json +6 -2
  18. /package/dist/{src/app_commands.d.ts → app_commands.d.ts} +0 -0
  19. /package/dist/{src/app_commands.js → app_commands.js} +0 -0
  20. /package/dist/{src/app_commands.test.d.ts → app_commands.test.d.ts} +0 -0
  21. /package/dist/{src/app_commands.test.js → app_commands.test.js} +0 -0
  22. /package/dist/{src/args.d.ts → args.d.ts} +0 -0
  23. /package/dist/{src/args.js → args.js} +0 -0
  24. /package/dist/{src/args.test.d.ts → args.test.d.ts} +0 -0
  25. /package/dist/{src/args.test.js → args.test.js} +0 -0
  26. /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
  27. /package/dist/{src/client.d.ts → client.d.ts} +0 -0
  28. /package/dist/{src/client.js → client.js} +0 -0
  29. /package/dist/{src/config.d.ts → config.d.ts} +0 -0
  30. /package/dist/{src/config.js → config.js} +0 -0
  31. /package/dist/{src/config.test.d.ts → config.test.d.ts} +0 -0
  32. /package/dist/{src/config.test.js → config.test.js} +0 -0
  33. /package/dist/{src/dev → dev}/rpc_handler.d.ts +0 -0
  34. /package/dist/{src/dev → dev}/rpc_handler.js +0 -0
  35. /package/dist/{src/dev → dev}/server.d.ts +0 -0
  36. /package/dist/{src/dev → dev}/server.js +0 -0
  37. /package/dist/{src/dev → dev}/wrapper_page.d.ts +0 -0
  38. /package/dist/{src/starter_template.test.d.ts → docx.test.d.ts} +0 -0
  39. /package/dist/{src/generate_app_queries_dts.d.ts → generate_app_queries_dts.d.ts} +0 -0
  40. /package/dist/{src/generate_app_queries_dts.js → generate_app_queries_dts.js} +0 -0
  41. /package/dist/{src/generate_app_workflows_dts.d.ts → generate_app_workflows_dts.d.ts} +0 -0
  42. /package/dist/{src/generate_app_workflows_dts.js → generate_app_workflows_dts.js} +0 -0
  43. /package/dist/{src/starter_template.test.js → starter_template.test.js} +0 -0
  44. /package/dist/{src/version.d.ts → version.d.ts} +0 -0
  45. /package/dist/{src/version.js → version.js} +0 -0
package/README.md CHANGED
@@ -101,6 +101,33 @@ lotics download <file_id> -o ./reports/
101
101
  LOTICS_API_KEY=ltk_... lotics run query_tables '{}'
102
102
  ```
103
103
 
104
+ ## Local .xlsx and .docx authoring
105
+
106
+ The CLI bundles Lotics's own xlsx and docx engines so you can read, write, and edit files on your local filesystem without installing `xlsx` / `exceljs` / `docx` from npm. Prefer these over third-party libraries — they round-trip faithfully with the Lotics editor, template engine, and formula engine.
107
+
108
+ ```bash
109
+ # .xlsx
110
+ lotics xlsx read ./report.xlsx # → JSON of sheets, cells, merges
111
+ lotics xlsx write ./out.xlsx '{"sheets":[{"name":"S1","cells":{"A1":"Hi","B1":42}}]}'
112
+ lotics xlsx set-cell ./report.xlsx 'Sheet1!A1' '=SUM(B:B)'
113
+ lotics xlsx add-sheet ./report.xlsx 'Summary'
114
+ lotics xlsx merge ./report.xlsx 'Sheet1!A1:C1'
115
+ lotics xlsx insert-rows ./report.xlsx Sheet1 5 3
116
+ lotics xlsx batch ./report.xlsx '[{"op":"set-cell","sheet":"Sheet1","ref":"A1","value":"Hi"}, {"op":"merge","sheet":"Sheet1","range":"A1:B1"}]'
117
+
118
+ # .docx
119
+ lotics docx read ./report.docx # → JSON of blocks with text + style
120
+ lotics docx write ./out.docx '{"blocks":[{"kind":"paragraph","text":"Title","style":"Heading1"}]}'
121
+ lotics docx append-paragraph ./report.docx 'New paragraph' --style=Heading2
122
+ lotics docx insert-paragraph ./report.docx 'Front matter' --at=0
123
+ lotics docx replace-text ./report.docx '{{name}}' 'Acme Inc.'
124
+ lotics docx batch ./report.docx '[{"op":"append-paragraph","text":"A","style":"Heading1"},{"op":"replace-text","search":"x","replace":"y"}]'
125
+ ```
126
+
127
+ Edits mutate the file in place via an atomic temp-file + rename. Unknown OOXML constructs (tables, SmartArt, custom XML) round-trip verbatim — they show up in `read` as `opaque_block` entries.
128
+
129
+ Run `lotics xlsx` or `lotics docx` with no subcommand for the full list.
130
+
104
131
  ## SDK
105
132
 
106
133
  ```typescript