Arduino from the Command Line

From version 1.5.0 arduino has its own official CLI, see The following tools are unofficial, but still on development.


PlatformIO is an open source ecosystem for IoT development with cross platform build system and library manager. Full support for Arduino and more than 250+ embedded boards. Cross-platform: Windows, Mac, Linux and Linux ARM (Raspberry Pi, BeagleBoard and etc.),

Embedded Development. Easier Than Ever.

  • Colourful command-line output
  • Built-in Serial Port Monitor
  • Configurable build -flags/-options
  • Integration with development environments (IDE)
  • Pre-built tool chains, frameworks for the popular Hardware Platforms

Smart Code Builder. Fast and Reliable.

  • Reliable, automatic dependency analysis and detection of build changes
  • Improved support for parallel builds
  • Ability to share built files in a cache
  • Lookup for external libraries which are installed via Library Manager

The Missing Library Manager for Arduino. It's here!

  • Friendly Command-Line Interface
  • Modern Web 2.0 Library Search
  • Library dependency management
  • Automatic library updating

It runs on Windows, Mac OS X, and Linux (+ARMv6).

Initial text

// Restored the following text from history ~~TimPe, 2011-07-13

Here is a Makefile for compiling and uploading Arduino programs from the command line without the use of the Arduino environment or Java. You will still need a number of other programs. On the Mac or Windows, it's probably easiest just to download and install the Arduino software. Then grab this makefile: Attach:Makefile

On Linux, you will need to install avr-gcc (whose package is usually called gcc-avr), avr-libc and avrdude. On Debian you might try

   sudo apt-get install gcc-avr avr-libc avrdude 

On Gentoo, see the instructions, but don't worry about installing Java, RXTX, subversion, or jikes or checking anything out of subversion, but do substitute avrdude for uisp. Then, download this zip archive of the Arduino core (it includes the Makefile):

Instructions for writing, compiling/verifying, and uploading your programs are in the Makefile.


Minor detail: on my OS X 10.4 box, I had to add a "-C /location/to/avrdude.conf" to AVRDUDE_FLAGS otherwise it's bombing out when avrdude wants to upload your code.