Skip to content

Repository files navigation

cclsh

A system shell running inside Clozure CL. Ordinary Unix commands and Common Lisp forms share one live image, so the boundary between shell use and Lisp is small and explicit.

cclsh targets Linux x86-64. It is not a POSIX shell: command strings, scripts, pipelines and redirection use cclsh syntax. Try it as an ordinary shell before considering login-shell use.

Try it

With Nix flakes enabled:

nix run github:lambda-symbolics/cclsh -- --version
nix run github:lambda-symbolics/cclsh

Then type these lines inside cclsh:

pwd
(+ 1 2)
echo "Lisp result:" (+ 20 22)
help

The first line runs a normal command, the second evaluates Lisp, and the third substitutes a Lisp result into a command.

Install

The Nix flake is the recommended package:

nix profile install github:lambda-symbolics/cclsh
cclsh --version

From a checkout, use nix run . or nix profile install .#cclsh.

See Installing cclsh for Quicklisp state, source builds, local installation and the guarded shared login-shell procedure.

Shell and Lisp

A submitted line is interpreted by its shape:

  • A line beginning with ( is evaluated as Common Lisp in the cclsh-user package.
  • Any other line starts in command mode and resolves a builtin or executable.
  • Parenthesized Lisp inside a command is evaluated and substituted into its arguments.

Pipelines, sequencing and redirection are Lisp forms rather than sh operators:

(pipe (ls "-la") (grep "lisp"))
(pipe (make) (to "build.log"))
(capture (git "rev-parse" "--short" "HEAD"))

The same helpers are available to CCL programs after loading the cclsh system. Commands can also be defined in Lisp with defcommand and used from both command mode and Lisp.

Highlights

  • Clinedi line editing with history search, completion and highlighting
  • foreground process groups, Ctrl-C handling and jobs=/=fg=/=bg=/=disown
  • startup configuration in ~/.config/cclsh/startup.lisp
  • command strings, scripts, shebang scripts and piped input
  • optional zoxide integration with z and zi
  • optional experimental cclsh-fast prewarmed interactive launcher

Documentation

The built-in manual is available as help inside cclsh, or as cclsh help from another shell. Use cclsh help SECTION for a specific topic.

Development

Stock CCL 1.13 is sufficient for regression checks and unsaved REPL development:

scripts/check

Standalone image builds require the downstream CCL changes documented in the installation guide.

License

cclsh’s original code and documentation are released under the ISC license. See LICENSE. The CCL-derived patch mirrors under patches/ remain under the Apache License 2.0; see their license and provenance ledger.

About

Clozure CL Shell

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages