Skip to content

Commit f73f660

Browse files
committed
Updated documentation
1 parent 9f5b93f commit f73f660

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

Diff for: docs/UPGRADING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ The errors are automatically sent to output via `feedback` package, as for the o
5757
### `board attach` CLI command changed behaviour
5858

5959
The `board attach` CLI command has changed behaviour: now it just pick whatever port and FQBN is passed as parameter and
60-
saves it in the `sketch.json` file, without any validity check or board autodetection.
60+
saves it in the `sketch.yaml` file, without any validity check or board autodetection.
61+
62+
The `sketch.json` file is now completely ignored.
6163

6264
### `cc.arduino.cli.commands.v1.BoardAttach` gRPC interface command removal
6365

Diff for: docs/sketch-project-file.md

+21
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,24 @@ When using the profile-based build, the globally installed platforms and librari
115115
not be used in any way. In other words, the build is isolated from the system and will rely only on the resources
116116
specified in the profile: this will ensure that the build is portable and reproducible independently from the platforms
117117
and libraries installed in the system.
118+
119+
## Default flags for Arduino CLI usage
120+
121+
The sketch project file may be used to set the default value for some command line flags of the Arduino CLI, in
122+
particular:
123+
124+
- The `default_fqbn` directive sets the default value for the `--fqbn` flag
125+
- The `default_port` directive sets the default value for the `--port` flag
126+
- The `default_protocol` directive sets the default value for the `--protocol` flag
127+
128+
For example:
129+
130+
```
131+
default_fqbn: arduino:avr:uno
132+
default_port: /dev/ttyACM0
133+
default_protocol: serial
134+
```
135+
136+
With this configuration set, it is not necessary to specify the `--fqbn`, `--port`, or `--protocol` flags to the
137+
[`arduino-cli compile`](commands/arduino-cli_compile.md) or [`arduino-cli upload`](commands/arduino-cli_upload.md)
138+
commands when compiling or uploading the sketch.

Diff for: docs/sketch-specification.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ the `data` folder, so any non-code files outside the `data` folder are stripped.
6868

6969
#### `sketch.json`
7070

71-
Arduino CLI and Arduino Web Editor use a file named sketch.json, located in the sketch root folder, to store sketch
72-
metadata.
71+
Arduino Web Editor use a file named `sketch.json`, located in the sketch root folder, to store sketch metadata. This
72+
file is not used by the Arduino CLI or the Arduino IDE, if you're not an Arduino Web Editor user you can safely ignore
73+
it.
7374

74-
The `cpu` key contains the board configuration information. This can be set via
75-
[`arduino-cli board attach`](commands/arduino-cli_board_attach.md) or by selecting a board in the Arduino Web Editor
76-
while the sketch is open. With this configuration set, it is not necessary to specify the `--fqbn` or `--port` flags to
77-
the [`arduino-cli compile`](commands/arduino-cli_compile.md) or [`arduino-cli upload`](commands/arduino-cli_upload.md)
78-
commands when compiling or uploading the sketch.
75+
The `cpu` key contains the board configuration information. This can be set by selecting a board in the Arduino Web
76+
Editor while the sketch is open.
7977

8078
The `included_libs` key defines the library versions the Arduino Web Editor uses when the sketch is compiled. This is
8179
Arduino Web Editor specific because all versions of all the Library Manager libraries are pre-installed in Arduino Web
@@ -88,6 +86,9 @@ This is an optional file named `sketch.yaml`, located in the root folder of the
8886
Inside the sketch project file the user can define one or more "profiles": each profile is a description of all the
8987
resources needed to build the sketch (platform and libraries each pinned to a specific version).
9088

89+
The sketch project file is also used in the [`arduino-cli board attach`](commands/arduino-cli_board_attach.md) command
90+
to store the currently selected board and port.
91+
9192
For more information see the [sketch project file](sketch-project-file.md) documentation.
9293

9394
### Secrets

0 commit comments

Comments
 (0)