Documentation
[package]
name = "wasmer-cli"
description = "Wasmer CLI"
categories = ["wasm", "command-line-interface"]
keywords = ["wasm", "webassembly", "cli"]
readme = "README.md"
default-run = "wasmer"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[[bin]]
name = "wasmer"
path = "src/bin/wasmer.rs"
doc = false
required-features = ["backend"]

[[bin]]
name = "wasmer-headless"
path = "src/bin/wasmer_headless.rs"
doc = false
required-features = ["headless"]

[dependencies]
# Repo-local dependencies.
wasmer = { version = "=4.2.1", path = "../api", default-features = false }
wasmer-compiler = { version = "=4.2.1", path = "../compiler", features = [
  "compiler",
], optional = true }
wasmer-compiler-cranelift = { version = "=4.2.1", path = "../compiler-cranelift", optional = true }
wasmer-compiler-singlepass = { version = "=4.2.1", path = "../compiler-singlepass", optional = true }
wasmer-compiler-llvm = { version = "=4.2.1", path = "../compiler-llvm", optional = true }
wasmer-emscripten = { version = "=4.2.1", path = "../emscripten" }
wasmer-vm = { version = "=4.2.1", path = "../vm", optional = true }
wasmer-wasix = { version = "0.14.0", path = "../wasix", features = [
  "logging",
  "webc_runner_rt_wcgi",
  "webc_runner_rt_emscripten",
  "host-fs",
] }
wasmer-wasix-experimental-io-devices = { version = "0.14.0", path = "../wasi-experimental-io-devices", optional = true, features = [
  "link_external_libs",
] }
wasmer-wast = { version = "=4.2.1", path = "../../tests/lib/wast", optional = true }
wasmer-cache = { version = "=4.2.1", path = "../cache", features = [
  "blake3-pure",
] }
wasmer-types = { version = "=4.2.1", path = "../types", features = [
  "enable-serde",
] }
wasmer-registry = { version = "5.7.0", path = "../registry", features = [
  "build-package",
  "clap", 
] }
wasmer-object = { version = "=4.2.1", path = "../object", optional = true }
virtual-fs = { version = "0.9.0", path = "../virtual-fs", default-features = false, features = [
  "host-fs",
] }
virtual-net = { version = "0.6.0", path = "../virtual-net" }

# Wasmer-owned dependencies.
webc = { workspace = true }
wasmer-deploy-cli = { version = "=0.1.25", default-features = false }

# Third-party dependencies.

is-terminal = "0.4.7"
colored = "2.0"
anyhow = "1.0"
spinoff = "0.5.4"

# For the function names autosuggestion
distance = "0.4"
# For the inspect subcommand
bytesize = "1.0"
cfg-if = "1.0"
tempfile = "3.6.0"
serde = { version = "1.0.147", features = ["derive"] }
dirs = { version = "4.0" }
serde_json = { version = "1.0" }
target-lexicon = { version = "0.12", features = ["std"] }
prettytable-rs = "0.10.0"
wasmer-toml = { workspace = true }
indexmap = "1.9.2"
walkdir = "2.3.2"
regex = "1.6.0"
toml = "0.5.9"
url = "2.3.1"
libc = { version = "^0.2", default-features = false }
dialoguer = "0.10.2"
tldextract = "0.6.0"
hex = "0.4.3"
flate2 = "1.0.25"
cargo_metadata = "0.15.2"
tar = "0.4.38"
bytes = "1"
thiserror = "1.0.37"
log = "0.4.17"
semver = "1.0.14"
pathdiff = "0.2.1"
sha2 = "0.10.6"
object = "0.30.0"
wasm-coredump-builder = { version = "0.1.11", optional = true }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
async-trait = "0.1.68"
tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread"] }
once_cell = "1.17.1"
indicatif = "0.17.5"
opener = "0.6.1"
hyper = { version = "0.14.27", features = ["server"] }

