[UPDATE] from version 1.5.0 arduino has its own official CLI, see https://github.com/arduino/Arduino/blob/ide-1.5.x/build/shared/manpage.adoc following tool is unofficial but still on development
There is a command line toolkit for working with Arduino. It is called Ino and available at http://inotool.org/.
// 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): Attach:arduino-core-0005.zip
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.
Link to the hacking section is a broken link? Where has this page gone?
(// Restored the following text from history ~~TimPe, 2011-07-13)