Est. 1996 Beginner

GUI4CLI

Dimitris Keletsekis's event-driven script language for building GadTools GUIs on top of AmigaDOS commands and ARexx ports, later ported to Windows and released as open source

Created by Dimitris C. Keletsekis

Paradigm Event-driven scripting: GUI declarations with command routines attached to events
Typing Untyped - variables hold text; arithmetic is done through $( ) expression evaluation
First Appeared 1996
Latest Version Windows 19.43 (c. 2016); Amiga 3.8.5 (June 2000)

GUI4CLI (written Gui4Cli by its author, short for “GUI for CLI”) is an interpreted, event-driven script language for building graphical user interfaces. Greek programmer Dimitris C. Keletsekis wrote it for the Commodore Amiga in the mid-1990s. You describe a window and its gadgets in a plain text file, attach commands to each gadget, and run the file. Gui4Cli turns it into a live GadTools interface that can build AmigaDOS command lines or send commands to other programs’ ARexx ports. Keletsekis summed it up in three words: “Visual DOS”. Around 2000 he ported it to Windows, where it grew into a much larger open-source scripting environment that lasted until the mid-2010s.

History & Origins

A GUI for every command-line program

The Amiga had a rich command line: AmigaDOS scripts, a large stock of shell utilities, and ARexx, which let programs expose command ports to scripts. Writing a proper Intuition/GadTools GUI for any of these, though, meant C, include files and a compiler. Keletsekis’s idea was to separate the GUI from the program. In his 1997 introduction he argued that in “most programs the GUI is a completely different part of the program and nothing to do with what the program is actually supposed to do”. The command line, he wrote, “is still a very powerful tool. It is all that programs need to make them work.”

Gui4Cli was meant to let anyone, including people with no programming background, wrap a GUI around a command-line tool or an ARexx-capable application.

First releases (1996)

The encyclopedia master list dates GUI4CLI to 1993, but no evidence supports that year. The earliest surviving release is version 1.0d, preserved on the Aminet 12 CD-ROM (June 1996). Its Aminet readme introduces “a new, interpreted, script-like language for constructing GUIs”. Its ReadMe and AmigaGuide manual say “(c) 1996 by D.C. Keletsekis”, and the files in the archive are dated January to March 1996, almost all of them February and March. Gui4Cli does not appear on the Aminet CDs from October 1995 to April 1996. Later copyright notices begin at 1995 ("(c) 1995-97" on the author’s 1997 home page, “1995-1999” in the 3.8 manual), so work probably began in 1995. The first public release came in 1996.

Version 1.0 needed Workbench 2.04 or higher, the ARexx library, and (for fonts and file requesters) the diskfont and ASL libraries. Its change log already shows the basic design: listview gadgets, drawing commands, a NOREQUEST switch so a GUI could start from WBStartup, and console output for launched commands.

Rapid growth (1997-1999)

Development moved quickly:

VersionDateHighlights
1.0b-1.0dearly 1996Listview fixes, LVGet/LVSave/LVDel, new-look menus
2.0announced Feb 1997Multiple resizable font-sensitive windows, GadTools gadgets and menus, icons as buttons, screens
3.12 June 1997Download offered on the author’s new home page
3.21997-98Private variables, the PIPE event, arguments passed to routines, ANSI colour in listviews, gadget help
3.51997-98Full maths, database listviews with fields and records
3.623 Oct 1998xTimer event, C programmer interface, clipboard, shared menus, 8SVX sound extension
3.71998-99Commodities hotkeys (xHOTKEY), file notification (xNOTIFY), speech, sound effects
3.84 Dec 1999xTextBox gadget, images in listviews, xOnHelp/xOnClick, palette control
3.8.5June 2000BRANCH command, listview fixes; last Amiga release by the author

Features come from Gui4Cli’s own change logs and Aminet readmes. Releases 3.2 to 3.7 carry no dates in those sources, so the table places them between the dated 3.1, 3.6 and 3.8 releases. The 3.x change log ends with Keletsekis’s own verdict on older history: he offered it to “the National Museum of Modern Art”, and when they declined it, he “danced Kartsilama on the ashes”.

Gui4Cli started as shareware. The 1997 announcement asked for “a shareware fee of either $10, or a really good GUI”. By version 3.8 it was “FreeWare”. Keletsekis later published the full Amiga source code (SAS/C 6.58) on his site.

The move to Windows (2000-2016)

By October 2000, Keletsekis’s Amiga page announced: “I’ve stopped the developement of Gui4Cli on the Amiga - it works well as it is and there wasn’t much more I could add. Instead I’ve started porting it to WINDOWS.” By August 2001 the page pointed Amiga visitors to www.Gui4Cli.com, the new home of the Windows version.

