@turingcode/cli 0.3.8 → 0.3.12

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.
@@ -95,6 +95,10 @@ export function readJsonArg(value) {
95
95
  return JSON.parse(text);
96
96
  }
97
97
  catch (e) {
98
- throw new Error(`invalid JSON (${e.message})`);
98
+ /** Windows PowerShell 5.1 and cmd drop the inner quotes of inline JSON, leaving `{key:` behind. */
99
+ const hint = /^\s*[{[]\s*[\w$-]+\s*:/.test(text)
100
+ ? "; the shell removed its double quotes (Windows PowerShell 5.1 and cmd do), put the JSON in a .json file and pass its path"
101
+ : "";
102
+ throw new Error(`invalid JSON (${e.message})${hint}`);
99
103
  }
100
104
  }
@@ -155,6 +155,7 @@ const call = {
155
155
  '`tool describe <name>`.',
156
156
  '--args is a JSON object, inline or a path to a .json file;',
157
157
  'leave it out for a tool without arguments.',
158
+ 'Windows PowerShell 5.1 and cmd strip the quotes of inline JSON: use a .json file there.',
158
159
  "The tool's text result goes to stdout: redirect it (`> file`) to save a large result without",
159
160
  'reading it. A tool error is printed to stderr.',
160
161
  TOKEN_HELP,
@@ -25,16 +25,12 @@ Pins, clocks, `.ioc` edits, register lookup and the datasheet knowledge base (MC
25
25
 
26
26
  - `turingcode tool list` shows the available tools.
27
27
  - `turingcode tool call <name> --args '<json>' > result.md` runs one.
28
+ - On Windows PowerShell or cmd, inline JSON loses its quotes: write the JSON to a `.json` file and pass `--args args.json`.
28
29
 
29
- After a tool changes the server copy of the project, run `turingcode project pull` (or `project regen`) to bring the changes local.
30
30
 
31
31
  ## New project
32
32
 
33
- Only when the user asks for one.
34
-
35
- 1. Run `turingcode probe info` to identify the connected chip and list its matching CubeMX names.
36
- 2. Pick one name. The package (pin count) can't be read over SWD, so ask the user or pick a package with the pins they need. Names that differ only in package build the same code for their shared pins.
37
- 3. Run `turingcode project template --mcu <name>` to download it into `./<name>/`, then `cd` into that folder. All project commands run from the project folder; copy your `.env` there if you use one.
33
+ Only when the user asks for a new project: follow [references/newproject.md](references/newproject.md).
38
34
 
39
35
  ## Typical loop
40
36
 
@@ -0,0 +1,7 @@
1
+ # New project
2
+
3
+ Only when the user asks for one.
4
+
5
+ 1. Run `turingcode probe info` to identify the connected chip and list its matching CubeMX names.
6
+ 2. Pick one name. The package (pin count) can't be read over SWD, so ask the user or pick a package with the pins they need. Names that differ only in package build the same code for their shared pins.
7
+ 3. Run `turingcode project template --mcu <name>` to download it into `./<name>/`, then `cd` into that folder. All project commands run from the project folder; copy your `.env` there if you use one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turingcode/cli",
3
- "version": "0.3.8",
3
+ "version": "0.3.12",
4
4
  "description": "Turing Code toolkit for AI agents: check Markdown/CSV tables against table contracts, e.g. `turingcode table check`.",
5
5
  "type": "module",
6
6
  "exports": {