1use clap::{Parser, Subcommand};
2use foundry_cli::opts::{BuildOpts, GlobalArgs};
3use foundry_common::{
4 evm::EvmArgs,
5 version::{LONG_VERSION, SHORT_VERSION},
6};
7use std::path::PathBuf;
8
9foundry_config::merge_impl_figment_convert!(Chisel, build, evm);
11
12#[derive(Debug, Parser)]
14#[command(name = "chisel", version = SHORT_VERSION, long_version = LONG_VERSION)]
15pub struct Chisel {
16 #[command(flatten)]
18 pub global: GlobalArgs,
19
20 #[command(subcommand)]
21 pub cmd: Option<ChiselSubcommand>,
22
23 #[arg(long, help_heading = "REPL options")]
28 pub prelude: Option<PathBuf>,
29
30 #[arg(long, help_heading = "REPL options", long_help = format!(
32 "Disable the default `Vm` import.\n\n\
33 The import is disabled by default if the Solc version is less than {}.",
34 crate::session_source::MIN_VM_VERSION
35 ))]
36 pub no_vm: bool,
37
38 #[command(flatten)]
39 pub build: BuildOpts,
40
41 #[command(flatten)]
42 pub evm: EvmArgs,
43}
44
45#[derive(Debug, Subcommand)]
47pub enum ChiselSubcommand {
48 List,
50
51 Load {
53 id: String,
55 },
56
57 View {
59 id: String,
61 },
62
63 ClearCache,
65
66 Eval {
68 command: String,
70 },
71}