Install pelicode with Homebrew, with Rust’s package manager Cargo, or build it from source. Every method installs a single command, pelicode. To run it without installing anything but Docker, use the container image.
🛠️ Prerequisites#
- For Homebrew: Homebrew on macOS or Linux. Nothing else is needed.
- For Cargo and building from source:
- The Rust toolchain, version 1.90 or later.
- A C compiler (
cc, Xcode Command Line Tools on macOS,build-essentialon Debian and Ubuntu). The Tree-sitter grammars and the bundled SQLite are written in C and compiled during the build.
- For
pelicode scan --git: Git on yourPATH.
pelicode crawl downloads packages over HTTPS, so it needs network access. The other commands work offline.
🍺 With Homebrew#
brew install tamada/tap/pelicodeThis taps tamada/homebrew-tap and installs the pelicode command.
To upgrade or remove it later:
brew upgrade pelicode
brew uninstall pelicode📦 With Cargo#
cargo install pelicode-cliThis builds the pelicode-cli crate from crates.io and installs the pelicode command into Cargo’s binary directory (usually ~/.cargo/bin, which should be in your PATH).
To install the latest commit of the repository instead:
cargo install --git https://github.com/tamada/pelicode pelicode-cliTo remove it later:
cargo uninstall pelicode-cli🐳 With Docker#
docker run --rm -v "$PWD":/workdir quay.io/tama5/pelicode languagesThe image quay.io/tama5/pelicode is built for linux/amd64 and linux/arm64, and carries Git for scan --git. Its working directory is /workdir, so mount the directory that holds your code and the database there:
docker run --rm -v "$PWD":/workdir quay.io/tama5/pelicode crawl pypi requests
docker run --rm -v "$PWD":/workdir quay.io/tama5/pelicode scan --git main..HEADThe command runs as an unprivileged user (UID 1000). On Linux, if that user cannot write the database into the mounted directory, run it as yourself with --user "$(id -u):$(id -g)".
🏗️ From Source#
git clone https://github.com/tamada/pelicode.git
cd pelicode
cargo build --releaseThe command is built as target/release/pelicode. Copy it to a directory in your PATH, or let Cargo install it:
cargo install --path cliTo run the tests (they do not access the network):
cargo testThe repository also has a Justfile with the tasks CI runs, for just: just test (formatting, clippy, build and tests with coverage), just publish_check, just docker and more; just --list shows them all.
The repository is a Cargo workspace of five crates:
| Directory | Crate | Contents |
|---|---|---|
core | pelicode-core | Parsing, function extraction, normalization, hashes, fingerprints, MinHash |
db | pelicode-db | SQLite storage, lookups and hash counts |
detect | pelicode-detect | Search for similar code candidates |
crawl | pelicode-crawl | Fetching from PyPI, Maven Central, the Go module proxy, RubyGems and crates.io |
cli | pelicode-cli | The pelicode command |
✅ Check the Installation#
pelicode --version
pelicode languagesThe second command lists the supported languages and their file extensions:
go go
java java
kotlin kt, kts
python py
ruby rb
rust rsNext, follow 🚀 Getting Started to build a small database and check some code against it.