The Windows Gui4Cli kept the scripting model but became a much bigger system. It added treeviews, tabs, combo boxes, rich-edit and Scintilla editor controls, registry access and image handling. Plug-in DLLs extended the language, and Gui4Cli scripts could be packed into stand-alone executables. Third-party modules let Python (reportedly by Valery Ivanov) and Ruby (by “daz”, 2004) drive Gui4Cli. Version 19 shipped on 20 July 2005. A SourceForge project was registered on 22 May 2007, and by early 2009 Gui4Cli was distributed under the MIT License. The site credited code from Neil Hodgson’s Scintilla, AutoIt’s Jonathan Bennett (executable packing), zlib, and Blowfish/XXTEA encryption implementations.

The last Windows release in the archives is 19.43, a one-line fix for a crash under Windows 10, with files dated June 2016. Its history file shows the code being rebuilt with Visual C++ 2008 Express and later Visual Studio 2013 (with the XP-compatible toolset), and adding high-DPI awareness for Windows 8.

Design Philosophy

Gui4Cli rests on a few ideas that Keletsekis repeated across both platforms:

  • The GUI is separate from the program. A command-line tool stays small and portable, and Gui4Cli supplies the interface. The 1997 introduction lists the expected benefits: smaller binaries, new-look GUIs even for programs written for Workbench 1.3, and interfaces “guaranteed intuitive” because users can rearrange them.
  • No compiler, no libraries, no prior knowledge. “You just write a text file, and run it.” The language was pitched as “about as difficult as Amiga Dos”.
  • One resident interpreter, many GUIs. Gui4Cli stays in memory and runs every loaded GUI from a single instance. On Windows, Keletsekis argued this saved memory and load time, because the DLLs and resources were loaded once and shared by all GUIs.
  • GUIs stay editable while running. Gadgets can be moved and resized visually while a GUI is running, and the result saved back to the script.

Key Features

Program structure

A Gui4Cli file begins with the keyword G4C, followed by a window declaration and a list of events. Every command after an event declaration belongs to that event until the next event starts. Visual events (XBUTTON, XTEXTIN, XLISTVIEW, XCYCLER and so on) are gadgets, and their attached commands run when the user operates them. Non-visual events (xOnLoad, xOnClose, xOnRMB, xTimer, xHotKey, xNotify and others) fire on system or window activity.

This button demo is abridged from the tutorials shipped with Amiga version 3.8 (a background line and a third button are omitted, and comments are shortened):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
G4C

WINBIG 114 60 384 98 "Buttons.gc"    ; our window
WinType 11110001                     ; system gadgets it should have
BOX 0 0 0 0 OUT button               ; draw a border-sized box

xonLoad                              ; what to do when the gui loads
	GuiOpen Buttons.gc

xonClose                             ; what to do when it is closed
	GuiQuit Buttons.gc

; each button takes: Left Top Width Height Title
XBUTTON 34 25 85 50   'A'
	SetWinTitle Buttons.gc "You clicked on button A"

XBUTTON 156 25 85 50   'B'
	SetWinTitle Buttons.gc "That time you chose B"

Driving AmigaDOS and ARexx

Gui4Cli’s purpose was to make command lines, and its main tools for that were CLI and RUN (AmigaDOS commands) and SENDREXX (ARexx). The manual’s own example is SendRexx rexx_ced 'open $Myfile', which tells the CygnusEd editor to open a file. Variables are substituted into strings with $name. The short sketch below follows the documented syntax of XTEXTIN, CLI and SENDREXX. It was put together for this page and has not been run on an Amiga:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
G4C

WINBIG 100 50 300 60 'Send a file'
WinType 11110001

xOnLoad
	GuiOpen #This

xOnClose
	GuiQuit #This

XTEXTIN 60 5 230 15 "File" myfile "" 200

XBUTTON 10 25 135 15 "Copy to RAM:"
	cli 'copy "$myfile" RAM:'

XBUTTON 155 25 135 15 "Open in CED"
	SendRexx rexx_ced 'open $myfile'

Other capabilities (Amiga 3.x)

  • Directory and database listviews. A listview can show a live directory, which made file managers such as the bundled Dir.gc possible. It can also hold records with named fields.
  • Variables. Global, private (per-GUI) and local variables, plus many $$ internal variables ($$LV.REC, $$MEM.CHIP, $$RAND.100, and so on). Version 3.8.2 added compound variables.
  • Control flow. if/endif, docase, dowhile, gosub and (from 3.8.5) branch.
  • System integration. AppIcons, AppMenus and AppWindows, Commodities hotkeys, DOS file notification, pipes, custom screens, speech via narrator.device, and IFF 8SVX sound effects.
  • Embedded data. TEXTFILE ... ### blocks let a GUI carry an ARexx script or listview data inside its own source file.
  • Debugging. Pressing Control-D in any Gui4Cli window toggles debug mode.
  • Extensions. From 3.6, C programmers could write extensions against a documented interface (Gui4Cli.h).