# NOTE: Must use different features for clap because the "color" feature does not
# work on wasi due to the anstream dependency not compiling.
[target.'cfg(not(target_family = "wasm"))'.dependencies]
clap = { version = "4.2.7", features = ["derive", "env"] }
[target.'cfg(target_family = "wasm")'.dependencies]
clap = { version = "4.2.7", default-features = false, features = [
  "std",
  "help",
  "usage",
  "error-context",
  "suggestions",
  "derive",
  "env",
] }

[target.'cfg(not(target_arch = "riscv64"))'.dependencies]
reqwest = { version = "^0.11", default-features = false, features = [
  "rustls-tls",
  "json",
  "multipart",
] }

[target.'cfg(target_arch = "riscv64")'.dependencies]
reqwest = { version = "^0.11", default-features = false, features = [
  "native-tls",
  "json",
  "multipart",
] }

[build-dependencies]
chrono = { version = "^0.4", default-features = false, features = [
  "std",
  "clock",
] }

[target.'cfg(target_os = "linux")'.dependencies]
unix_mode = "0.1.3"

[features]
# Don't add the compiler features in default, please add them on the Makefile
# since we might want to autoconfigure them depending on the availability on the host.
default = [
  "sys",
  "wat",
  "wast",
  "compiler",
  "wasmer-artifact-create",
  "static-artifact-create",
]
backend = []
coredump = ["wasm-coredump-builder"]
sys = ["compiler", "wasmer-vm"]
jsc = ["backend", "wasmer/jsc", "wasmer/std"]
wast = ["wasmer-wast"]
host-net = ["virtual-net/host-net"]
wat = ["wasmer/wat"]
compiler = [
  "backend",
  "wasmer/compiler",
  "wasmer-compiler/translator",
  "wasmer-compiler/compiler",
]
wasmer-artifact-create = [
  "compiler",
  "wasmer/wasmer-artifact-load",
  "wasmer/wasmer-artifact-create",
  "wasmer-compiler/wasmer-artifact-load",
  "wasmer-compiler/wasmer-artifact-create",
  "wasmer-object",
]
static-artifact-create = [
  "compiler",
  "wasmer/static-artifact-load",
  "wasmer/static-artifact-create",
  "wasmer-compiler/static-artifact-load",
  "wasmer-compiler/static-artifact-create",
  "wasmer-object",
]
wasmer-artifact-load = [
  "compiler",
  "wasmer/wasmer-artifact-load",
  "wasmer-compiler/wasmer-artifact-load",
]
static-artifact-load = [
  "compiler",
  "wasmer/static-artifact-load",
  "wasmer-compiler/static-artifact-load",
]
experimental-io-devices = ["wasmer-wasix-experimental-io-devices"]
singlepass = ["wasmer-compiler-singlepass", "compiler"]
cranelift = ["wasmer-compiler-cranelift", "compiler"]
llvm = ["wasmer-compiler-llvm", "compiler"]
disable-all-logging = [
  "wasmer-wasix/disable-all-logging",
  "log/release_max_level_off",
]
headless = []
headless-minimal = ["headless", "disable-all-logging"]

# Optional
enable-serde = [
  "wasmer/enable-serde",
  "wasmer-vm/enable-serde",
  "wasmer-compiler/enable-serde",
  "wasmer-wasix/enable-serde",
]

[dev-dependencies]
assert_cmd = "2.0.11"
predicates = "3.0.3"
pretty_assertions = "1.3.0"

[target.'cfg(target_os = "windows")'.dependencies]
colored = "2.0.0"

[package.metadata.binstall]
pkg-fmt = "tgz"

[package.metadata.binstall.overrides.aarch64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-darwin-arm64.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-darwin-amd64.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.aarch64-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-aarch64.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.riscv64gc-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-riscv64gc.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.x86_64-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-amd64.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.x86_64-unknown-linux-musl]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-musl-amd64.{ archive-format }"
bin-dir = "bin/{ bin }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/wasmer-windows-amd64.{ archive-format }"
bin-dir = "bin/{ bin }.exe"

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]