[package]
edition = "2024"
rust-version = "1.85"
name = "destructive_command_guard"
version = "0.4.2"
authors = [
"Jeffrey Emanuel <jeff@jeffreyemanuel.dev>",
"Dowwie <dowwie@gmail.com>",
]
build = "build.rs"
exclude = [
".github/",
".beads/",
"scripts/",
"*.md",
"!README.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A Claude Code hook that blocks destructive commands before they execute"
homepage = "https://github.com/Dicklesworthstone/destructive_command_guard"
readme = "README.md"
keywords = [
"destructive",
"safety",
"claude",
"hook",
"guard",
]
categories = [
"command-line-utilities",
"development-tools",
]
license = "MIT"
repository = "https://github.com/Dicklesworthstone/destructive_command_guard"
resolver = "2"
[features]
legacy-output = []
rayon = ["dep:rayon"]
rich-output = ["dep:rich_rust"]
[lib]
name = "destructive_command_guard"
path = "src/lib.rs"
[[bin]]
name = "dcg"
path = "src/main.rs"
[[test]]
name = "agent_exit_codes"
path = "tests/agent_exit_codes.rs"
[[test]]
name = "agent_hook_output"
path = "tests/agent_hook_output.rs"
[[test]]
name = "agent_json_format"
path = "tests/agent_json_format.rs"
[[test]]
name = "agent_profile_comprehensive"
path = "tests/agent_profile_comprehensive.rs"
[[test]]
name = "allowlist_command_tests"
path = "tests/allowlist_command_tests.rs"
[[test]]
name = "cli_e2e"
path = "tests/cli_e2e.rs"
[[test]]
name = "confidence_scoring"
path = "tests/confidence_scoring.rs"
[[test]]
name = "config_error_repro"
path = "tests/config_error_repro.rs"
[[test]]
name = "config_toggles_e2e"
path = "tests/config_toggles_e2e.rs"
[[test]]
name = "debug_heredoc_extraction"
path = "tests/debug_heredoc_extraction.rs"
[[test]]
name = "disk_tests"
path = "tests/disk_tests.rs"
[[test]]
name = "doc_allow_once_consistency"
path = "tests/doc_allow_once_consistency.rs"
[[test]]
name = "doc_pack_list_consistency"
path = "tests/doc_pack_list_consistency.rs"
[[test]]
name = "env_s_repro"
path = "tests/env_s_repro.rs"
[[test]]
name = "external_pack_validation"
path = "tests/external_pack_validation.rs"
[[test]]
name = "fast_path_verification"
path = "tests/fast_path_verification.rs"
[[test]]
name = "generate_pack_docs"
path = "tests/generate_pack_docs.rs"
[[test]]
name = "git_bypass"
path = "tests/git_bypass.rs"
[[test]]
name = "golden_isomorphism"
path = "tests/golden_isomorphism.rs"
[[test]]
name = "golden_json_tests"
path = "tests/golden_json_tests.rs"
[[test]]
name = "heredoc_pack_gap"
path = "tests/heredoc_pack_gap.rs"
[[test]]
name = "history_full_flow"
path = "tests/history_full_flow.rs"
[[test]]
name = "history_integration"
path = "tests/history_integration.rs"
[[test]]
name = "memory_tests"
path = "tests/memory_tests.rs"
[[test]]
name = "pattern_audit"
path = "tests/pattern_audit.rs"
[[test]]
name = "permissions_tests"
path = "tests/permissions_tests.rs"
[[test]]
name = "regression_corpus"
path = "tests/regression_corpus.rs"
[[test]]
name = "regression_heredoc_masking"
path = "tests/regression_heredoc_masking.rs"
[[test]]
name = "regression_path_anchors"
path = "tests/regression_path_anchors.rs"
[[test]]
name = "repro_binary_bypass"
path = "tests/repro_binary_bypass.rs"
[[test]]
name = "repro_comment_fp"
path = "tests/repro_comment_fp.rs"
[[test]]
name = "repro_context_bypass"
path = "tests/repro_context_bypass.rs"
[[test]]
name = "repro_context_depth"
path = "tests/repro_context_depth.rs"
[[test]]
name = "repro_context_tokenizer"
path = "tests/repro_context_tokenizer.rs"
[[test]]
name = "repro_echo_fp"
path = "tests/repro_echo_fp.rs"
[[test]]
name = "repro_env_parsing"
path = "tests/repro_env_parsing.rs"
[[test]]
name = "repro_git_bypasses"
path = "tests/repro_git_bypasses.rs"
[[test]]
name = "repro_heredoc_indent"
path = "tests/repro_heredoc_indent.rs"
[[test]]
name = "repro_inline_bypass"
path = "tests/repro_inline_bypass.rs"
[[test]]
name = "repro_line_continuation_bypass"
path = "tests/repro_line_continuation_bypass.rs"
[[test]]
name = "repro_line_continuation_split"
path = "tests/repro_line_continuation_split.rs"
[[test]]
name = "repro_newline_separator"
path = "tests/repro_newline_separator.rs"
[[test]]
name = "repro_normalization_bypass"
path = "tests/repro_normalization_bypass.rs"
[[test]]
name = "repro_redirection_bypass"
path = "tests/repro_redirection_bypass.rs"
[[test]]
name = "repro_restic_quoted"
path = "tests/repro_restic_quoted.rs"
[[test]]
name = "repro_rm_multi_arg"
path = "tests/repro_rm_multi_arg.rs"
[[test]]
name = "repro_safe_pattern_bypass"
path = "tests/repro_safe_pattern_bypass.rs"
[[test]]
name = "repro_windows_exe"
path = "tests/repro_windows_exe.rs"
[[test]]
name = "repro_wrapper_bypass"
path = "tests/repro_wrapper_bypass.rs"
[[test]]
name = "robot_mode"
path = "tests/robot_mode.rs"
[[test]]
name = "scan_extractor_integration"
path = "tests/scan_extractor_integration.rs"
[[test]]
name = "security_regressions"
path = "tests/security_regressions.rs"
[[test]]
name = "security_regressions_v2"
path = "tests/security_regressions_v2.rs"
[[test]]
name = "security_regressions_v3"
path = "tests/security_regressions_v3.rs"
[[test]]
name = "stdin_batch_mode"
path = "tests/stdin_batch_mode.rs"
[[test]]
name = "suggest_allowlist_e2e"
path = "tests/suggest_allowlist_e2e.rs"
[[test]]
name = "suggestion_integration"
path = "tests/suggestion_integration.rs"
[[test]]
name = "suggestion_scoring"
path = "tests/suggestion_scoring.rs"
[[test]]
name = "temporary_allowlist_tests"
path = "tests/temporary_allowlist_tests.rs"
[[test]]
name = "test_explanations"
path = "tests/test_explanations.rs"
[[test]]
name = "tui_e2e"
path = "tests/tui_e2e.rs"
[[test]]
name = "update_rollback"
path = "tests/update_rollback.rs"
[[bench]]
name = "heredoc_perf"
path = "benches/heredoc_perf.rs"
harness = false
[[bench]]
name = "regex_automata_comparison"
path = "benches/regex_automata_comparison.rs"
harness = false
[dependencies.aho-corasick]
version = "1.1"
[dependencies.ast-grep-core]
version = "0.40"
[dependencies.ast-grep-language]
version = "0.40"
features = [
"tree-sitter-bash",
"tree-sitter-python",
"tree-sitter-javascript",
"tree-sitter-typescript",
"tree-sitter-ruby",
"tree-sitter-go",
"tree-sitter-php",
]
default-features = false
[dependencies.async-trait]
version = "0.1.89"
[dependencies.base64]
version = "0.22"
[dependencies.chrono]
version = "0.4"
features = [
"std",
"clock",
"serde",
]
default-features = false
[dependencies.clap]
version = "4.5"
features = [
"derive",
"env",
]
[dependencies.clap_complete]
version = "4.5"
[dependencies.colored]
version = "3.1"
[dependencies.comfy-table]
version = "7.2"
[dependencies.console]
version = "0.16"
[dependencies.ctrlc]
version = "3.5.1"
[dependencies.dirs]
version = "6.0"
[dependencies.fancy-regex]
version = "0.17"
[dependencies.flate2]
version = "1.0"
[dependencies.fs2]
version = "0.4"
[dependencies.fsqlite]
version = "0.1.1"
features = ["fts5"]
[dependencies.fsqlite-error]
version = "0.1.1"
[dependencies.fsqlite-types]
version = "0.1.1"
[dependencies.glob]
version = "0.3"
[dependencies.hmac]
version = "0.12"
[dependencies.indicatif]
version = "0.18"
[dependencies.inquire]
version = "0.9"
[dependencies.memchr]
version = "2.7"
[dependencies.once_cell]
version = "1.19"
[dependencies.rand]
version = "0.10"
features = [
"std",
"thread_rng",
]
default-features = false
[dependencies.ratatui]
version = "0.30"
features = ["crossterm"]
default-features = false
[dependencies.rayon]
version = "1.11"
optional = true
[dependencies.regex]
version = "1.10"
[dependencies.rich_rust]
version = "0.2.0"
features = ["full"]
optional = true
[dependencies.rust-mcp-sdk]
version = "0.8.3"
features = [
"server",
"stdio",
"macros",
]
default-features = false
[dependencies.self_update]
version = "0.42"
features = [
"rustls",
"archive-tar",
"archive-zip",
"compression-flate2",
]
default-features = false
[dependencies.semver]
version = "1.0"
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.serde_yaml]
version = "0.9"
[dependencies.sha2]
version = "0.10"
[dependencies.smallvec]
version = "1.15.1"
[dependencies.tokio]
version = "1.49"
features = ["rt-multi-thread"]
[dependencies.toml]
version = "1.0"
[dependencies.toml_edit]
version = "0.25"
[dependencies.tracing]
version = "0.1"
[dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]
[dev-dependencies.assert_cmd]
version = "2.0"
[dev-dependencies.criterion]
version = "0.8"
features = ["html_reports"]
[dev-dependencies.libc]
version = "0.2"
[dev-dependencies.predicates]
version = "3.1"
[dev-dependencies.proptest]
version = "1.4"
[dev-dependencies.regex-automata]
version = "0.4"
[dev-dependencies.tempfile]
version = "3.14"
[dev-dependencies.walkdir]
version = "2.5"
[dev-dependencies.which]
version = "8.0"
[build-dependencies.vergen-gix]
version = "10.0.0-beta.5"
features = [
"build",
"cargo",
"rustc",
]
[lints.clippy]
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
cognitive_complexity = "allow"
default_trait_access = "allow"
derivable_impls = "allow"
doc_link_with_quotes = "allow"
doc_markdown = "allow"
field_reassign_with_default = "allow"
fn_params_excessive_bools = "allow"
if_not_else = "allow"
implicit_hasher = "allow"
items_after_statements = "allow"
iter_without_into_iter = "allow"
len_without_is_empty = "allow"
len_zero = "allow"
manual_let_else = "allow"
manual_string_new = "allow"
many_single_char_names = "allow"
map_unwrap_or = "allow"
match_same_arms = "allow"
match_wildcard_for_single_variants = "allow"
missing_const_for_fn = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
needless_for_each = "allow"
needless_pass_by_value = "allow"
option_if_let_else = "allow"
print_literal = "allow"
redundant_clone = "allow"
redundant_pub_crate = "allow"
ref_option_ref = "allow"
return_self_not_must_use = "allow"
significant_drop_tightening = "allow"
similar_names = "allow"
single_match = "allow"
single_match_else = "allow"
string_add = "allow"
string_add_assign = "allow"
struct_excessive_bools = "allow"
struct_field_names = "allow"
suboptimal_flops = "allow"
too_many_arguments = "allow"
too_many_lines = "allow"
trivially_copy_pass_by_ref = "allow"
uninlined_format_args = "allow"
unnested_or_patterns = "allow"
unused_async = "allow"
unused_self = "allow"
use_self = "allow"
wildcard_imports = "allow"
write_literal = "allow"
[lints.clippy.all]
level = "warn"
priority = -1
[lints.clippy.nursery]
level = "warn"
priority = -1
[lints.clippy.pedantic]
level = "warn"
priority = -1
[lints.rust]
[profile.dev]
opt-level = 1
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true