FunctionalScript CLI

Install FunctionalScript to test and compile modules, manage content-addressable storage, and run local tools. Choose a command below for usage and documentation.

Install and run

npm install -g functionalscript
npx functionalscript <command> [args]
fjs <command> [args]

npx functionalscript invokes the package; fjs is the installed executable. Replace angle-bracket placeholders with your values; square brackets mark optional arguments.

Examples execute locally. This website is a reference, not an online shell.

fjs test

Run the FunctionalScript test suite

Aliases: fjs t

Usage

fjs test

Run from the directory whose proofs you want to test.

Examples

fjs test

Complete documentation

fjs compile

Compile a FunctionalScript module to JavaScript, or check every .f.js with no arguments

Aliases: fjs c

Usage

fjs compile
fjs compile <input> <output>

With no arguments, check every .f.js under the current directory. The POSIX shell example writes example.f.js and example.json in the current directory. The output extension selects its format.

Examples

fjs compile
printf 'export default 42;\n' > example.f.js
fjs compile ./example.f.js ./example.json

Complete documentation

fjs cas

Content-addressable storage operations

Aliases: fjs s

Usage

fjs cas <command> [args]

Choose add, get or list below. Content is stored under ~/.cas/.

Examples

fjs help cas

Complete documentation

fjs cas add

Store file content and print its hash

Aliases: fjs s add

Usage

fjs cas add <path>

Store an existing file and print its hash; this example uses a repository checkout.

Examples

fjs cas add ./README.md

Complete documentation

fjs cas get

Restore content by hash into a file

Aliases: fjs s get

Usage

fjs cas get <hash> <path>

Restore a stored hash to a file. This POSIX shell example requires a repository checkout and writes restored-README.md.

Examples

hash=$(fjs cas add ./README.md)
fjs cas get "$hash" ./restored-README.md

Complete documentation

fjs cas list

List all stored content hashes

Aliases: fjs s list

Usage

fjs cas list

Print all hashes in the local store.

Examples

fjs cas list

Complete documentation

fjs cas help

Print this help message

Aliases: fjs cas h, fjs cas ?, fjs s help, fjs s h, fjs s ?

Usage

fjs cas help

Both invocations list the subcommands and their aliases.

Examples

fjs help cas

Complete documentation

fjs mcp

Run an MCP server over stdio exposing the CAS and Evo (subjects/heads) as tools

Aliases: fjs m

Usage

fjs mcp

Start the stdio server from an MCP client. It waits for protocol input rather than printing an interactive prompt.

Examples

npx functionalscript mcp

Complete documentation

fjs ci

Generate the GitHub Actions CI and npm publishing workflows

Aliases: fjs i

Usage

fjs ci

Run in the project whose GitHub Actions workflows you want to generate. This writes .github/workflows/gen.ci.yml and gen.npm-publish.yml.

Examples

fjs ci

Complete documentation

fjs web

Serve a directory over HTTP

Aliases: fjs w

Usage

fjs web [root] [port]

Defaults to the current directory and port 8080 on loopback. Both arguments are positional.

Examples

fjs web
fjs web . 3000

Complete documentation

fjs run

Run the `main` program or command table a FunctionalScript module exports

Aliases: fjs r

Usage

fjs run <module> [args...]

The module must export main as a program or command table. This repository-checkout example generates the website locally.

Examples

fjs run ./fjs/website/module.f.mjs

Complete documentation

fjs help

Print this help message

Aliases: fjs h, fjs ?

Usage

fjs help [command]

A command table target lists its subcommands. For a program target, help lists the top-level commands; it does not describe positional parameters.

Examples

fjs help
fjs help cas

Complete documentation