Upgrading
Upgrading
Here you can find a list of migration guides to handle breaking changes, deprecations, and bugfixes that may cause problems between releases of the CLI.
1.0.4
The build cache path specified with compile --build-cache-path
 or build_cache.path
 now affects also sketches.
compile --build-cache-pathbuild_cache.pathPreviously the specified build cache path only affected cores and it was ignored for sketches. This is now fixed and both cores and sketches are cached in the given directory.
A full build of the sketch is performed if a build path is specified in compile --build-path ...
.
compile --build-path ...Previously if a build path was specified a cached core could have been used from the global build cache path resulting in a partial build inside the given build path.
Now if a build path is specified, the global build cache path is ignored and the full build is done in the given build path.
compile --build-cache-path
 is deprecated.
compile --build-cache-pathThe change above, makes the
compile --build-cache-pathThe default build_cache.path
 has been moved from the temp folder to the user's cache folder.
build_cache.pathPreviously the
build_cache.path$TMP/arduino$HOME/.cache/arduino1.0.0
compile --build-cache-path
 slightly changed directory format
compile --build-cache-pathNow compiled cores are cached under the
cores--build-cache-pathcore/tmp/arduino/cores/...Configuration file now supports only YAML format.
The Arduino CLI configuration file now supports only the YAML format.
gRPC Setting API important changes
The Settings API has been heavily refactored. Here a quick recap of the new methods:
 returns the value of a setting given the key. The returned value is a string encoded in JSON, or YAML- SettingsGetValue1message SettingsGetValueRequest {2 // The key to get3 string key = 1;4 // The format of the encoded_value (default is5 // "json", allowed values are "json" and "yaml)6 string value_format = 2;7}89message SettingsGetValueResponse {10 // The value of the key (encoded)11 string encoded_value = 1;12}
 change the value of a setting. The value may be specified in JSON, YAML, or as a command-line argument. If- SettingsSetValue
 is an empty string the setting is deleted.- encoded_value1message SettingsSetValueRequest {2 // The key to change3 string key = 1;4 // The new value (encoded), no objects,5 // only scalar, or array of scalars are6 // allowed.7 string encoded_value = 2;8 // The format of the encoded_value (default is9 // "json", allowed values are "json", "yaml",10 // and "cli")11 string value_format = 3;12}
 returns all the available keys and their type (- SettingsEnumerate
 ,- string
 ,- int
 ...)- []string
 replaces the current configuration with the one passed as argument. Differently from- ConfigurationOpen
 , this call replaces the whole configuration.- SettingsSetValue
 outputs the current configuration in the specified format. The configuration is not saved in a file, this call returns just the content, it's a duty of the caller to store the content in a file.- ConfigurationSave
 return the current configuration in a structured gRPC message- ConfigurationGet
 .- Configuration
The previous gRPC Setting rpc call may be replaced as follows:
- The old 
 rpc call can now be done troughSettingsMerge
 .SettingsSetValue
- The old 
 rpc call can now be done troughSettingsDelete
 passing theSettingsSetValue
 to delete with an emptykey
 .value
- The old 
 rpc call has been replaced bySettingsGetAll
 that returns a structured messageConfigurationGet
 with all the settings populated.Configuration
- The old 
 rpc call has been removed. It is partially replaced bySettingsWrite
 but the actual file save must be performed by the caller.ConfigurationSave
golang: importing arduino-cli
 as a library now requires the creation of a gRPC service.
arduino-cliPreviously the methods implementing the Arduino business logic were available in the global namespace
github.com/arduino/arduino-cli/commands/*The above is no more true. All the global
commands.*arduinoCoreServerImplArduinoCoreServercommands.NewArduinoCoreServer()The methods of the
ArduinoCoreServerFor example if previously we could call
commands.Init1// old Init signature2func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) error { ... }3
4// ...5
6// Initialize instance7if err := commands.Init(&rpc.InitRequest{Instance: req.GetInstance()}, respCB); err != nil {8  return err9}now the
responseCallbackrpc.ArduinoCoreService_InitServer1// new Init method2func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCoreService_InitServer) error { ... }3
4/// ...5
6// Initialize instance7initStream := InitStreamResponseToCallbackFunction(ctx, respCB)8if err := srv.Init(&rpc.InitRequest{Instance: req.GetInstance()}, initStream); err != nil {9  return err10}Each gRPC method has an helper method to obtain the corresponding
ArduinoCoreService_*Server1package main2
3import (4    "context"5    "fmt"6    "io"7    "log"8
9    "github.com/arduino/arduino-cli/commands"10    rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"11    "github.com/sirupsen/logrus"12)13
14func main() {15    // Create a new ArduinoCoreServer16    srv := commands.NewArduinoCoreServer()17
18    // Disable logging19    logrus.SetOutput(io.Discard)20
21    // Create a new instance in the server22    ctx := context.Background()23    resp, err := srv.Create(ctx, &rpc.CreateRequest{})24    if err != nil {25        log.Fatal("Error creating instance:", err)26    }27    instance := resp.GetInstance()28
29    // Defer the destruction of the instance30    defer func() {31        if _, err := srv.Destroy(ctx, &rpc.DestroyRequest{Instance: instance}); err != nil {32            log.Fatal("Error destroying instance:", err)33        }34        fmt.Println("Instance successfully destroyed")35    }()36
37    // Initialize the instance38    initStream := commands.InitStreamResponseToCallbackFunction(ctx, func(r *rpc.InitResponse) error {39        fmt.Println("INIT> ", r)40        return nil41    })42    if err := srv.Init(&rpc.InitRequest{Instance: instance}, initStream); err != nil {43        log.Fatal("Error during initialization:", err)44    }45
46    // Search for platforms and output the result47    searchResp, err := srv.PlatformSearch(ctx, &rpc.PlatformSearchRequest{Instance: instance})48    if err != nil {49        log.Fatal("Error searching for platforms:", err)50    }51    for _, platformSummary := range searchResp.GetSearchOutput() {52        installed := platformSummary.GetInstalledRelease()53        meta := platformSummary.GetMetadata()54        fmt.Printf("%30s %8s %s\n", meta.GetId(), installed.GetVersion(), installed.GetName())55    }56}YAML output format is no more supported
The
yaml--format--format jsongRPC: The type
 field has been renamed to types
 in the cc.arduino.cli.commands.v1.PlatformRelease
 message.
typetypescc.arduino.cli.commands.v1.PlatformReleaseRebuilding the gRPC bindings from the proto files requires to rename all access to
typetypesBy the way, the wire protocol is not affected by this change, existing clients should work fine without modification.
The type
 field has been renamed to types
 in the JSON output including a platform release.
typetypesSince the
typetypesPreviously:
1$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'2{3  "name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",4  "version": "1.8.13",5  "type": [6    "Arduino"7  ],8  ...Now:
1$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'2{3  "name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",4  "version": "1.8.13",5  "types": [6    "Arduino"7  ],8  ...The gRPC cc.arduino.cli.commands.v1.CompileRequest.export_binaries
 changed type.
cc.arduino.cli.commands.v1.CompileRequest.export_binariesPreviously the field
export_binariesgoogle.protobuf.BoolValuetruefalsenullNow the field is an
optional boolSome gRPC responses messages now uses the oneof
 clause.
oneofThe following responses message:
- cc.arduino.cli.commands.v1.PlatformInstallResponse
- cc.arduino.cli.commands.v1.PlatformDownloadResponse
- cc.arduino.cli.commands.v1.PlatformUninstallResponse
- cc.arduino.cli.commands.v1.PlatformUpgradeResponse
- cc.arduino.cli.commands.v1.DebugResponse
- cc.arduino.cli.commands.v1.LibraryDownloadResponse
- cc.arduino.cli.commands.v1.LibraryInstallResponse
- cc.arduino.cli.commands.v1.LibraryUpgradeResponse
- cc.arduino.cli.commands.v1.LibraryUninstallResponse
- cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse
- cc.arduino.cli.commands.v1.ZipLibraryInstallResponse
- cc.arduino.cli.commands.v1.GitLibraryInstallResponse
- cc.arduino.cli.commands.v1.MonitorResponse
now use the
oneofPlatformInstallResponse1message PlatformInstallResponse {2  // Progress of the downloads of the platform and tool files.3  DownloadProgress progress = 1;4  // Description of the current stage of the installation.5  TaskProgress task_progress = 2;6}to:
1message PlatformInstallResponse {2  message Result {3    // Empty message, reserved for future expansion.4  }5  oneof message {6    // Progress of the downloads of the platform and tool files.7    DownloadProgress progress = 1;8    // Description of the current stage of the installation.9    TaskProgress task_progress = 2;10    // The installation result.11    Result result = 3;12  }13}The other messages have been changed in a similar way.
The gRPC cc.arduino.cli.commands.v1.UpdateIndexResponse
 and UpdateLibrariesIndexResponse
 have changed.
cc.arduino.cli.commands.v1.UpdateIndexResponseUpdateLibrariesIndexResponseThe responses coming from the update index commands:
1message UpdateIndexResponse {2  // Progress of the package index download.3  DownloadProgress download_progress = 1;4}5
6message UpdateLibrariesIndexResponse {7  // Progress of the libraries index download.8  DownloadProgress download_progress = 1;9}are now more explicit and contains details about the result of the operation:
1message UpdateIndexResponse {2  message Result {3    // The result of the packages index update.4    repeated IndexUpdateReport updated_indexes = 1;5  }6  oneof message {7    // Progress of the package index download.8    DownloadProgress download_progress = 1;9    // The result of the index update.10    Result result = 2;11  }12}13
14message UpdateLibrariesIndexResponse {15  message Result {16    // The result of the libraries index update.17    IndexUpdateReport libraries_index = 1;18  }19  oneof message {20    // Progress of the libraries index download.21    DownloadProgress download_progress = 1;22    // The result of the index update.23    Result result = 2;24  }25}The
IndexUpdateReport1message IndexUpdateReport {2  enum Status {3    // The status of the index update is unspecified.4    STATUS_UNSPECIFIED = 0;5    // The index has been successfully updated.6    STATUS_UPDATED = 1;7    // The index was already up to date.8    STATUS_ALREADY_UP_TO_DATE = 2;9    // The index update failed.10    STATUS_FAILED = 3;11    // The index update was skipped.12    STATUS_SKIPPED = 4;13  }14
15  // The URL of the index that was updated.16  string index_url = 1;17  // The result of the index update.18  Status status = 2;19}The gRPC cc.arduino.cli.commands.v1.Profile
 message has been removed in favor of SketchProfile
cc.arduino.cli.commands.v1.ProfileSketchProfileThe message
ProfileSketchProfileInitResponse.profile1message InitResponse {2  oneof message {3    Progress init_progress = 1;4    google.rpc.Status error = 2;5    // Selected profile information6    SketchProfile profile = 3;7  }8}The gRPC cc.arduino.cli.commands.v1.LoadSketchResponse
 message has been changed.
cc.arduino.cli.commands.v1.LoadSketchResponsePreviously the
LoadSketchResponse1message LoadSketchResponse {2  string main_file = 1;3  string location_path = 2;4  repeated string other_sketch_files = 3;5  repeated string additional_files = 4;6  repeated string root_folder_files = 5;7  string default_fqbn = 6;8  string default_port = 7;9  string default_protocol = 8;10  repeated SketchProfile profiles = 9;11  SketchProfile default_profile = 10;12}Now all the metadata have been moved into a specific
Sketch1message LoadSketchResponse {2  Sketch sketch = 1;3}4
5message Sketch {6  string main_file = 1;7  string location_path = 2;8  repeated string other_sketch_files = 3;9  repeated string additional_files = 4;10  repeated string root_folder_files = 5;11  string default_fqbn = 6;12  string default_port = 7;13  string default_protocol = 8;14  repeated SketchProfile profiles = 9;15  SketchProfile default_profile = 10;16}Drop support for builtin.tools
builtin.toolsWe're dropping the
builtin.toolsThe gRPC cc.arduino.cli.commands.v1.MonitorRequest
 message has been changed.
cc.arduino.cli.commands.v1.MonitorRequestPreviously the
MonitorRequest1message MonitorRequest {2  // Arduino Core Service instance from the `Init` response.3  Instance instance = 1;4  // Port to open, must be filled only on the first request5  Port port = 2;6  // The board FQBN we are trying to connect to. This is optional, and  it's7  // needed to disambiguate if more than one platform provides the pluggable8  // monitor for a given port protocol.9  string fqbn = 3;10  // Data to send to the port11  bytes tx_data = 4;12  // Port configuration, optional, contains settings of the port to be applied13  MonitorPortConfiguration port_configuration = 5;14}Now the meaning of the fields has been clarified with the
oneof1message MonitorRequest {2  oneof message {3    // Open request, it must be the first incoming message4    MonitorPortOpenRequest open_request = 1;5    // Data to send to the port6    bytes tx_data = 2;7    // Port configuration, contains settings of the port to be changed8    MonitorPortConfiguration updated_configuration = 3;9    // Close message, set to true to gracefully close a port (this ensure10    // that the gRPC streaming call is closed by the daemon AFTER the port11    // has been successfully closed)12    bool close = 4;13  }14}15
16message MonitorPortOpenRequest {17  // Arduino Core Service instance from the `Init` response.18  Instance instance = 1;19  // Port to open, must be filled only on the first request20  Port port = 2;21  // The board FQBN we are trying to connect to. This is optional, and  it's22  // needed to disambiguate if more than one platform provides the pluggable23  // monitor for a given port protocol.24  string fqbn = 3;25  // Port configuration, optional, contains settings of the port to be applied26  MonitorPortConfiguration port_configuration = 4;27}Now the message field
MonitorPortOpenRequest.open_requestThe identification number of the fields has been changed, this change is not binary compatible with old clients.
Some golang modules from github.com/arduino/arduino-cli/*
 have been made private.
github.com/arduino/arduino-cli/*The following golang modules are no longer available as public API:
- github.com/arduino/arduino-cli/arduino
- github.com/arduino/arduino-cli/buildcache
- github.com/arduino/arduino-cli/client_example
- github.com/arduino/arduino-cli/configuration
- github.com/arduino/arduino-cli/docsgen
- github.com/arduino/arduino-cli/executils
- github.com/arduino/arduino-cli/i18n
- github.com/arduino/arduino-cli/table
Most of the
executilsgo-pathsgithub.com/arduino/go-paths-helperCLI changed JSON output for some lib
, core
, config
, board
, and sketch
 commands.
libcoreconfigboardsketch
 results are now wrapped under- arduino-cli lib list --format json
 key- installed_libraries1{ "installed_libraries": [ {...}, {...} ] }
 results are now wrapped under- arduino-cli lib examples --format json
 key- examples1{ "examples": [ {...}, {...} ] }
 and- arduino-cli core search --format json
 results are now wrapped under- arduino-cli core list --format json
 key- platforms1{ "platforms": [ {...}, {...} ] }
 now correctly returns a json object containg the config path- arduino-cli config init --format json1{ "config_path": "/home/user/.arduino15/arduino-cli.yaml" }
 results are now wrapped under- arduino-cli config dump --format json
 key- config1{ "config": { ... } }
 results are now wrapped under- arduino-cli board search --format json
 key- boards1{ "boards": [ {...}, {...} ] }
 results are now wrapped under- arduino-cli board list --format json
 key- detected_ports1{ "detected_ports": [ {...}, {...} ] }
 now correctly returns a json object containing the sketch path- arduino-cli sketch new1{ "sketch_path": "/tmp/my_sketch" }
config dump
 no longer returns default configuration values
config dumpPreviously, the
config dumpIt now only returns the explicitly set configuration data.
Use
config get <configuration key>The gRPC response cc.arduino.cli.commands.v1.CompileResponse
 has been changed.
cc.arduino.cli.commands.v1.CompileResponseThe
CompilerResponseThe old
CompilerResponse1message CompileResponse {2  // The output of the compilation process (stream)3  bytes out_stream = 1;4  // The error output of the compilation process (stream)5  bytes err_stream = 2;6  // The compiler build path7  string build_path = 3;8  // The libraries used in the build9  repeated Library used_libraries = 4;10  // The size of the executable split by sections11  repeated ExecutableSectionSize executable_sections_size = 5;12  // The platform where the board is defined13  InstalledPlatformReference board_platform = 6;14  // The platform used for the build (if referenced from the board platform)15  InstalledPlatformReference build_platform = 7;16  // Completions reports of the compilation process (stream)17  TaskProgress progress = 8;18  // Build properties used for compiling19  repeated string build_properties = 9;20  // Compiler errors and warnings21  repeated CompileDiagnostic diagnostics = 10;22}has been split into a
CompilerResponseBuilderResult1message CompileResponse {2  oneof message {3    // The output of the compilation process (stream)4    bytes out_stream = 1;5    // The error output of the compilation process (stream)6    bytes err_stream = 2;7    // Completions reports of the compilation process (stream)8    TaskProgress progress = 3;9    // The compilation result10    BuilderResult result = 4;11  }12}13
14message BuilderResult {15  // The compiler build path16  string build_path = 1;17  // The libraries used in the build18  repeated Library used_libraries = 2;19  // The size of the executable split by sections20  repeated ExecutableSectionSize executable_sections_size = 3;21  // The platform where the board is defined22  InstalledPlatformReference board_platform = 4;23  // The platform used for the build (if referenced from the board platform)24  InstalledPlatformReference build_platform = 5;25  // Build properties used for compiling26  repeated string build_properties = 7;27  // Compiler errors and warnings28  repeated CompileDiagnostic diagnostics = 8;29}with a clear distinction on which fields are streamed.
The gRPC response cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse
 and cc.arduino.cli.commands.v1.BurnBootloaderResponse
 has been changed.
cc.arduino.cli.commands.v1.UploadUsingProgrammerResponsecc.arduino.cli.commands.v1.BurnBootloaderResponseThe old messages:
1message UploadUsingProgrammerResponse {2  // The output of the upload process.3  bytes out_stream = 1;4  // The error output of the upload process.5  bytes err_stream = 2;6}7
8message BurnBootloaderResponse {9  // The output of the burn bootloader process.10  bytes out_stream = 1;11  // The error output of the burn bootloader process.12  bytes err_stream = 2;13}now have the
oneof1message UploadUsingProgrammerResponse {2  oneof message {3    // The output of the upload process.4    bytes out_stream = 1;5    // The error output of the upload process.6    bytes err_stream = 2;7  }8}9
10message BurnBootloaderResponse {11  oneof message {12    // The output of the burn bootloader process.13    bytes out_stream = 1;14    // The error output of the burn bootloader process.15    bytes err_stream = 2;16  }17}The gRPC cc.arduino.cli.commands.v1.PlatformRelease
 has been changed.
cc.arduino.cli.commands.v1.PlatformReleaseWe've added a new field called
compatibleThe gRPC cc.arduino.cli.commands.v1.PlatformSummary
 has been changed.
cc.arduino.cli.commands.v1.PlatformSummaryWe've modified the behavior of
latest_versioncore list
 now returns only the latest version that can be installed.
core listPreviously, we showed the latest version without checking if all the dependencies were available in the current OS/ARCH. Now, the latest version will always point to an installable one even if a newer incompatible one is present.
core search
 now returns the latest installable version of a core.
core searchWe now show in the
versionn/a--format jsonarduino-cli core search --all --format jsoncore upgrade
 and core install
 will install the latest compatible version.
core upgradecore installPreviously, we'd have tried the installation/upgrade of a core even if all the required tools weren't available in the current OS/ARCH. Now we check this upfront, and allowing the installation of incompatible versions only if a user explicitly provides it like:
core install arduino:renesas_uno@1.0.2gRPC service cc.arduino.cli.settings.v1
 has been removed, and all RPC calls have been migrated to cc.arduino.cli.commands.v1
cc.arduino.cli.settings.v1cc.arduino.cli.commands.v1The service
cc.arduino.cli.settings.v1cc.arduino.cli.commands.v1Settings- rpc GetAll(GetAllRequest) returns (GetAllResponse)
- rpc Merge(MergeRequest) returns (MergeResponse)
- rpc GetValue(GetValueRequest) returns (GetValueResponse)
- rpc SetValue(SetValueRequest) returns (SetValueResponse)
- rpc Write(WriteRequest) returns (WriteResponse)
- rpc Delete(DeleteRequest) returns (DeleteResponse)
are now renamed to:
- rpc SettingsGetAll(SettingsGetAllRequest) returns (SettingsGetAllResponse)
- rpc SettingsMerge(SettingsMergeRequest) returns (SettingsMergeResponse)
- rpc SettingsGetValue(SettingsGetValueRequest) returns (SettingsGetValueResponse)
- rpc SettingsSetValue(SettingsSetValueRequest) returns (SettingsSetValueResponse)
- rpc SettingsWrite(SettingsWriteRequest) returns (SettingsWriteResponse)
- rpc SettingsDelete(SettingsDeleteRequest) returns (SettingsDeleteResponse)
gRPC cc.arduino.cli.commands.v1.LibrarySearchRequest
 message has been changed.
cc.arduino.cli.commands.v1.LibrarySearchRequestThe
querysearch_argsCLI core list
 and core search
 changed JSON output.
core listcore searchBelow is an example of the response containing an object with all possible keys set.
1[2  {3    "id": "arduino:avr",4    "maintainer": "Arduino",5    "website": "http://www.arduino.cc/",6    "email": "packages@arduino.cc",7    "indexed": true,8    "manually_installed": true,9    "deprecated": true,10    "releases": {11      "1.6.2": {12        "name": "Arduino AVR Boards",13        "version": "1.6.2",14        "type": [15          "Arduino"16        ],17        "installed": true,18        "boards": [19          {20            "name": "Arduino Robot Motor"21          }22        ],23        "help": {24          "online": "http://www.arduino.cc/en/Reference/HomePage"25        },26        "missing_metadata": true,27        "deprecated": true28      },29      "1.8.3": { ... }30    },31    "installed_version": "1.6.2",32    "latest_version": "1.8.3"33  }34]gRPC cc.arduino.cli.commands.v1.PlatformSearchResponse
 message has been changed.
cc.arduino.cli.commands.v1.PlatformSearchResponseThe old behavior was a bit misleading to the client because, to list all the available versions for each platform, we used to use the
latestPlatformSummary1message PlatformSearchResponse {2  // Results of the search.3  repeated PlatformSummary search_output = 1;4}5
6// PlatformSummary is a structure containing all the information about7// a platform and all its available releases.8message PlatformSummary {9  // Generic information about a platform10  PlatformMetadata metadata = 1;11  // Maps version to the corresponding PlatformRelease12  map<string, PlatformRelease> releases = 2;13  // The installed version of the platform, or empty string if none installed14  string installed_version = 3;15  // The latest available version of the platform, or empty if none available16  string latest_version = 4;17}The new response contains an array of
PlatformSummaryPlatformSummaryinstalled_versionlatest_versionreleases- It can be empty if no releases are found
- It can contain a single-release
- It can contain multiple releases
- If in the request we provide the 
 , the key of such release is an empty string.manually_installed=true
Removed gRPC API: cc.arduino.cli.commands.v1.PlatformList
, PlatformListRequest
, and PlatformListResponse
.
cc.arduino.cli.commands.v1.PlatformListPlatformListRequestPlatformListResponseThe following gRPC API have been removed:
 : you can use the already available gRPC method- cc.arduino.cli.commands.v1.PlatformList
 to perform the same task. Setting the- PlatformSearch
 and- all_versions=true
 in the- manually_installed=true
 returns all the data needed to produce the same result of the old api.- PlatformSearchRequest
 .- cc.arduino.cli.commands.v1.PlatformListRequest
 .- cc.arduino.cli.commands.v1.PlatformListResponse
gRPC cc.arduino.cli.commands.v1.Platform
 message has been changed.
cc.arduino.cli.commands.v1.PlatformThe old
PlatformlatestPlatformSearchResponse1// Platform is a structure containing all the information about a single2// platform release.3message Platform {4  // Generic information about a platform5  PlatformMetadata metadata = 1;6  // Information about a specific release of a platform7  PlatformRelease release = 2;8}9
10// PlatformMetadata contains generic information about a platform (not11// correlated to a specific release).12message PlatformMetadata {13  // Platform ID (e.g., `arduino:avr`).14  string id = 1;15  // Maintainer of the platform's package.16  string maintainer = 2;17  // A URL provided by the author of the platform's package, intended to point18  // to their website.19  string website = 3;20  // Email of the maintainer of the platform's package.21  string email = 4;22  // If true this Platform has been installed manually in the user' sketchbook23  // hardware folder24  bool manually_installed = 5;25  // True if the latest release of this Platform has been deprecated26  bool deprecated = 6;27  // If true the platform is indexed28  bool indexed = 7;29}30
31// PlatformRelease contains information about a specific release of a platform.32message PlatformRelease {33  // Name used to identify the platform to humans (e.g., "Arduino AVR Boards").34  string name = 1;35  // Version of the platform release36  string version = 5;37  // Type of the platform.38  repeated string type = 6;39  // True if the platform is installed40  bool installed = 7;41  // List of boards provided by the platform. If the platform is installed,42  // this is the boards listed in the platform's boards.txt. If the platform is43  // not installed, this is an arbitrary list of board names provided by the44  // platform author for display and may not match boards.txt.45  repeated Board boards = 8;46  // A URL provided by the author of the platform's package, intended to point47  // to their online help service.48  HelpResources help = 9;49  // This field is true if the platform is missing installation metadata (this50  // happens if the platform has been installed with the legacy Arduino IDE51  // <=1.8.x). If the platform miss metadata and it's not indexed through a52  // package index, it may fail to work correctly in some circumstances, and it53  // may need to be reinstalled. This should be evaluated only when the54  // PlatformRelease is `Installed` otherwise is an undefined behaviour.55  bool missing_metadata = 10;56  // True this release is deprecated57  bool deprecated = 11;58}To address all the inconsistencies/inaccuracies we introduced two messages:
 contains generic information about a platform (not correlated to a specific release).- PlatformMetadata
 contains information about a specific release of a platform.- PlatformRelease
debugging_supported
 field has been removed from gRPC cc.arduino.cli.commands.v1.BoardDetails
 and board details
 command in CLI
debugging_supportedcc.arduino.cli.commands.v1.BoardDetailsboard detailsThe
debugging_supported- the board selected
- the board option selected
- the programmer selected
the
board detailscc.arduino.cli.commands.v1.GetDebugConfig0.35.0
CLI debug --info
 changed JSON output.
debug --infoThe string field
server_configuration.scriptscripts1{2  "executable": "/tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elf",3  "toolchain": "gcc",4  "toolchain_path": "/home/user/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/",5  "toolchain_prefix": "arm-none-eabi",6  "server": "openocd",7  "server_path": "/home/user/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/bin/openocd",8  "server_configuration": {9    "path": "/home/user/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/bin/openocd",10    "scripts_dir": "/home/user/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/share/openocd/scripts/",11    "scripts": [12      "/home/user/Workspace/arduino-cli/internal/integrationtest/debug/testdata/hardware/my/samd/variants/arduino:mkr1000/openocd_scripts/arduino_zero.cfg"13    ]14  }15}gRPC cc.arduino.cli.commands.v1.GetDebugConfigResponse
 message has been changed.
cc.arduino.cli.commands.v1.GetDebugConfigResponseThe fields
toolchain_configurationserver_configurationmap<string, string>goog.protobuf.AnytoolchainserverFor the moment:
- only 
 is supported forgcc
 , and the concrete type fortoolchain
 istoolchain_configuration
 .DebugGCCToolchainConfiguration
- only 
 is supported foropenocd
 , and the concrete type forserver
 isserver_configurationDebugOpenOCDServerConfiguration
More concrete type may be added in the future as more servers/toolchains support is implemented.
gRPC service cc.arduino.cli.debug.v1
 moved to cc.arduino.cli.commands.v1
.
cc.arduino.cli.debug.v1cc.arduino.cli.commands.v1The gRPC service
cc.arduino.cli.debug.v1cc.arduino.cli.commands.v1The gRPC message
DebugConfigRequestGetDebugConfigRequestAll the generated API has been updated as well.
The gRPC cc.arduino.cli.commands.v1.BoardListWatchRequest
 command request has been changed.
cc.arduino.cli.commands.v1.BoardListWatchRequestThe gRPC message
BoardListWatchRequest1message BoardListWatchRequest {2  // Arduino Core Service instance from the `Init` response.3  Instance instance = 1;4  // Set this to true to stop the discovery process5  bool interrupt = 2;6}to
1message BoardListWatchRequest {2  // Arduino Core Service instance from the `Init` response.3  Instance instance = 1;4}The gRPC cc.arduino.cli.commands.v1.BoardListWatch
 service is now server stream only.
cc.arduino.cli.commands.v1.BoardListWatch1rpc BoardListWatch(BoardListWatchRequest)2      returns (stream BoardListWatchResponse);0.34.0
The gRPC cc.arduino.cli.commands.v1.UploadRepsonse
 command response has been changed.
cc.arduino.cli.commands.v1.UploadRepsonsePreviously the
UploadResponse1message UploadResponse {2  // The output of the upload process.3  bytes out_stream = 1;4  // The error output of the upload process.5  bytes err_stream = 2;6}Now the API logic has been clarified using the
oneofUploadResult1message UploadResponse {2  oneof message {3    // The output of the upload process.4    bytes out_stream = 1;5    // The error output of the upload process.6    bytes err_stream = 2;7    // The upload result8    UploadResult result = 3;9  }10}11
12message UploadResult {13  // When a board requires a port disconnection to perform the upload, this14  // field returns the port where the board reconnects after the upload.15  Port updated_upload_port = 1;16}golang API: method github.com/arduino/arduino-cli/commands/upload.Upload
 changed signature
github.com/arduino/arduino-cli/commands/upload.UploadThe
Upload1func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, errStream io.Writer) error { ... }to:
1func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, errStream io.Writer) (*rpc.UploadResult, error) { ... }Now an
UploadResultgolang package github.com/arduino/arduino-cli/inventory
 removed from public API
github.com/arduino/arduino-cli/inventoryThe package
inventoryboard list --watch
 command JSON output has changed
board list --watchboard list --watch1{2  "type": "add",3  "address": "COM3",4  "label": "COM3",5  "protocol": "serial",6  "protocol_label": "Serial Port (USB)",7  "hardwareId": "93B0245008567CB2",8  "properties": {9    "pid": "0x005E",10    "serialNumber": "93B0245008567CB2",11    "vid": "0x2341"12  },13  "boards": [14    {15      "name": "Arduino Nano RP2040 Connect",16      "fqbn": "arduino:mbed_nano:nanorp2040connect"17    }18  ]19}to:
1{2  "eventType": "add",3  "matching_boards": [4    {5      "name": "Arduino Nano RP2040 Connect",6      "fqbn": "arduino:mbed_nano:nanorp2040connect"7    }8  ],9  "port": {10    "address": "COM3",11    "label": "COM3",12    "protocol": "serial",13    "protocol_label": "Serial Port (USB)",14    "properties": {15      "pid": "0x005E",16      "serialNumber": "93B0245008567CB2",17      "vid": "0x2341"18    },19    "hardware_id": "93B0245008567CB2"20  }21}Updated sketch name specifications
Sketch name specifications have been updated to achieve cross-platform compatibility.
Existing sketch names violating the new constraint need to be updated.
golang API: LoadSketch
 function has been moved
LoadSketchThe function
github.com/arduino/arduino-cli/commands.LoadSketchgithub.com/arduino/arduino-cli/commands/sketch.LoadSketch0.33.0
gRPC cc.arduino.cli.commands.v1.Compile
 command now return expanded build_properties by default.
cc.arduino.cli.commands.v1.CompileThe gRPC
cc.arduino.cli.commands.v1.Compilebuild_propertiesbuild_propertiestruedo_not_expand_build_propertiesCompileRequestcompile --show-properties
 now return the expanded build properties.
compile --show-propertiesThe command
compile --show-propertiescompile --show-properties=unexpandedBefore:
1$ arduino-cli board details -b arduino:avr:uno --show-properties | grep ^tools.avrdude.path2tools.avrdude.path={runtime.tools.avrdude.path}Now:
1$ arduino-cli board details -b arduino:avr:uno --show-properties | grep ^tools.avrdude.path2tools.avrdude.path=/home/megabug/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino173$ arduino-cli board details -b arduino:avr:uno --show-properties=unexpanded | grep ^tools.avrdude.path4tools.avrdude.path={runtime.tools.avrdude.path}0.32.2
golang API: method github.com/arduino/arduino-cli/arduino/cores/Board.GetBuildProperties
 changed signature
github.com/arduino/arduino-cli/arduino/cores/Board.GetBuildPropertiesThe method:
1func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map, error) { ... }now requires a full
FQBN1func (b *Board) GetBuildProperties(fqbn *FQBN) (*properties.Map, error) { ... }Existing code may be updated from:
1b.GetBuildProperties(fqbn.Configs)to
1b.GetBuildProperties(fqbn)0.32.0
arduino-cli
 doesn't lookup anymore in the current directory for configuration file.
arduino-cliConfiguration file lookup in current working directory and its parents is dropped. The command line flag
--config-fileCommand outdated
 output change
outdatedFor
textSimilarly, for JSON and YAML formats, the command prints now a single valid object, with
platformlibraries1$ arduino-cli outdated --format json2{3  "platforms": [4    {5      "id": "arduino:avr",6      "installed": "1.6.3",7      "latest": "1.8.6",8      "name": "Arduino AVR Boards",9      ...10    }11  ],12  "libraries": [13    {14      "library": {15        "name": "USBHost",16        "author": "Arduino",17        "maintainer": "Arduino \u003cinfo@arduino.cc\u003e",18        "category": "Device Control",19        "version": "1.0.0",20        ...21      },22      "release": {23        "author": "Arduino",24        "version": "1.0.5",25        "maintainer": "Arduino \u003cinfo@arduino.cc\u003e",26        "category": "Device Control",27        ...28      }29    }30  ]31}Command compile
 does not support --vid-pid
 flag anymore
compile--vid-pidIt was a legacy and undocumented feature that is now useless. The corresponding field in gRPC
CompileRequest.vid_pidgolang API: method github.com/arduino/arduino-cli/arduino/libraries/Library.LocationPriorityFor
 removed
github.com/arduino/arduino-cli/arduino/libraries/Library.LocationPriorityForThat method was outdated and must not be used.
golang API: method github.com/arduino/arduino-cli/commands/core/GetPlatforms
 renamed
github.com/arduino/arduino-cli/commands/core/GetPlatformsThe following method in
github.com/arduino/arduino-cli/commands/core1func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) { ... }has been changed to:
1func PlatformList(req *rpc.PlatformListRequest) (*rpc.PlatformListResponse, error) { ... }now it better follows the gRPC API interface. Old code like the following:
1platforms, _ := core.GetPlatforms(&rpc.PlatformListRequest{Instance: inst})2for _, i := range platforms {3    ...4}must be changed as follows:
1// Use PlatformList function instead of GetPlatforms2platforms, _ := core.PlatformList(&rpc.PlatformListRequest{Instance: inst})3// Access installed platforms through the .InstalledPlatforms field4for _, i := range platforms.InstalledPlatforms {5    ...6}0.31.0
Added post_install
 script support for tools
post_installThe
post_installgolang API: methods in github.com/arduino/arduino-cli/arduino/cores/packagemanager
 changed signature
github.com/arduino/arduino-cli/arduino/cores/packagemanagerThe following methods in
github.com/arduino/arduino-cli/arduino/cores/packagemanager1func (pme *Explorer) InstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB) error { ... }2func (pme *Explorer) RunPostInstallScript(platformRelease *cores.PlatformRelease) error { ... }have changed.
InstallToolskipPostInstalltrueRunPostInstallScript*cores.PlatformRelease*paths.Path1func (pme *Explorer) InstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB, skipPostInstall bool) error {...}2func (pme *Explorer) RunPostInstallScript(installDir *paths.Path) error { ... }0.30.0
Sketch name validation
The sketch name submitted via the
sketch newcc.arduino.cli.commands.v1.NewSketchExisting sketch names violating the new constraint need to be updated.
daemon
 CLI command's --ip
 flag removal
daemon--ipThe
daemon--ipboard attach
 CLI command changed behaviour
board attachThe
board attachsketch.yamlThe
sketch.jsoncc.arduino.cli.commands.v1.BoardAttach
 gRPC interface command removal
cc.arduino.cli.commands.v1.BoardAttachThe
cc.arduino.cli.commands.v1.BoardAttachgolang API: methods in github.com/arduino/arduino-cli/commands/upload
 changed return type
github.com/arduino/arduino-cli/commands/uploadThe following methods in
github.com/arduino/arduino-cli/commands/upload1func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, errStream io.Writer) (*rpc.UploadResponse, error) { ... }2func UsingProgrammer(ctx context.Context, req *rpc.UploadUsingProgrammerRequest, outStream io.Writer, errStream io.Writer) (*rpc.UploadUsingProgrammerResponse, error) { ... }do not return anymore the response (because it's always empty):
1func Upload(ctx context.Context, req *rpc.UploadRequest, outStream io.Writer, errStream io.Writer) error { ... }2func UsingProgrammer(ctx context.Context, req *rpc.UploadUsingProgrammerRequest, outStream io.Writer, errStream io.Writer) error { ... }golang API: methods in github.com/arduino/arduino-cli/commands/compile
 changed signature
github.com/arduino/arduino-cli/commands/compileThe following method in
github.com/arduino/arduino-cli/commands/compile1func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream io.Writer, progressCB rpc.TaskProgressCB, debug bool) (r *rpc.CompileResponse, e error) { ... }do not require the
debug1func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream io.Writer, progressCB rpc.TaskProgressCB) (r *rpc.CompileResponse, e error) { ... }golang API: package github.com/arduino/arduino-cli/cli
 is no more public
github.com/arduino/arduino-cli/cliThe package
cligolang API change in github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManagerThe following
LibrariesManager.InstallPrerequisiteCheck1func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { ... }2func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath string, overwrite bool) error { ... }to
1func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { ... }2func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath *paths.Path, overwrite bool) error { ... }InstallPrerequisiteChecknameversionlibrariesindex.ReleaseLibraryInstallPlanTargetPathReplacedLibNameVersionUpToDateInstallZipLibarchivePathpaths.Pathstringgolang API change in github.com/arduino/arduino-cli/rduino/cores/packagemanager.Explorer
github.com/arduino/arduino-cli/rduino/cores/packagemanager.ExplorerThe
packagemanager.ExplorerFindToolsRequiredForBoard1func (pme *Explorer) FindToolsRequiredForBoard(board *cores.Board) ([]*cores.ToolRelease, error) { ... }has been renamed to `FindToolsRequiredForBuild:
1func (pme *Explorer) FindToolsRequiredForBuild(platform, buildPlatform *cores.PlatformRelease) ([]*cores.ToolRelease, error) { ... }moreover it now requires the
platformbuildPlatformboardExplorer.ResolveFQBN(...)0.29.0
Removed gRPC API: cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndex
, Outdated
, and Upgrade
cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndexOutdatedUpgradeThe following gRPC API have been removed:
 : you can use the already available gRPC methods- cc.arduino.cli.commands.v1.UpdateCoreLibrariesIndex
 and- UpdateIndex
 to perform the same tasks.- UpdateLibrariesIndex
 : you can use the already available gRPC methods- cc.arduino.cli.commands.v1.Outdated
 and- PlatformList
 to perform the same tasks.- LibraryList
 : you can use the already available gRPC methods- cc.arduino.cli.commands.v1.Upgrade
 and- PlatformUpgrade
 to perform the same tasks.- LibraryUpgrade
The golang API implementation of the same functions has been removed as well, so the following function are no more available:
1github.com/arduino/arduino-cli/commands.UpdateCoreLibrariesIndex(...)2github.com/arduino/arduino-cli/commands/outdated.Outdated(...)3github.com/arduino/arduino-cli/commands/upgrade.Upgrade(...)you can use the following functions as a replacement to do the same tasks:
1github.com/arduino/arduino-cli/commands.UpdateLibrariesIndex(...)2github.com/arduino/arduino-cli/commands.UpdateIndex(...)3github.com/arduino/arduino-cli/commands/core.GetPlatforms(...)4github.com/arduino/arduino-cli/commands/lib.LibraryList(...)5github.com/arduino/arduino-cli/commands/lib.LibraryUpgrade(...)6github.com/arduino/arduino-cli/commands/lib.LibraryUpgradeAll(...)7github.com/arduino/arduino-cli/commands/core.PlatformUpgrade(...)Changes in golang functions github.com/arduino/arduino-cli/cli/instance.Init
 and InitWithProfile
github.com/arduino/arduino-cli/cli/instance.InitInitWithProfileThe following functions:
1func Init(instance *rpc.Instance) []error { }2func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *paths.Path) (*rpc.Profile, []error) { }no longer return the errors array:
1func Init(instance *rpc.Instance) { }2func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *paths.Path) *rpc.Profile { }The errors are automatically sent to output via
feedbackInit*0.28.0
Breaking changes in libraries name handling
In the structure
github.com/arduino/arduino-cli/arduino/libraries.Library
 has been renamed to- RealName- Name
 has been renamed to- Name- DirName
Now
Namelibrary.propertiesDirNameDirNameThis change improves the overall code base naming coherence since all the structures involving libraries have the
Namelibrary.propertiesgRPC message cc.arduino.cli.commands.v1.Library
 no longer has real_name
 field
cc.arduino.cli.commands.v1.Libraryreal_nameYou must use the
nameMachine readable lib list
 output no longer has "real name" field
lib listJSON
The
[*].library.real_nameYou must use the
[*].library.nameYAML
The
[*].library.realnameYou must use the
[*].library.namegithub.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.Install
 removed parameter installLocation
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.InstallinstallLocationThe method:
1func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { ... }no more needs the
installLocation1func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { ... }The install location is determined from the libPath.
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.FindByReference
 now returns a list of libraries.
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.FindByReferenceThe method:
1func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { ... }has been changed to:
1func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) libraries.List { ... }the method now returns all the libraries matching the criteria and not just the first one.
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibraryAlternatives
 removed
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibraryAlternativesThe structure
librariesmanager.LibraryAlternativeslibraries.ListBreaking changes in UpdateIndex API (both gRPC and go-lang)
The gRPC message
cc.arduino.cli.commands.v1.DownloadProgress1message DownloadProgress {2  // URL of the download.3  string url = 1;4  // The file being downloaded.5  string file = 2;6  // Total size of the file being downloaded.7  int64 total_size = 3;8  // Size of the downloaded portion of the file.9  int64 downloaded = 4;10  // Whether the download is complete.11  bool completed = 5;12}to
1message DownloadProgress {2  oneof message {3    DownloadProgressStart start = 1;4    DownloadProgressUpdate update = 2;5    DownloadProgressEnd end = 3;6  }7}8
9message DownloadProgressStart {10  // URL of the download.11  string url = 1;12  // The label to display on the progress bar.13  string label = 2;14}15
16message DownloadProgressUpdate {17  // Size of the downloaded portion of the file.18  int64 downloaded = 1;19  // Total size of the file being downloaded.20  int64 total_size = 2;21}22
23message DownloadProgressEnd {24  // True if the download is successful25  bool success = 1;26  // Info or error message, depending on the value of 'success'. Some examples:27  // "File xxx already downloaded" or "Connection timeout"28  string message = 2;29}The new message format allows a better handling of the progress update reports on downloads. Every download now will report a sequence of message as follows:
1DownloadProgressStart{url="https://...", label="Downloading package index..."}2DownloadProgressUpdate{downloaded=0, total_size=103928}3DownloadProgressUpdate{downloaded=29380, total_size=103928}4DownloadProgressUpdate{downloaded=69540, total_size=103928}5DownloadProgressEnd{success=true, message=""}or if an error occurs:
1DownloadProgressStart{url="https://...", label="Downloading package index..."}2DownloadProgressUpdate{downloaded=0, total_size=103928}3DownloadProgressEnd{success=false, message="Server closed connection"}or if the file is already cached:
1DownloadProgressStart{url="https://...", label="Downloading package index..."}2DownloadProgressEnd{success=true, message="Index already downloaded"}About the go-lang API the following functions in
github.com/arduino/arduino-cli/commands1func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rpc.DownloadProgressCB) (*rpc.UpdateIndexResponse, error) { ... }have changed their signature to:
1func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rpc.DownloadProgressCB, downloadResultCB rpc.DownloadResultCB) error { ... }UpdateIndexUpdateIndexResponse0.27.0
Breaking changes in golang API github.com/arduino/arduino-cli/arduino/cores/packagemanager.PackageManager
github.com/arduino/arduino-cli/arduino/cores/packagemanager.PackageManagerThe
PackageManagerPackageManager- the methods that query the 
 without changing its internal state, have been moved into the newPackageManager
 objectExplorer
- the methods that change the 
 internal state, have been moved into the newPackageManager
 object.Builder
The
BuilderPackageManagerNewPackageManagerPackageManagerLoadHardware*NewBuilderBuilderLoadHardware*Builder.Build()PackageManagerPreviously we did:
1pm := packagemanager.NewPackageManager(...)2err = pm.LoadHardware()3err = pm.LoadHardwareFromDirectories(...)4err = pm.LoadHardwareFromDirectory(...)5err = pm.LoadToolsFromPackageDir(...)6err = pm.LoadToolsFromBundleDirectories(...)7err = pm.LoadToolsFromBundleDirectory(...)8pack = pm.GetOrCreatePackage("packagername")9// ...use `pack` to tweak or load more hardware...10err = pm.LoadPackageIndex(...)11err = pm.LoadPackageIndexFromFile(...)12err = pm.LoadHardwareForProfile(...)13
14// ...use `pm` to implement business logic...Now we must do:
1var pm *packagemanager.PackageManager2
3{4    pmb := packagemanager.Newbuilder(...)5    err = pmb.LoadHardware()6    err = pmb.LoadHardwareFromDirectories(...)7    err = pmb.LoadHardwareFromDirectory(...)8    err = pmb.LoadToolsFromPackageDir(...)9    err = pmb.LoadToolsFromBundleDirectories(...)10    err = pmb.LoadToolsFromBundleDirectory(...)11    pack = pmb.GetOrCreatePackage("packagername")12    // ...use `pack` to tweak or load more hardware...13    err = pmb.LoadPackageIndex(...)14    err = pmb.LoadPackageIndexFromFile(...)15    err = pmb.LoadHardwareForProfile(...)16    pm = pmb.Build()17}18
19// ...use `pm` to implement business logic...It's not mandatory but highly recommended, to drop the
BuilderPackageManagerpmbTo query the
PackagerManagerExplorerPackageManager.NewExplorer()Previously we did:
1func DoStuff(pm *packagemanager.PackageManager, ...) {2    // ...implement business logic through PackageManager methods...3    ... := pm.Packages4    ... := pm.CustomGlobalProperties5    ... := pm.FindPlatform(...)6    ... := pm.FindPlatformRelease(...)7    ... := pm.FindPlatformReleaseDependencies(...)8    ... := pm.DownloadToolRelease(...)9    ... := pm.DownloadPlatformRelease(...)10    ... := pm.IdentifyBoard(...)11    ... := pm.DownloadAndInstallPlatformUpgrades(...)12    ... := pm.DownloadAndInstallPlatformAndTools(...)13    ... := pm.InstallPlatform(...)14    ... := pm.InstallPlatformInDirectory(...)15    ... := pm.RunPostInstallScript(...)16    ... := pm.IsManagedPlatformRelease(...)17    ... := pm.UninstallPlatform(...)18    ... := pm.InstallTool(...)19    ... := pm.IsManagedToolRelease(...)20    ... := pm.UninstallTool(...)21    ... := pm.IsToolRequired(...)22    ... := pm.LoadDiscoveries(...)23    ... := pm.GetProfile(...)24    ... := pm.GetEnvVarsForSpawnedProcess(...)25    ... := pm.DiscoveryManager(...)26    ... := pm.FindPlatformReleaseProvidingBoardsWithVidPid(...)27    ... := pm.FindBoardsWithVidPid(...)28    ... := pm.FindBoardsWithID(...)29    ... := pm.FindBoardWithFQBN(...)30    ... := pm.ResolveFQBN(...)31    ... := pm.Package(...)32    ... := pm.GetInstalledPlatformRelease(...)33    ... := pm.GetAllInstalledToolsReleases(...)34    ... := pm.InstalledPlatformReleases(...)35    ... := pm.InstalledBoards(...)36    ... := pm.FindToolsRequiredFromPlatformRelease(...)37    ... := pm.GetTool(...)38    ... := pm.FindToolsRequiredForBoard(...)39    ... := pm.FindToolDependency(...)40    ... := pm.FindDiscoveryDependency(...)41    ... := pm.FindMonitorDependency(...)42}Now we must obtain the
Explorerrelease1func DoStuff(pm *packagemanager.PackageManager, ...) {2    pme, release := pm.NewExplorer()3    defer release()4
5    ... := pme.GetPackages()6    ... := pme.GetCustomGlobalProperties()7    ... := pme.FindPlatform(...)8    ... := pme.FindPlatformRelease(...)9    ... := pme.FindPlatformReleaseDependencies(...)10    ... := pme.DownloadToolRelease(...)11    ... := pme.DownloadPlatformRelease(...)12    ... := pme.IdentifyBoard(...)13    ... := pme.DownloadAndInstallPlatformUpgrades(...)14    ... := pme.DownloadAndInstallPlatformAndTools(...)15    ... := pme.InstallPlatform(...)16    ... := pme.InstallPlatformInDirectory(...)17    ... := pme.RunPostInstallScript(...)18    ... := pme.IsManagedPlatformRelease(...)19    ... := pme.UninstallPlatform(...)20    ... := pme.InstallTool(...)21    ... := pme.IsManagedToolRelease(...)22    ... := pme.UninstallTool(...)23    ... := pme.IsToolRequired(...)24    ... := pme.LoadDiscoveries(...)25    ... := pme.GetProfile(...)26    ... := pme.GetEnvVarsForSpawnedProcess(...)27    ... := pme.DiscoveryManager(...)28    ... := pme.FindPlatformReleaseProvidingBoardsWithVidPid(...)29    ... := pme.FindBoardsWithVidPid(...)30    ... := pme.FindBoardsWithID(...)31    ... := pme.FindBoardWithFQBN(...)32    ... := pme.ResolveFQBN(...)33    ... := pme.Package(...)34    ... := pme.GetInstalledPlatformRelease(...)35    ... := pme.GetAllInstalledToolsReleases(...)36    ... := pme.InstalledPlatformReleases(...)37    ... := pme.InstalledBoards(...)38    ... := pme.FindToolsRequiredFromPlatformRelease(...)39    ... := pme.GetTool(...)40    ... := pme.FindToolsRequiredForBoard(...)41    ... := pme.FindToolDependency(...)42    ... := pme.FindDiscoveryDependency(...)43    ... := pme.FindMonitorDependency(...)44}The
ExplorerPackageManagerreleasePackageManagerThe
PackageManager.Clean()- PackageManager.NewBuilder() (*Builder, commit func())
- Builder.BuildIntoExistingPackageManager(target *PackageManager)
Previously, to update a
PackageManager1func Reload(pm *packagemanager.PackageManager) {2    pm.Clear()3    ... = pm.LoadHardware(...)4    // ...other pm.Load* calls...5}now we have two options:
1func Reload(pm *packagemanager.PackageManager) {2    // Create a new builder and build a package manager3    pmb := packagemanager.NewBuilder(.../* config params */)4    ... = pmb.LoadHardware(...)5    // ...other pmb.Load* calls...6
7    // apply the changes to the original pm8    pmb.BuildIntoExistingPackageManager(pm)9}in this case, we create a new
BuilderBuildIntoExistingPackageManager1func Reload(pm *packagemanager.PackageManager) {2    // Create a new builder using the same config params3    // as the original package manager4    pmb, commit := pm.NewBuilder()5
6    // build the new package manager7    ... = pmb.LoadHardware(...)8    // ...other pmb.Load* calls...9
10    // apply the changes to the original pm11    commit()12}In this case, we don't even need to bother to provide the configuration parameters because they are taken from the previous
PackageManagerSome gRPC-mapped methods now accepts the gRPC request instead of the instance ID as parameter
The following methods in subpackages of
github.com/arduino/arduino-cli/commands/*1func Watch(instanceID int32) (<-chan *rpc.BoardListWatchResponse, func(), error) { ... }2func LibraryUpgradeAll(instanceID int32, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error { ... }3func LibraryUpgrade(instanceID int32, libraryNames []string, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error { ... }have been changed to:
1func Watch(req *rpc.BoardListWatchRequest) (<-chan *rpc.BoardListWatchResponse, func(), error) { ... }2func LibraryUpgradeAll(req *rpc.LibraryUpgradeAllRequest, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error { ... }3func LibraryUpgrade(ctx context.Context, req *rpc.LibraryUpgradeRequest, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error { ... }The following methods in package
github.com/arduino/arduino-cli/commands1func GetInstance(id int32) *CoreInstance { ... }2func GetPackageManager(id int32) *packagemanager.PackageManager { ... }3func GetLibraryManager(instanceID int32) *librariesmanager.LibrariesManager { ... }have been changed to:
1func GetPackageManager(instance rpc.InstanceCommand) *packagemanager.PackageManager { ... } // Deprecated2func GetPackageManagerExplorer(req rpc.InstanceCommand) (explorer *packagemanager.Explorer, release func()) { ... }3func GetLibraryManager(req rpc.InstanceCommand) *librariesmanager.LibrariesManager { ... }Old code passing the
instanceID1eventsChan, closeWatcher, err := board.Watch(req.Instance.Id)must be changed to:
1eventsChan, closeWatcher, err := board.Watch(req)Removed detection of Arduino IDE bundling
Arduino CLI does not check anymore if it's bundled with the Arduino IDE 1.x. Previously this check allowed the Arduino CLI to automatically use the libraries and tools bundled in the Arduino IDE, now this is not supported anymore unless the configuration keys
directories.builtin.librariesdirectories.builtin.toolsgRPC enumeration renamed enum value in cc.arduino.cli.commands.v1.LibraryLocation
cc.arduino.cli.commands.v1.LibraryLocationLIBRARY_LOCATION_IDE_BUILTINLIBRARY_LOCATION_BUILTINgo-lang API change in LibraryManager
LibraryManagerThe following methods:
1func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release) (*paths.Path, *libraries.Library, error) { ... }2func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { ... ]3func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { ... }4func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference) *libraries.Library { ... }now requires a new parameter
LibraryLocation1func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { ... }2func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { ... ]3func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { ... }4+func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { ... }If you're not interested in specifying the
LibraryLocationlibraries.Usergo-lang functions changes in github.com/arduino/arduino-cli/configuration
github.com/arduino/arduino-cli/configuration
 function has been removed.- github.com/arduino/arduino-cli/configuration.IsBundledInDesktopIDE
 has been renamed to- github.com/arduino/arduino-cli/configuration.BundleToolsDirectories- BuiltinToolsDirectories
 has been renamed to- github.com/arduino/arduino-cli/configuration.IDEBundledLibrariesDir- IDEBuiltinLibrariesDir
Removed utils.FeedStreamTo
 and utils.ConsumeStreamFrom
utils.FeedStreamToutils.ConsumeStreamFromgithub.com/arduino/arduino-cli/arduino/utils.FeedStreamTogithub.com/arduino/arduino-cli/arduino/utils.ConsumeStreamFrom0.26.0
github.com/arduino/arduino-cli/commands.DownloadToolRelease
, and InstallToolRelease
 functions have been removed
github.com/arduino/arduino-cli/commands.DownloadToolReleaseInstallToolReleaseThis functionality was duplicated and already available via
PackageManagergithub.com/arduino/arduino-cli/commands.Outdated
 and Upgrade
 functions have been moved
github.com/arduino/arduino-cli/commands.OutdatedUpgrade
 is now- github.com/arduino/arduino-cli/commands.Outdated- github.com/arduino/arduino-cli/commands/outdated.Outdated
 is now- github.com/arduino/arduino-cli/commands.Upgrade- github.com/arduino/arduino-cli/commands/upgrade.Upgrade
Old code must change the imports accordingly.
github.com/arduino-cli/arduino/cores/packagemanager.PackageManager
 methods and fields change
github.com/arduino-cli/arduino/cores/packagemanager.PackageManager- The 
 and- PackageManager.Log
 fields are now private.- TempDir
- The 
 method has no more the- PackageManager.DownloadToolRelease
 parameter:- label1func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error {- has been changed to: 1func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, progressCB rpc.DownloadProgressCB) error {- Old code should remove the 
 parameter.- label
- The 
 ,- PackageManager.UninstallPlatform
 , and- PackageManager.InstallTool
 methods now requires a- PackageManager.UninstallTool- github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.TaskProgressCB1func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelease) error {2func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease) error {3func (pm *PackageManager) UninstallTool(toolRelease *cores.ToolRelease) error {- have been changed to: 1func (pm *PackageManager) UninstallPlatform(platformRelease *cores.PlatformRelease, taskCB rpc.TaskProgressCB) error {2func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB) error {3func (pm *PackageManager) UninstallTool(toolRelease *cores.ToolRelease, taskCB rpc.TaskProgressCB) error {- If you're not interested in getting the task events you can pass an empty callback function. 
0.25.0
go-lang function github.com/arduino/arduino-cli/arduino/utils.FeedStreamTo
 has been changed
github.com/arduino/arduino-cli/arduino/utils.FeedStreamToThe function
FeedStreamTo1func FeedStreamTo(writer func(data []byte)) io.Writerto
1func FeedStreamTo(writer func(data []byte)) (io.WriteCloser, context.Context)The user must call the
Closeio.WriteCloseDone()0.24.0
gRPC Monitor
 service and related gRPC calls have been removed
MonitorThe gRPC
MonitorMonitor.StreamingOpenCommands
 : open a monitor connection to a communication port.- Commands.Monitor
 : enumerate the possible configurations parameters for a communication port.- Commands.EnumerateMonitorPortSettings
Please refer to the official documentation and the reference client implementation for details on how to use the new API.
https://arduino.github.io/arduino-cli/dev/rpc/commands/#monitorrequest https://arduino.github.io/arduino-cli/dev/rpc/commands/#monitorresponse https://arduino.github.io/arduino-cli/dev/rpc/commands/#enumeratemonitorportsettingsrequest https://arduino.github.io/arduino-cli/dev/rpc/commands/#enumeratemonitorportsettingsresponse
0.23.0
Arduino IDE builtin libraries are now excluded from the build when running arduino-cli
 standalone
arduino-cliPreviously the "builtin libraries" in the Arduino IDE 1.8.x were always included in the build process. This wasn't the intended behaviour,
arduino-cliIf a compilation fail for a missing bundled library, you can fix it just by installing the missing library from the library manager as usual.
gRPC: Changes in message cc.arduino.cli.commands.v1.PlatformReference
cc.arduino.cli.commands.v1.PlatformReferenceThe gRPC message structure
cc.arduino.cli.commands.v1.PlatformReferencecc.arduino.cli.commands.v1.InstalledPlatformReference
 is the installation directory of the platform- install_dir
 is the 3rd party platform URL of the platform- package_url
It is currently used only in
cc.arduino.cli.commands.v1.CompileResponsegolang API: github.com/arduino/arduino-cli/cli/globals.DefaultIndexURL
 has been moved under github.com/arduino/arduino-cli/arduino/globals
github.com/arduino/arduino-cli/cli/globals.DefaultIndexURLgithub.com/arduino/arduino-cli/arduino/globalsLegacy code should just update the import.
golang API: PackageManager.DownloadPlatformRelease no longer need label
 parameter
label1func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error {is now:
1func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, progressCB rpc.DownloadProgressCB) error {Just remove the
label0.22.0
github.com/arduino/arduino-cli/arduino.MultipleBoardsDetectedError
 field changed type
github.com/arduino/arduino-cli/arduino.MultipleBoardsDetectedErrorNow the
Portgithub.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.Portrpc.Portdiscovery.Port.ToRPC()Function github.com/arduino/arduino-cli/commands/upload.DetectConnectedBoard(...)
 has been removed
github.com/arduino/arduino-cli/commands/upload.DetectConnectedBoard(...)Use
github.com/arduino/arduino-cli/commands/board.List(...)Function arguments.GetDiscoveryPort(...)
 has been removed
arguments.GetDiscoveryPort(...)NOTE: the functions in the
argumentsarduino-cliinternalThe old function:
1func (p *Port) GetDiscoveryPort(instance *rpc.Instance, sk *sketch.Sketch) *discovery.Port { }is now replaced by the more powerful:
1func (p *Port) DetectFQBN(inst *rpc.Instance) (string, *rpc.Port) { }2
3func CalculateFQBNAndPort(portArgs *Port, fqbnArg *Fqbn, instance *rpc.Instance, sk *sketch.Sketch) (string, *rpc.Port) { }gRPC: address
 parameter has been removed from commands.SupportedUserFieldsRequest
addresscommands.SupportedUserFieldsRequestThe parameter is no more needed. Lagacy code will continue to work without modification (the value of the parameter will be just ignored).
The content of package github.com/arduino/arduino-cli/httpclient
 has been moved to a different path
github.com/arduino/arduino-cli/httpclientIn particular:
 and- UserAgent
 have been moved to- NetworkProxy- github.com/arduino/arduino-cli/configuration
- the remainder of the package 
 has been moved togithub.com/arduino/arduino-cli/httpclientgithub.com/arduino/arduino-cli/arduino/httpclient
The old imports must be updated according to the list above.
commands.DownloadProgressCB
 and commands.TaskProgressCB
 have been moved to package github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1
commands.DownloadProgressCBcommands.TaskProgressCBgithub.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1All references to these types must be updated with the new import.
commands.GetDownloaderConfig
 has been moved to package github.com/arduino/arduino-cli/arduino/httpclient
commands.GetDownloaderConfiggithub.com/arduino/arduino-cli/arduino/httpclientAll references to this function must be updated with the new import.
commands.Download
 has been removed and replaced by github.com/arduino/arduino-cli/arduino/httpclient.DownloadFile
commands.Downloadgithub.com/arduino/arduino-cli/arduino/httpclient.DownloadFileThe old function must be replaced by the new one that is much more versatile.
packagemanager.PackageManager.DownloadToolRelease
, packagemanager.PackageManager.DownloadPlatformRelease
, and resources.DownloadResource.Download
 functions change signature and behaviour
packagemanager.PackageManager.DownloadToolReleasepackagemanager.PackageManager.DownloadPlatformReleaseresources.DownloadResource.DownloadThe following functions:
1func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config) (*downloader.Downloader, error)2func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config) (*downloader.Downloader, error)3func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config) (*downloader.Downloader, error)now requires a label and a progress callback parameter, do not return the
Downloader1func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error2func (pm *PackageManager) DownloadPlatformRelease(platform *cores.PlatformRelease, config *downloader.Config, label string, progressCB rpc.DownloadProgressCB) error3func (r *DownloadResource) Download(downloadDir *paths.Path, config *downloader.Config, label string, downloadCB rpc.DownloadProgressCB) errorThe new progress parameters must be added to legacy code, if progress reports are not needed an empty stub for
labelprogressCBdownloader.Run()downloader.RunAndPoll(...)For example, the old legacy code like:
1downloader, err := pm.DownloadPlatformRelease(platformToDownload, config)2if err != nil {3    ...4}5if err := downloader.Run(); err != nil {6    ...7}may be ported to the new version as:
1err := pm.DownloadPlatformRelease(platformToDownload, config, "", func(progress *rpc.DownloadProgress) {})packagemanager.Load*
 functions now returns error
 instead of *status.Status
packagemanager.Load*error*status.StatusThe following functions signature:
1func (pm *PackageManager) LoadHardware() []*status.Status { ... }2func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathList) []*status.Status { ... }3func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []*status.Status { ... }4func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) []*status.Status { ... }5func (pm *PackageManager) LoadDiscoveries() []*status.Status { ... }have been changed to:
1func (pm *PackageManager) LoadHardware() []error { ... }2func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathList) []error { ... }3func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error { ... }4func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) []error { ... }5func (pm *PackageManager) LoadDiscoveries() []error { ... }These function no longer returns a gRPC status, so the errors can be handled as any other
errorRemoved error
 return from discovery.New(...)
 function
errordiscovery.New(...)The
discovery.New(...)1func New(id string, args ...string) (*PluggableDiscovery, error) { ... }is now:
1func New(id string, args ...string) *PluggableDiscovery { ... }0.21.0
packagemanager.NewPackageManager
 function change
packagemanager.NewPackageManagerA new argument
userAgentpackagemanager.NewPackageManager1func NewPackageManager(indexDir, packagesDir, downloadDir, tempDir *paths.Path, userAgent string) *PackageManager {The userAgent string must be in the format
"ProgramName/Version""arduino-cli/0.20.1"commands.Create
 function change
commands.CreateA new argument
extraUserAgentcommands.Create1func Create(req *rpc.CreateRequest, extraUserAgent ...string) (*rpc.CreateResponse, error) {extraUserAgent"ProgramName/Version""arduino-cli/0.20.1"commands.Compile
 function change
commands.CompileA new argument
progressCBcommands.Compile1func Compile(2    ctx context.Context,3    req *rpc.CompileRequest,4    outStream, errStream io.Writer,5    progressCB commands.TaskProgressCB,6    debug bool7) (r *rpc.CompileResponse, e error) {if a callback function is provided the
Compilenilgithub.com/arduino/arduino-cli/cli/arguments.ParseReferences
 function change
github.com/arduino/arduino-cli/cli/arguments.ParseReferencesThe
parseArchgithub.com/arduino/arduino-cli/cli/arguments.ParseReference
 function change
github.com/arduino/arduino-cli/cli/arguments.ParseReferenceThe
parseArchpackager:archgithub.com/arduino/arduino-cli/executils.NewProcess
 and executils.NewProcessFromPath
 function change
github.com/arduino/arduino-cli/executils.NewProcessexecutils.NewProcessFromPathA new argument
extraEnvexecutils.NewProcessexecutils.NewProcessFromPath1func NewProcess(extraEnv []string, args ...string) (*Process, error) {1func NewProcessFromPath(extraEnv []string, executable *paths.Path, args ...string) (*Process, error) {The
extraEnvgithub.com/arduino/arduino-cli/i18n.Init(...)
 now requires an empty string to be passed for autodetection of locale
github.com/arduino/arduino-cli/i18n.Init(...)For automated detection of locale, change the call from:
1i18n.Init()to
1i18n.Init("")github.com/arduino/arduino-cli/legacy/i18n
 module has been removed (in particular the i18n.Logger
)
github.com/arduino/arduino-cli/legacy/i18ni18n.LoggerThe
i18n.LoggerContext.LoggerThe
Context.Loggerio.WriterContex.StdoutContext.Stderr{0} {1}...StdoutStderr0.20.0
board details
 arguments change
board detailsThe
board details--fqbn-bThe previously deprecated
board details <FQBN>board attach
 arguments change
board attachThe
board attach--port-p--board-bThe previous syntax
board attach <port>|<FQBN> [sketchPath]--timeout
 flag in board list
 command has been replaced by --discovery-timeout
--timeoutboard list--discovery-timeoutThe flag
--timeoutboard list0.19.0
board list
 command JSON output change
board listThe
board list1$ arduino-cli board list --format json2[3  {4    "address": "/dev/ttyACM1",5    "protocol": "serial",6    "protocol_label": "Serial Port (USB)",7    "boards": [8      {9        "name": "Arduino Uno",10        "fqbn": "arduino:avr:uno",11        "vid": "0x2341",12        "pid": "0x0043"13      }14    ],15    "serial_number": "954323132383515092E1"16  }17]to:
1$ arduino-cli board list --format json2[3  {4    "matching_boards": [5      {6        "name": "Arduino Uno",7        "fqbn": "arduino:avr:uno"8      }9    ],10    "port": {11      "address": "/dev/ttyACM1",12      "label": "/dev/ttyACM1",13      "protocol": "serial",14      "protocol_label": "Serial Port (USB)",15      "properties": {16        "pid": "0x0043",17        "serialNumber": "954323132383515092E1",18        "vid": "0x2341"19      }20    }21  }22]The
boardsmatching_boardsnamefqbnpropertiespidvidpropertiesserial_numberserialNumberpropertieslabelportgRPC interface DebugConfigRequest
, UploadRequest
, UploadUsingProgrammerRequest
, BurnBootloaderRequest
, DetectedPort
 field changes
DebugConfigRequestUploadRequestUploadUsingProgrammerRequestBurnBootloaderRequestDetectedPortDebugConfigRequestUploadRequestUploadUsingProgrammerRequestBurnBootloaderRequestportstringPortPort1// Port represents a board port that may be used to upload or to monitor a board2message Port {3  // Address of the port (e.g., `/dev/ttyACM0`).4  string address = 1;5  // The port label to show on the GUI (e.g. "ttyACM0")6  string label = 2;7  // Protocol of the port (e.g., `serial`, `network`, ...).8  string protocol = 3;9  // A human friendly description of the protocol (e.g., "Serial Port (USB)"10  string protocol_label = 4;11  // A set of properties of the port12  map<string, string> properties = 5;13}The gRPC interface message
DetectedPort1message DetectedPort {2  // Address of the port (e.g., `serial:///dev/ttyACM0`).3  string address = 1;4  // Protocol of the port (e.g., `serial`).5  string protocol = 2;6  // A human friendly description of the protocol (e.g., "Serial Port (USB)").7  string protocol_label = 3;8  // The boards attached to the port.9  repeated BoardListItem boards = 4;10  // Serial number of connected board11  string serial_number = 5;12}to:
1message DetectedPort {2  // The possible boards attached to the port.3  repeated BoardListItem matching_boards = 1;4  // The port details5  Port port = 2;6}The properties previously contained directly in the message are now stored in the
portThese changes are necessary for the pluggable discovery.
gRPC interface BoardListItem
 change
BoardListItemThe
vidpidBoardListItemportDetectedPortChange public library interface
github.com/arduino/arduino-cli/i18n
 package
github.com/arduino/arduino-cli/i18nThe behavior of the
Initgithub.com/arduino/arduino-cli/configurationInit1i18n.Init("it")Omit the argument for automated locale detection:
1i18n.Init()github.com/arduino/arduino-cli/arduino/builder
 package
github.com/arduino/arduino-cli/arduino/builderGenBuildPath()github.com/arduino/arduino-cli/arduino/sketchEnsureBuildPathExistsgithub.com/arduino/go-paths-helper.MkDirAll()SketchSaveItemCpppath string, contents []byte, destPath stringpath *paths.Path, contents []byte, destPath *paths.Pathpathsgithub.com/arduino/go-paths-helperSketchLoadNewgithub.com/arduino/arduino-cli/arduino/sketch1-      SketchLoad("/some/path", "")2+      sketch.New(paths.New("some/path))3}If you need to set a custom build path you must instead set it after creating the Sketch.
1-      SketchLoad("/some/path", "/my/build/path")2+      s, err := sketch.New(paths.New("some/path))3+      s.BuildPath = paths.new("/my/build/path")4}SketchCopyAdditionalFilessketch *sketch.Sketch, destPath string, overrides map[string]stringsketch *sketch.Sketch, destPath *paths.Path, overrides map[string]stringgithub.com/arduino/arduino-cli/arduino/sketch
 package
github.com/arduino/arduino-cli/arduino/sketchItemgo-paths-helper.PathNewItemgo-paths-helper.NewGetSourceBytesgo-paths-helper.Path.ReadFileGetSourceStr1-      s, err := item.GetSourceStr()2+      data, err := file.ReadFile()3+      s := string(data)4}ItemByPathgo-paths-helper.PathListSketch.LocationPathFullPathstringgo-paths-helper.PathSketch.MainFile*Itemgo-paths-helper.PathSketch.OtherSketchFilesSketch.AdditionalFilesSketch.RootFolderFiles[]*Itemgo-paths-helper.PathListNewsketchFolderPath, mainFilePath, buildPath string, allFilesPaths []stringpath *go-paths-helper.PathCheckSketchCasingNewInvalidSketchFoldernameErrorInvalidSketchFolderNameErrorgithub.com/arduino/arduino-cli/arduino/sketches
 package
github.com/arduino/arduino-cli/arduino/sketchesSketchsketch.SketchMetadataBoardMetadatagithub.com/arduino/arduino-cli/arduino/sketchNewSketchFromPathsketch.NewImportMetadatasketch.NewExportMetadatagithub.com/arduino/arduino-cli/arduino/sketchBuildPathsketch.Sketch.BuildPathCheckForPdeFilesgithub.com/arduino/arduino-cli/arduino/sketchgithub.com/arduino/arduino-cli/legacy/builder/types
 package
github.com/arduino/arduino-cli/legacy/builder/typesSketchsketch.SketchSketchToLegacySketchFromLegacyContext.SketchSketchsketch.SketchChange in board details
 response (gRPC and JSON output)
board detailsThe
board details1$ arduino-cli board details arduino:samd:mkr10002Board name:                Arduino MKR10003FQBN:                      arduino:samd:mkr10004Board version:             1.8.115Debugging supported:       ✔6
7Official Arduino board:    ✔8
9Identification properties: VID:0x2341 PID:0x824e10                           VID:0x2341 PID:0x024e11                           VID:0x2341 PID:0x804e12                           VID:0x2341 PID:0x004e13[...]14
15$ arduino-cli board details arduino:samd:mkr1000 --format json16[...]17  "identification_prefs": [18    {19      "usb_id": {20        "vid": "0x2341",21        "pid": "0x804e"22      }23    },24    {25      "usb_id": {26        "vid": "0x2341",27        "pid": "0x004e"28      }29    },30    {31      "usb_id": {32        "vid": "0x2341",33        "pid": "0x824e"34      }35    },36    {37      "usb_id": {38        "vid": "0x2341",39        "pid": "0x024e"40      }41    }42  ],43[...]now the properties have been renamed from
identification_prefsidentification_properties1$ arduino-cli board details arduino:samd:mkr10002Board name:                Arduino MKR10003FQBN:                      arduino:samd:mkr10004Board version:             1.8.115Debugging supported:       ✔6
7Official Arduino board:    ✔8
9Identification properties: vid=0x234110                           pid=0x804e11
12Identification properties: vid=0x234113                           pid=0x004e14
15Identification properties: vid=0x234116                           pid=0x824e17
18Identification properties: vid=0x234119                           pid=0x024e20[...]21
22$ arduino-cli board details arduino:samd:mkr1000 --format json23[...]24  "identification_properties": [25    {26      "properties": {27        "pid": "0x804e",28        "vid": "0x2341"29      }30    },31    {32      "properties": {33        "pid": "0x004e",34        "vid": "0x2341"35      }36    },37    {38      "properties": {39        "pid": "0x824e",40        "vid": "0x2341"41      }42    },43    {44      "properties": {45        "pid": "0x024e",46        "vid": "0x2341"47      }48    }49  ]50}Change of behaviour of gRPC Init
 function
InitPreviously the
InitCoreInstance*_index.jsonNow the initialization phase is split into two, first the client must create a new
CoreInstanceCreate- create all folders necessary to correctly run the CLI if not already existing
- create and return a new CoreInstance
The
CreateThe returned instance is relatively unusable since no library and no platform is loaded, some functions that don't need that information can still be called though.
The
InitAlso the option
library_manager_onlyThe
InitPreviously a client would call the function like so:
1const initReq = new InitRequest()2initReq.setLibraryManagerOnly(false)3const initResp = await new Promise<InitResponse>((resolve, reject) => {4  let resp: InitResponse | undefined = undefined5  const stream = client.init(initReq)6  stream.on("data", (data: InitResponse) => (resp = data))7  stream.on("end", () => resolve(resp!))8  stream.on("error", (err) => reject(err))9})10
11const instance = initResp.getInstance()12if (!instance) {13  throw new Error("Could not retrieve instance from the initialize response.")14}Now something similar should be done.
1const createReq = new CreateRequest()2const instance = client.create(createReq)3
4if (!instance) {5  throw new Error("Could not retrieve instance from the initialize response.")6}7
8const initReq = new InitRequest()9initReq.setInstance(instance)10const initResp = client.init(initReq)11initResp.on("data", (o: InitResponse) => {12  const downloadProgress = o.getDownloadProgress()13  if (downloadProgress) {14    // Handle download progress15  }16  const taskProgress = o.getTaskProgress()17  if (taskProgress) {18    // Handle task progress19  }20  const err = o.getError()21  if (err) {22    // Handle error23  }24})25
26await new Promise<void>((resolve, reject) => {27  initResp.on("error", (err) => reject(err))28  initResp.on("end", resolve)29})Previously if even one platform or library failed to load everything else would fail too, that doesn't happen anymore. Now it's easier for both the CLI and the gRPC clients to handle gracefully platforms or libraries updates that might break the initialization step and make everything unusable.
Removal of gRPC Rescan
 function
RescanThe
RescanInitChange of behaviour of gRPC UpdateIndex
 and UpdateLibrariesIndex
 functions
UpdateIndexUpdateLibrariesIndexPreviously both
UpdateIndexUpdateLibrariesIndexRescanCoreInstanceThis behaviour is now removed and the internal
CoreInstanceInitRemoved rarely used golang API
The following function from the
github.com/arduino/arduino-cli/arduino/libraries1func (lm *LibrariesManager) UpdateIndex(config *downloader.Config) (*downloader.Downloader, error) {We recommend using the equivalent gRPC API to perform the update of the index.
0.18.0
Breaking changes in gRPC API and CLI JSON output.
Starting from this release we applied a more rigorous and stricter naming conventions in gRPC API following the official guidelines: https://developers.google.com/protocol-buffers/docs/style
We also started using a linter to implement checks for gRPC API style errors.
This provides a better consistency and higher quality API but inevitably introduces breaking changes.
gRPC API breaking changes
Consumers of the gRPC API should regenerate their bindings and update all structures naming where necessary. Most of the changes are trivial and falls into the following categories:
- Service names have been suffixed with 
 (for example...Service
 ->ArduinoCore
 )ArduinoCoreService
- Message names suffix has been changed from 
 /...Req
 to...Resp
 /...Request
 (for example...Response
 ->BoardDetailsReq
 )BoardDetailsRequest
- Enumerations now have their class name prefixed (for example the enumeration value 
 inFLAT
 has been changed toLibraryLayout
 )LIBRARY_LAYOUT_FLAT
- Use of lower-snake case on all fields (for example: 
 ->ID
 ,id
 ->FQBN
 ,fqbn
 ->Name
 ,name
 ->ArchiveFilename
 )archive_filename
- Package names are now versioned (for example 
 ->cc.arduino.cli.commands
 )cc.arduino.cli.commands.v1
- Repeated responses are now in plural form (
 ->identification_pref
 ,identification_prefs
 ->platform
 )platforms
arduino-cli JSON output breaking changes
Consumers of the JSON output of the CLI must update their clients if they use one of the following commands:
- in 
 command the following fields have been renamed:- core search
 ->- Boards- boards
 ->- Email- email
 ->- ID- id
 ->- Latest- latest
 ->- Maintainer- maintainer
 ->- Name- name
 ->- Website- website
 - The new output is like: 1$ arduino-cli core search Due --format json2[3 {4 "id": "arduino:sam",5 "latest": "1.6.12",6 "name": "Arduino SAM Boards (32-bits ARM Cortex-M3)",7 "maintainer": "Arduino",8 "website": "http://www.arduino.cc/",9 "email": "packages@arduino.cc",10 "boards": [11 {12 "name": "Arduino Due (Native USB Port)",13 "fqbn": "arduino:sam:arduino_due_x"14 },15 {16 "name": "Arduino Due (Programming Port)",17 "fqbn": "arduino:sam:arduino_due_x_dbg"18 }19 ]20 }21]
- in 
 command the following fields have been renamed:- board details
 ->- identification_pref- identification_prefs
 ->- usbID- usb_id
 ->- PID- pid
 ->- VID- vid
 ->- websiteURL- website_url
 ->- archiveFileName- archive_filename
 ->- propertiesId- properties_id
 ->- toolsDependencies- tools_dependencies
 - The new output is like: 1$ arduino-cli board details arduino:avr:uno --format json2{3 "fqbn": "arduino:avr:uno",4 "name": "Arduino Uno",5 "version": "1.8.3",6 "properties_id": "uno",7 "official": true,8 "package": {9 "maintainer": "Arduino",10 "url": "https://downloads.arduino.cc/packages/package_index.json",11 "website_url": "http://www.arduino.cc/",12 "email": "packages@arduino.cc",13 "name": "arduino",14 "help": {15 "online": "http://www.arduino.cc/en/Reference/HomePage"16 }17 },18 "platform": {19 "architecture": "avr",20 "category": "Arduino",21 "url": "http://downloads.arduino.cc/cores/avr-1.8.3.tar.bz2",22 "archive_filename": "avr-1.8.3.tar.bz2",23 "checksum": "SHA-256:de8a9b982477762d3d3e52fc2b682cdd8ff194dc3f1d46f4debdea6a01b33c14",24 "size": 4941548,25 "name": "Arduino AVR Boards"26 },27 "tools_dependencies": [28 {29 "packager": "arduino",30 "name": "avr-gcc",31 "version": "7.3.0-atmel3.6.1-arduino7",32 "systems": [33 {34 "checksum": "SHA-256:3903553d035da59e33cff9941b857c3cb379cb0638105dfdf69c97f0acc8e7b5",35 "host": "arm-linux-gnueabihf",36 "archive_filename": "avr-gcc-7.3.0-atmel3.6.1-arduino7-arm-linux-gnueabihf.tar.bz2",37 "url": "http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino7-arm-linux-gnueabihf.tar.bz2",38 "size": 3468305639 },40 { ... }41 ]42 },43 { ... }44 ],45 "identification_prefs": [46 {47 "usb_id": {48 "vid": "0x2341",49 "pid": "0x0043"50 }51 },52 { ... }53 ],54 "programmers": [55 {56 "platform": "Arduino AVR Boards",57 "id": "parallel",58 "name": "Parallel Programmer"59 },60 { ... }61 ]62}
- in 
 command the following fields have been renamed:- board listall
 ->- FQBN- fqbn
 ->- Email- email
 ->- ID- id
 ->- Installed- installed
 ->- Latest- latest
 ->- Name- name
 ->- Maintainer- maintainer
 ->- Website- website
 - The new output is like: 1$ arduino-cli board listall Uno --format json2{3 "boards": [4 {5 "name": "Arduino Uno",6 "fqbn": "arduino:avr:uno",7 "platform": {8 "id": "arduino:avr",9 "installed": "1.8.3",10 "latest": "1.8.3",11 "name": "Arduino AVR Boards",12 "maintainer": "Arduino",13 "website": "http://www.arduino.cc/",14 "email": "packages@arduino.cc"15 }16 }17 ]18}
- in 
 command the following fields have been renamed:- board search
 ->- FQBN- fqbn
 ->- Email- email
 ->- ID- id
 ->- Installed- installed
 ->- Latest- latest
 ->- Name- name
 ->- Maintainer- maintainer
 ->- Website- website
 - The new output is like: 1$ arduino-cli board search Uno --format json2[3 {4 "name": "Arduino Uno",5 "fqbn": "arduino:avr:uno",6 "platform": {7 "id": "arduino:avr",8 "installed": "1.8.3",9 "latest": "1.8.3",10 "name": "Arduino AVR Boards",11 "maintainer": "Arduino",12 "website": "http://www.arduino.cc/",13 "email": "packages@arduino.cc"14 }15 }16]
- in 
 command the following fields have been renamed:- lib deps
 ->- versionRequired- version_required
 ->- versionInstalled- version_installed
 - The new output is like: 1$ arduino-cli lib deps Arduino_MKRIoTCarrier --format json2{3 "dependencies": [4 {5 "name": "Adafruit seesaw Library",6 "version_required": "1.3.1"7 },8 {9 "name": "SD",10 "version_required": "1.2.4",11 "version_installed": "1.2.3"12 },13 { ... }14 ]15}
- in 
 command the following fields have been renamed:- lib search
 ->- archivefilename- archive_filename
 ->- cachepath- cache_path
 - The new output is like: 1$ arduino-cli lib search NTPClient --format json2{3 "libraries": [4 {5 "name": "NTPClient",6 "releases": {7 "1.0.0": {8 "author": "Fabrice Weinberg",9 "version": "1.0.0",10 "maintainer": "Fabrice Weinberg \u003cfabrice@weinberg.me\u003e",11 "sentence": "An NTPClient to connect to a time server",12 "paragraph": "Get time from a NTP server and keep it in sync.",13 "website": "https://github.com/FWeinb/NTPClient",14 "category": "Timing",15 "architectures": [16 "esp8266"17 ],18 "types": [19 "Arduino"20 ],21 "resources": {22 "url": "https://downloads.arduino.cc/libraries/github.com/arduino-libraries/NTPClient-1.0.0.zip",23 "archive_filename": "NTPClient-1.0.0.zip",24 "checksum": "SHA-256:b1f2907c9d51ee253bad23d05e2e9c1087ab1e7ba3eb12ee36881ba018d81678",25 "size": 6284,26 "cache_path": "libraries"27 }28 },29 "2.0.0": { ... },30 "3.0.0": { ... },31 "3.1.0": { ... },32 "3.2.0": { ... }33 },34 "latest": {35 "author": "Fabrice Weinberg",36 "version": "3.2.0",37 "maintainer": "Fabrice Weinberg \u003cfabrice@weinberg.me\u003e",38 "sentence": "An NTPClient to connect to a time server",39 "paragraph": "Get time from a NTP server and keep it in sync.",40 "website": "https://github.com/arduino-libraries/NTPClient",41 "category": "Timing",42 "architectures": [43 "*"44 ],45 "types": [46 "Arduino"47 ],48 "resources": {49 "url": "https://downloads.arduino.cc/libraries/github.com/arduino-libraries/NTPClient-3.2.0.zip",50 "archive_filename": "NTPClient-3.2.0.zip",51 "checksum": "SHA-256:122d00df276972ba33683aff0f7fe5eb6f9a190ac364f8238a7af25450fd3e31",52 "size": 7876,53 "cache_path": "libraries"54 }55 }56 }57 ],58 "status": 159}
- in 
 command the following fields have been renamed:- board list
 ->- FQBN- fqbn
 ->- VID- vid
 ->- PID- pid
 - The new output is like: 1$ arduino-cli board list --format json2[3 {4 "address": "/dev/ttyACM0",5 "protocol": "serial",6 "protocol_label": "Serial Port (USB)",7 "boards": [8 {9 "name": "Arduino Nano 33 BLE",10 "fqbn": "arduino:mbed:nano33ble",11 "vid": "0x2341",12 "pid": "0x805a"13 },14 {15 "name": "Arduino Nano 33 BLE",16 "fqbn": "arduino-dev:mbed:nano33ble",17 "vid": "0x2341",18 "pid": "0x805a"19 },20 {21 "name": "Arduino Nano 33 BLE",22 "fqbn": "arduino-dev:nrf52:nano33ble",23 "vid": "0x2341",24 "pid": "0x805a"25 },26 {27 "name": "Arduino Nano 33 BLE",28 "fqbn": "arduino-beta:mbed:nano33ble",29 "vid": "0x2341",30 "pid": "0x805a"31 }32 ],33 "serial_number": "BECC45F754185EC9"34 }35]36$ arduino-cli board list -w --format json37{38 "type": "add",39 "address": "/dev/ttyACM0",40 "protocol": "serial",41 "protocol_label": "Serial Port (USB)",42 "boards": [43 {44 "name": "Arduino Nano 33 BLE",45 "fqbn": "arduino-dev:nrf52:nano33ble",46 "vid": "0x2341",47 "pid": "0x805a"48 },49 {50 "name": "Arduino Nano 33 BLE",51 "fqbn": "arduino-dev:mbed:nano33ble",52 "vid": "0x2341",53 "pid": "0x805a"54 },55 {56 "name": "Arduino Nano 33 BLE",57 "fqbn": "arduino-beta:mbed:nano33ble",58 "vid": "0x2341",59 "pid": "0x805a"60 },61 {62 "name": "Arduino Nano 33 BLE",63 "fqbn": "arduino:mbed:nano33ble",64 "vid": "0x2341",65 "pid": "0x805a"66 }67 ],68 "serial_number": "BECC45F754185EC9"69}70{71 "type": "remove",72 "address": "/dev/ttyACM0"73}
0.16.0
Change type of CompileReq.ExportBinaries
 message in gRPC interface
CompileReq.ExportBinariesThis change affects only the gRPC consumers.
In the
CompileReqexport_binariesboolgoogle.protobuf.BoolValue0.15.0
Rename telemetry
 settings to metrics
telemetrymetricsAll instances of the term
telemetrymetricsTo handle this change the users must edit their config file, usually
arduino-cli.yamltelemetrymetricsThe default folders for the
arduino-cli.yaml- Linux: /home/<your_username>/.arduino15/arduino-cli.yaml
- OS X: /Users/<your_username>/Library/Arduino15/arduino-cli.yaml
- Windows: C:\Users\<your_username>\AppData\Local\Arduino15\arduino-cli.yaml
0.14.0
Changes in debug
 command
debugPreviously it was required:
- To provide a debug command line recipe in 
 likeplatform.txt
 that will start atools.reciped-id.debug.pattern=.....
 session for the selected board.gdb
- To add a 
 definition in thedebug.tool
 to recall that recipe, for exampleboards.txtmyboard.debug.tool=recipe-id
Now:
- Only the configuration needs to be supplied, the 
 or the GUI tool will figure out how to call and setup thearduino-cli
 session. An example of configuration is the following:gdb
1debug.executable={build.path}/{build.project_name}.elf2debug.toolchain=gcc3debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/4debug.toolchain.prefix=arm-none-eabi5debug.server=openocd6debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/7debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/8debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript}The
debug.executableThe
debug.server.XXXXopenocdThe
debug.xxx=yyy- on 
 : definition here will be shared through all boards in the platformplatform.txt
- on 
 as part of a board definition: they will override the global platform definitionsboards.txt
- on 
 : they will override the boards and global platform definitions if the programmer is selectedprogrammers.txt
Binaries export must now be explicitly specified
Previously, if the
--build-path<sketch_folder>/build/<fqbn>/The
--dry-runThe default,
compile--export-binaries-e--export-binaries--output-dir--export-binariessketch.always_export_binariesARDUINO_SKETCH_ALWAYS_EXPORT_BINARIESIf
--input-dir--input-fileuploadThe gRPC interface has been updated accordingly,
dryRunProgrammers can't be listed anymore using burn-bootloader -P list
burn-bootloader -P listThe
-P-P listThis way has been removed in favour of
board details <fqbn> --list-programmerslib install --git-url
 and --zip-file
 must now be explicitly enabled
lib install --git-url--zip-fileWith the introduction of the
--git-url--zip-filelibrary.enable_unsafe_installThis changes the ouput of the
config dumpChange behaviour of --config-file
 flag with config
 commands
--config-fileconfigTo create a new config file with
config init--dest-dir--dest-file--overwrite