The Windows dialect

The Windows version kept the same shape. Its manual’s “Hello World” is:

1
2
3
4
5
6
7
8
G4C MyGui
Window 10 10 200 300 "My window"

xOnLoad
   GuiOpen MyGui

xButton 10 10 100 20 "Hello World"
   GuiQuit MyGui

Saved with a .gui extension and double-clicked in Explorer, this opens a window with one button that unloads the GUI. The main visible difference from the Amiga dialect is that the GUI’s name follows G4C on the first line.

Current Relevance

Gui4Cli is a historical language. Keletsekis ended Amiga development in 2000, and the last Windows build dates from around 2016. The language lived on in a few places afterwards:

  • Aminet still carries dev/gui/gui4cli.lha (3.8) and, since February 2016, gui4cli-update.lha (3.8.5). The AmigaOS documentation wiki lists Gui4Cli among its application-development tools.
  • AmigaOS 4. In 2012 a user writing as “JosDuchIt” on os4coding.net worked on an AmigaOS 4 build of the Amiga code (distributed as “Gui4Cli 3.8.7_OS4”). The blog posts describe a console mode, rewritten directory walking and fixes to partial redraws.
  • The original website is gone. By 2023, archived copies of gui4cli.com show unrelated gambling promotion inserted into the home page, and later captures show a different site entirely. The Wayback Machine and Aminet are now the main sources for the software and its documentation.

Why It Matters

Gui4Cli is a clear example of a common Amiga idea: the system as a set of small, scriptable parts (shell commands, ARexx ports, Workbench objects) that users could combine themselves. Gui4Cli let non-programmers build real GadTools interfaces, change them while they ran, and share them, as the Gui Galleria and many Aminet front ends show. Its move from Amiga freeware to an MIT-licensed Windows scripting system also follows the path of Amiga developers who left the platform around 2000 and took their tools with them.

Timeline

1996
Gui4Cli 1.0 appears on Aminet as a 'new, interpreted, script-like language' for building GUIs on Workbench 2.04 or later; version 1.0d (archive files dated January-March 1996) is included on the Aminet 12 CD-ROM (June 1996)
1997
Version 2.0 is announced in Amiga Report 5.02 (21 February 1997) as freely distributable, with a suggested shareware fee of $10 'or a really good GUI'
1997
Version 3.1 is released on 2 June 1997 on the author's home page, which now hosts a 'Gui Galleria' of user-contributed GUIs
1998
Version 3.6 (23 October 1998) adds a C-language interface, the xTimer event, clipboard support, shared menus and an 8SVX sound extension
1999
Version 3.8, now freeware, is uploaded to Aminet on 4 December 1999 with the xTextBox gadget, images in listviews, an xOnHelp event and palette handling
2000
Version 3.8.5 (June 2000) is the last Amiga release by Keletsekis; by October 2000 his page says Amiga development has stopped and a Windows port is under way
2001
By August 2001 the Amiga page says Gui4Cli is now available for Windows at www.Gui4Cli.com
2005
Gui4Cli for Windows version 19 is uploaded on 20 July 2005 as a self-installing package with the interpreter, help files, tutorials and development files
2007
The 'Gui4Cli Script Language' project is registered on SourceForge (22 May 2007); by early 2009 the Windows version is described as open source under the MIT License (copyright 2008)
2016
Roger Høseth uploads the 3.8.5 Amiga binary to Aminet (22 February 2016), noting it had never been uploaded there; the last Windows build, 19.43, has files dated June 2016

Notable Uses & Legacy

MPEGAGUI (Aminet mus/play)

A Gui4Cli front end for the MPEGA MP3 player, with MP3Tool and a tag editor (Aminet, September 1997)

Visgui (Aminet gfx/show)

Claudio Vimercati's GUI for the Visage picture viewer, 'made in Gui4Cli' (Aminet, March 1999)

PalmSyncGC and PalmDocGC (Aminet)

John Chandler's freeware Gui4Cli interfaces to Richard Koerber's PalmTransfer shell tool and to the Makedoc Palm DOC converter (1999-2000), so Amiga users could sync with a Palm handheld

HJSplit GUI (Aminet util/misc)

Mario Sarno's GUI for the cross-platform HJSplit file splitter, 'written using the excellent Gui4Cli package' (Aminet, June 2000)

Dir.gc file manager

A directory-lister file manager written in Gui4Cli and shipped with the Amiga distribution, built on the language's directory listviews

Running Today

Run examples using the official Docker image:

docker pull
Last updated: