Cortcl is a minimalist basekit (embedded TCL environment in a single file) based on AndroWish and targeting the FreeBSD platform.

Cortcl, a project, has several primary goals.

  1. Provide a more capable scripting environment, without significant impact to overall size, for customizing the init process in FreeBSD.
  2. Help FreeBSD, TCL and Fossil reach mainstream adoption.
  3. Facilitate system-wide cascading configuration.
  4. Bundle basic software for collaboratively developing and distributing web applications, packaged as starkits and/or Fossil repositories, which work identically on the desktop and on the server.


Pre-compiled Cortcl, built against FreeBSD-CURRENT, is available for architectures supported by the Bisdi distribution.


AndroWish is a basekit, one of the few known to be actively developed, freely licensed and fully functional. While AndroWish itself targets the Android platform, it includes an alternate build called undroidwish for other platforms. With apologies to Roy Keene's kitcreator, undroidwish is hands down the smoothest path to a custom basekit for multiple platforms.

Cortcl is a stripped-down, tclsh-only version of vanilla undroidwish with a few additions. In contrast to the Batteries Included approach of Androwish, Cortcl is austere, weighing in at a mere ~8MB.

Cortcl uses the following components of AndroWish.


Expect is a tool for automating software interactions. For instance, Expect can be used in a background script to log in to a remote computer without user intervention and without leaking the password in the command history or process list.

More trivially, Expect can mask the complexities of handling IO in TCL when user interaction is required.


The following software is obtained from Depot.


Cor is a pure TCL library which simplifies application normalization across platforms.


Silki is a minimalist web application framework based on TCL.

Silki uses Roy Keene software.


Fossil is a program for managing source code revisions made by multiple contributors from different places at different times.

Just as Cortcl is a single file containing a virtual file system with many files, a Fossil repository is a single file -- a SQLite database -- acting as a virtual file system containing many files.


This approach has its drawbacks.


However, the advantages heavily outweigh the drawbacks.

Self Hosting

Fossil embeds a CGI-compatible web server capable of hosting any number of repositories simultaneously. This gives a web-based interface for managing repositories and accessing their contents.

The web server fulfills dual roles. Firstly, each contributor runs it locally (on the computer at which she sits) as she makes changes, using it to collect information which is related to the code , but not part of it, such as release notes and documentation, to be synchronized with the code. Secondly, it runs on the server hosting the primary copy of the repository for public consumption.

As a result of the first role, Fossil requires no permissions or file system access, other than to repositories, to run.

As a result of the second role, considerable resources are devoted by Fossil's authors toward keeping the web server performant, resilient and secure, even in hostile hosting environments.

Archival Assets

Subject to limitations, Fossil is an ideal remote backup utility for a digital library.

For users with multiple devices, this means changes made on one are seamlessly synchronized with the others.

Combined with a cheap shared hosting subscription, Fossil makes the ultimate poor man's private cloud. Add another subscription with a different provider for redundancy.

Enduring Dialog

The forum feature allows any number of users to participate in a chronological hypertext conversation authored in Markdown.

Download Depot

The unversioned feature stores files outside the blockchain, yet still subject to synchronization. This can be used to distribute derivative, temporary or otherwise volatile files, such as software installer images or finalized multimedia, without polluting or bloating a repository.

Content Management System

The wiki and technote features are indispensable for collecting, organizing and refining time-insensitive and time-sensitive (respectively) hypertext documents authored in Markdown.

Application Framework

When properly compiled, Fossil can be extended in significant ways.

Custom actions

The hooks mechanism enables adding custom actions to Fossil's web and/or command line interface.

Embedded scripting

Fossil contains an embedded scripting language called Test Harness 1 (TH1) with strictly limited capabilities which only runs in certain contexts; for instance, wiki pages cannot interpret TH1, nor can they be configured to do so.

TH1 is suitable for designing alternate views of repository content and controlling access based on membership.

System interaction

When compiled with TCL support, as is fossilt, Fossil gives TH1 the ability to interpret raw TCL code, transforming it into a full-blown application development framework.


Bisdi is a minimalist FreeBSD distribution published as a collection of disk images, with each supported ABI combination stored in a separate Fossil repository. With Bisdi, upgrading FreeBSD is as simple as synchronizing the repository and using Cortcl to install the new images.




Aside from bundling Cortcl, Bisdi makes very few changes to the official base system, and even fewer of consequence. The main difference is that diskless(8) is patched to support locally stored classes, called sides, instead of those stored on a BOOTP server.

The sides concept combines the flexibility of a live distribution, the convenience of persistent storage and the power of cascading configuration into a concrete implementation equally suited to diskless clients, physical hosts, virtual guests and jails.

The implementation involves a suite of unofficial [rc(8)] services.

Cortcl bundles


On platforms other than FreeBSD, Cortcl is replaced by AndroWish for Android and by undroidwish for others.

Downloads for the following platforms are available from AndroWish.

For undroidwish, vanillatclsh must be extracted with the following command once download is complete.

prompt% <vanillawish> builtin:mktclsh


Cortcl is a command line application. How to obtain a prompt is platform-dependent. Thereafter, instructions are identical on all platforms.

The general form of a command follows.

<basekit> <starkit> <starkit-arguments>


Corlib is a build of Cortcl as a dynamically loadable library.


Cortcl bundles an alternately compiled fossil binary with TCL support which depends on Corlib.