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