# cargo-features = ["codegen-backend"]
# default-features = false

[package]
name = "manta-cli"
description = "Another CLI for ALPS"
keywords = ["cli", "productivity"]
publish = true
build = "build.rs"
version.workspace      = true
edition.workspace      = true
authors.workspace      = true
license-file           = "LICENSE"
repository.workspace   = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

# The package is named `manta-cli` (so the crates.io entry doesn't
# collide with anything called just "manta"), but the produced binary
# is plain `manta` — every CLI invocation users see in CLI.md / GUIDE.md
# is `manta …`.
[[bin]]
name = "manta"
path = "src/main.rs"

[build-dependencies]
clap                      = { version = "4.5.60", features = ["wrap_help"] }
clap_complete             = "4.5.66"
clap_mangen               = "0.3.0"

[dependencies]
# --- START MANTA DEPENDENCIES ---

# In-workspace library crate with wire types + pure helpers. `csm-rs`,
# `ochami-rs`, and `manta-backend-dispatcher` are reached only
# transitively through `manta-shared` — manta-cli no longer needs
# them as direct deps after the wire-type decoupling. Wire types
# (`NodeDetails`, `BootParameters`, etc.) come from
# `manta_shared::types::dto`; error types in `cli/` use `anyhow`.
manta-shared = { workspace = true }

# --- END MANTA DEPENDENCIES ---

regex              = { workspace = true }
nodeset = "0.5.0"
chrono = { version = "0.4.41", default-features = false }
anyhow = { version = "1.0.44", default-features = false }
reqwest = { version = "0.12.15", default-features = false, features = ["blocking", "json", "rustls-tls", "socks", "stream"] } # We need native-tls-vendored feature to be able to compile on `musl` target
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
serde_yaml = "0.9.34"
tracing = "0.1"
tokio = { version = "1.45", features = ["rt", "rt-multi-thread", "sync", "macros", "io-util", "io-std", "net", "time"] }
tokio-util = "0.7.4" # used by manta_console to create a read stream from container stdout
minijinja = { workspace = true } # SAT-file Jinja2 renderer
uuid = { version = "1.16.0", features = ["fast-rng", "v4"] }
git2 = { version = "0.21", default-features = false, features = ["vendored-openssl"] }
dialoguer = { version = "0.12.0", features = ["password"], default-features = false }
futures = { version = "0.3.31", default-features = false }
toml_edit = "0.22.27" # used to edit manta configuration file
clap = { version = "4.5.60", features = ["wrap_help"] }
clap_complete = "4.5.66"
clap_mangen = "0.3.0"
comfy-table = "7.2.2"
crossterm = { version = "0.29.0", default-features = false }               # terminal colors and raw mode
execute = "0.2.13"
is_executable = "1.0.1"
config = { version = "0.15.19", features = ["toml"], default-features = false }
tokio-tungstenite = "0.29"
# `manta upgrade` self-update plumbing. `self_update` provides cross-platform
# target-triple detection (`get_target()`) and the atomic binary-replacement
# helper. cargo-dist publishes Unix archives as `.tar.xz`, which `self_update`
# doesn't decode natively, so we pull in `xz2` + `tar` to extract the
# downloaded archive ourselves.
self_update = { version = "0.44", default-features = false, features = ["reqwest", "rustls"] }
xz2 = "0.1"
tar = "0.4"
semver = "1.0"

# Server-only deps (axum, axum-server, utoipa*, tower-http, rustls,
# rustls-pemfile) moved to crates/manta-server with the HTTP server itself.

[dev-dependencies]
assert_cmd = "2"
predicates = "3"
tempfile = "3"
toml = "0.9"

# Build profiles ([profile.release], [profile.dist]) live at the workspace
# root so they apply to every member.

# Config for `cargo release`. The hook runs from this crate's manifest
# directory, so the workspace CHANGELOG and cliff config are referenced
# via `../../` to keep them at the workspace root.
#
# `tag-name` overrides cargo-release's default `{{crate_name}}-v{{version}}`
# template so this crate cuts a workspace-wide tag (e.g. `v2.0.0-beta.35`)
# instead of `manta-cli-v...`. The release.yml workflow trigger filters
# to `v*` only, so only this single tag fires dist + a GitHub Release.
[package.metadata.release]
tag-name = "v{{version}}"
pre-release-hook = [
  "git",
  "cliff",
  "--config",
  "../../cliff.toml",
  "--repository",
  "../..",
  "-o",
  "../../CHANGELOG.md",
  "--tag",
  "{{version}}",
] # [Generates CHANGELOG automatically] (https://github.com/crate-ci/cargo-release/blob/master/docs/faq.md#maintaining-changelog) using [git cliff](https://github.com/orhun/git-cliff) as a dependency

# Per-package dist config. The man pages and shell-completion scripts live
# under this crate and only belong in the manta-cli tarball, so we attach
# the `include` here rather than at workspace level (where they would also
# end up in the manta-server tarball under the unified release).
[package.metadata.dist]
include = [
  "man",
  "autocomplete_shell_scripts",
]
