LinuxCommandLibrary

raco

Manage and run Racket programs

TLDR

Install a package, automatically installing dependencies

$ raco pkg install --auto [package_source]
copy

Install the current directory as a package
$ raco pkg install
copy

Build (or rebuild) bytecode, documentation, executables, and metadata indexes for collections
$ raco setup [collection1 collection2 ...]
copy

Run tests in files
$ raco test [path/to/tests1.rkt path/to/tests2.rkt ...]
copy

Search local documentation
$ raco docs [search_terms]
copy

Display help
$ raco help
copy

SYNOPSIS

raco subcommand [options] [arguments...]

PARAMETERS

pkg
    Manages Racket packages, including installation, updates, and removal.

exe
    Builds standalone executables from Racket source files.

cs
    Compiles Racket source code into .zo (bytecode) files.

test
    Runs tests defined within Racket projects or specific files.

doc
    Generates documentation for Racket libraries and projects.

setup
    Performs various setup tasks for a Racket installation, such as compiling core files.

config
    Manages Racket's system and user configuration settings.

help
    Provides detailed help for raco itself or specific subcommands.

version
    Displays the installed Racket version information.

DESCRIPTION

raco is the indispensable command-line utility for the
Racket programming language ecosystem. It serves as the central
hub for a wide array of development, deployment, and system
management tasks. Developers utilize raco for essential
operations such as managing Racket packages (installing,
updating, and removing libraries), compiling Racket source code
into standalone executables or bytecode, running automated tests
for Racket projects, and generating project documentation. Beyond
these, it offers tools for system setup, debugging, introspection,
and configuration management specific to Racket installations.
Its modular design means that much of raco's functionality
is provided through a diverse set of subcommands, each focused
on a specific aspect of Racket development, making it a powerful
and versatile tool for anyone working with Racket.

CAVEATS

The functionality and availability of specific raco subcommands
can vary between different versions of the Racket programming
language. Some older subcommands might be deprecated or replaced
by newer alternatives (e.g., planet replaced by pkg).
It requires a proper Racket installation to be present in the
system's PATH.

EXTENSIBILITY

raco is designed to be highly extensible.
Developers can create their own custom raco subcommands
by writing Racket modules, making it possible to integrate
project-specific tooling directly into the raco workflow.
This allows for tailored automation and simplifies complex
development tasks within the Racket environment.

SUBCOMMAND HELP

Each raco subcommand typically
offers its own detailed help documentation. Users can get
specific usage information, options, and arguments for a
particular subcommand by running
raco subcommand --help
or
raco help subcommand.

HISTORY

raco evolved as the central command-line utility for
what was originally PLT Scheme and later became Racket. Its
development paralleled Racket's growth into a full-fledged
programming ecosystem. Initially, simpler, specialized scripts
handled tasks like package management. However, as the system
matured, the need for a unified, extensible command-line
interface led to the creation of raco. Notable historical
changes include the transition from older package managers like
planet to the more robust and modern raco pkg
subcommand, reflecting ongoing improvements in Racket's tooling
and infrastructure.

SEE ALSO

racket(1), drracket(1)

Copied to clipboard