Skip to content

Commit be8c534

Browse files
roderikgithub-actions[bot]
authored andcommitted
chore: update docs [skip ci]
1 parent bc8f2e0 commit be8c534

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

sdk/utils/README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,13 @@ ensureServer();
353353

354354
> **executeCommand**(`command`, `args`, `options?`): `Promise`\<`string`[]\>
355355
356-
Defined in: [sdk/utils/src/terminal/execute-command.ts:51](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/execute-command.ts#L51)
356+
Defined in: [sdk/utils/src/terminal/execute-command.ts:60](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/execute-command.ts#L60)
357357

358358
Executes a command with the given arguments in a child process.
359359
Pipes stdin to the child process and captures stdout/stderr output.
360360
Masks any sensitive tokens in the output before displaying or returning.
361+
In quiet mode (when CLAUDECODE, REPL_ID, or AGENT env vars are set),
362+
output is suppressed unless the command errors out.
361363

362364
##### Parameters
363365

@@ -1048,18 +1050,20 @@ const masked = maskTokens("Token: sm_pat_****"); // "Token: ***"
10481050

10491051
> **note**(`message`, `level`): `void`
10501052
1051-
Defined in: [sdk/utils/src/terminal/note.ts:21](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/note.ts#L21)
1053+
Defined in: [sdk/utils/src/terminal/note.ts:90](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/note.ts#L90)
10521054

1053-
Displays a note message with optional warning level formatting.
1054-
Regular notes are displayed in normal text, while warnings are shown in yellow.
1055+
Displays a note message with optional warning or error level formatting.
1056+
Regular notes are displayed in normal text, warnings are shown in yellow, and errors in red.
10551057
Any sensitive tokens in the message are masked before display.
1058+
Warnings and errors are always displayed, even in quiet mode (when CLAUDECODE, REPL_ID, or AGENT env vars are set).
1059+
When an Error object is provided with level "error", the stack trace is automatically included.
10561060

10571061
##### Parameters
10581062

10591063
| Parameter | Type | Default value | Description |
10601064
| ------ | ------ | ------ | ------ |
1061-
| `message` | `string` | `undefined` | The message to display as a note |
1062-
| `level` | `"info"` \| `"warn"` | `"info"` | The note level: "info" (default) or "warn" for warning styling |
1065+
| `message` | `string` \| `Error` | `undefined` | The message to display as a note. Can be either: - A string: Displayed directly with appropriate styling - An Error object: The error message is displayed, and for level "error", the stack trace is automatically included |
1066+
| `level` | `"error"` \| `"info"` \| `"warn"` | `"info"` | The note level: "info" (default), "warn" for warning styling, or "error" for error styling |
10631067

10641068
##### Returns
10651069

@@ -1075,6 +1079,17 @@ note("Operation completed successfully");
10751079

10761080
// Display warning note
10771081
note("Low disk space remaining", "warn");
1082+
1083+
// Display error note (string)
1084+
note("Operation failed", "error");
1085+
1086+
// Display error with stack trace automatically (Error object)
1087+
try {
1088+
// some operation
1089+
} catch (error) {
1090+
// If error is an Error object and level is "error", stack trace is included automatically
1091+
note(error, "error");
1092+
}
10781093
```
10791094

10801095
***
@@ -1290,7 +1305,7 @@ await setName("my-new-project-name");
12901305

12911306
> **spinner**\<`R`\>(`options`): `Promise`\<`R`\>
12921307
1293-
Defined in: [sdk/utils/src/terminal/spinner.ts:55](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L55)
1308+
Defined in: [sdk/utils/src/terminal/spinner.ts:54](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L54)
12941309

12951310
Displays a loading spinner while executing an async task.
12961311
Shows progress with start/stop messages and handles errors.
@@ -1615,7 +1630,7 @@ The output of the command
16151630

16161631
#### SpinnerError
16171632

1618-
Defined in: [sdk/utils/src/terminal/spinner.ts:12](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L12)
1633+
Defined in: [sdk/utils/src/terminal/spinner.ts:11](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L11)
16191634

16201635
Error class used to indicate that the spinner operation failed.
16211636
This error is used to signal that the operation should be aborted.
@@ -1680,7 +1695,7 @@ Configuration options for the logger
16801695

16811696
#### SpinnerOptions
16821697

1683-
Defined in: [sdk/utils/src/terminal/spinner.ts:25](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L25)
1698+
Defined in: [sdk/utils/src/terminal/spinner.ts:24](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L24)
16841699

16851700
Options for configuring the spinner behavior
16861701

@@ -1694,9 +1709,9 @@ Options for configuring the spinner behavior
16941709

16951710
| Property | Type | Description | Defined in |
16961711
| ------ | ------ | ------ | ------ |
1697-
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:27](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L27) |
1698-
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:31](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L31) |
1699-
| <a id="task"></a> `task` | (`spinner?`) => `Promise`\<`R`\> | Async task to execute while spinner is active | [sdk/utils/src/terminal/spinner.ts:29](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L29) |
1712+
| <a id="startmessage"></a> `startMessage` | `string` | Message to display when spinner starts | [sdk/utils/src/terminal/spinner.ts:26](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L26) |
1713+
| <a id="stopmessage"></a> `stopMessage` | `string` | Message to display when spinner completes successfully | [sdk/utils/src/terminal/spinner.ts:30](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L30) |
1714+
| <a id="task"></a> `task` | (`spinner?`) => `Promise`\<`R`\> | Async task to execute while spinner is active | [sdk/utils/src/terminal/spinner.ts:28](https://github.com/settlemint/sdk/blob/v2.6.3/sdk/utils/src/terminal/spinner.ts#L28) |
17001715

17011716
### Type Aliases
17021717

0 commit comments

Comments
 (0)