# @functional-bitcoin/cli

> **🚨 Alert: Functional Bitcoin is VERY beta software with frequent breaking changes. Brave pioneers only until the beta tag is removed.**

Latest version **0.1.0-beta.2** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @functional-bitcoin/cli
pnpm add @functional-bitcoin/cli
yarn add @functional-bitcoin/cli
bun add @functional-bitcoin/cli
```

Provides the command `fb`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-beta.2 |
| Published | 2019-08-21 |
| First published | 2019-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | libitx |

## Links

- npm: https://www.npmjs.com/package/@functional-bitcoin/cli
- Repository: https://github.com/functional-bitcoin/cli
- npm.io page: https://npm.io/package/@functional-bitcoin/cli

## Dependencies (8)

- [bsv](https://npm.io/package/bsv.md) ^0.29.2
- [ejs](https://npm.io/package/ejs.md) ^2.6.2
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^13.3.0
- [dotenv](https://npm.io/package/dotenv.md) ^8.0.0
- [datapay](https://npm.io/package/datapay.md) ^0.0.18
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0

## Recent versions

- 0.1.0-beta.2 (latest) — 2019-08-21
- 0.0.1-beta.4 (beta) — 2019-02-10
- 0.1.0-beta.1 — 2019-08-21
- 0.0.1-beta.3 — 2019-02-10

## README

[![license](https://img.shields.io/github/license/functional-bitcoin/library.svg)](https://github.com/functional-bitcoin/library/blob/master/license.md)

# Functional Bitcoin :: CLI

**🚨 Alert: Functional Bitcoin is VERY beta software with frequent breaking changes. Brave pioneers only until the beta tag is removed.**

Command line utility to help author and publish functions to the Bitcoin (SV) blockchain, for use in extensible Bitcoin application protocols.

## Installation

```console
# Install cli
$ npm install -g @functional-bitcoin/cli@beta

# List available commands
$ fb --help 
```

## Usage

Initialise your working directory. This will generate a `.bit` environemnt file containing your publishing address and private key.

```console
$ fb init --help

$ fb init .
```

Create new functions. This will generate a blank function in the `src` folder of your working directory.

```console
$ fb new --help

$ fb new my/function -a arg1 -a arg2
```

Publish functions to the blockchain. It is necessary to fund your publishing address (in the `.bit` file) with a few satoshis before publishing.


```console
$ fb publish --help

$ fb publish my/function
```

## Creating functions

A generated function will look like this:

```lua
function main(ctx, arg1, arg2)
  return ctx
end
```

Functions are scripts that define a `main()` function, although within the script any other necessary functions, classes and variables can be defined. The script is written using Lua, and executed within a sandboxed environment with the `file` and `io` modules removed.

A function represents a "cell" - an atomic subroutine within a "tape" (a transaction output). The return value of each cell is passed to the next cell in the tape. Thus cell by cell the tapes' result is calculated - pure functional programming on bitcoin!

---
_Source: https://npm.io/package/@functional-bitcoin/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
