Skip to content

Commit 7663d7e

Browse files
author
Massimiliano Pippi
authored
[ci skip] document config file (#492)
1 parent c30151b commit 7663d7e

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

README.md

+28-13
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,42 @@ Great! Now we are ready to compile and upload the sketch.
234234

235235
#### Adding 3rd party cores
236236

237-
To add 3rd party core packages add a link of the additional package to the file `arduino-cli.yaml`
237+
To use 3rd party core packages, pass a link to the the additional package index
238+
file with the `--additional-urls` option to any command that supports additional
239+
cores:
238240

239-
If you want to add the ESP8266 core, for example:
241+
```console
242+
$ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
243+
$
244+
$ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
245+
ID Version Name
246+
esp8266:esp8266 2.5.2 esp8266
247+
```
248+
249+
To avoid passing the `--additional-urls` option every time you run a command,
250+
you can list the URLs to additional package indexes in the CLI configuration
251+
file. If you don't have a configuration file yet (it's the case of a fresh
252+
install) you can create one with the command:
253+
254+
```console
255+
$ arduino-cli config init
256+
Config file PATH: /home/user/.arduino15/arduino-cli.yaml
257+
```
258+
259+
This will create a configuration file in its default location for the current
260+
operating system and will print the full path to the file.
261+
262+
For example, to add the ESP8266 core, edit the configration file and add the
263+
following:
240264

241265
```yaml
242266
board_manager:
243267
additional_urls:
244268
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
245269
```
246270
247-
And then run:
271+
From now on, commands supporting custom cores will automatically use the
272+
additional URL from the configuration file:
248273
249274
```console
250275
$ arduino-cli core update-index
@@ -257,16 +282,6 @@ ID Version Name
257282
esp8266:esp8266 2.5.2 esp8266
258283
```
259284

260-
Alternatively, you can pass the `--additional-urls` to any command involving the additional cores:
261-
262-
```console
263-
$ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
264-
$
265-
$ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
266-
ID Version Name
267-
esp8266:esp8266 2.5.2 esp8266
268-
```
269-
270285
### Step 5. Compile the sketch
271286

272287
To compile the sketch we have to run the `compile` command with the proper FQBN we just got in the

0 commit comments

Comments
 (0)