sig
  module API :
    sig
      val init :
        OpamTypes.repository ->
        OpamTypes.compiler ->
        jobs:int ->
        OpamTypes.shell ->
        OpamTypes.filename -> [ `ask | `no | `yes ] -> unit
      val list :
        print_short:bool ->
        filter:[ `all | `installable | `installed | `roots ] ->
        order:[ `depends | `normal ] ->
        exact_name:bool -> case_sensitive:bool -> string list -> unit
      val info : fields:string list -> string list -> unit
      val install : OpamTypes.name_set -> bool option -> bool -> unit
      val reinstall : OpamTypes.name_set -> unit
      val update : repos_only:bool -> OpamTypes.repository_name list -> unit
      val upgrade : OpamTypes.name_set option -> unit
      val remove :
        autoremove:bool -> force:bool -> OpamTypes.name_set -> unit
      module CONFIG :
        sig
          val config : OpamTypes.config -> unit
          val env : csh:bool -> sexp:bool -> fish:bool -> unit
          val setup :
            OpamTypes.user_config option ->
            OpamTypes.global_config option -> unit
          val setup_list : OpamTypes.shell -> OpamTypes.filename -> unit
          val exec : string -> unit
          val includes : is_rec:bool -> OpamTypes.name list -> unit
          val list : OpamTypes.name list -> unit
          val variable : OpamTypes.full_variable -> unit
          val subst : OpamTypes.basename list -> unit
        end
      module REPOSITORY :
        sig
          val list : short:bool -> unit
          val add :
            OpamTypes.repository_name ->
            OpamTypes.repository_kind ->
            OpamTypes.address -> priority:int option -> unit
          val remove : OpamTypes.repository_name -> unit
          val priority : OpamTypes.repository_name -> priority:int -> unit
        end
      module SWITCH :
        sig
          val switch : quiet:bool -> warning:bool -> OpamTypes.switch -> unit
          val install :
            quiet:bool ->
            warning:bool ->
            update_config:bool ->
            OpamTypes.switch -> OpamTypes.compiler -> unit
          val import : OpamTypes.filename option -> unit
          val export : OpamTypes.filename option -> unit
          val remove : OpamTypes.switch -> unit
          val reinstall : OpamTypes.switch -> unit
          val list : print_short:bool -> installed:bool -> all:bool -> unit
          val show : unit -> unit
        end
      module PIN :
        sig
          val pin : force:bool -> OpamTypes.pin -> unit
          val list : unit -> unit
        end
    end
  val global_lock : (unit -> unit) -> unit
  val switch_lock : (unit -> unit) -> unit
  val read_lock : (unit -> unit) -> unit
  val with_switch_backup : string -> (OpamState.state -> unit) -> unit
  module SafeAPI :
    sig
      val init :
        OpamTypes.repository ->
        OpamTypes.compiler ->
        jobs:int ->
        OpamTypes.shell ->
        OpamTypes.filename -> [ `ask | `no | `yes ] -> unit
      val list :
        print_short:bool ->
        filter:[ `all | `installable | `installed | `roots ] ->
        order:[ `depends | `normal ] ->
        exact_name:bool -> case_sensitive:bool -> string list -> unit
      val info : fields:string list -> string list -> unit
      val install : OpamTypes.name_set -> bool option -> bool -> unit
      val reinstall : OpamTypes.name_set -> unit
      val update : repos_only:bool -> OpamTypes.repository_name list -> unit
      val upgrade : OpamTypes.name_set option -> unit
      val remove :
        autoremove:bool -> force:bool -> OpamTypes.name_set -> unit
      module CONFIG :
        sig
          val config : OpamTypes.config -> unit
          val env : csh:bool -> sexp:bool -> fish:bool -> unit
          val setup :
            OpamTypes.user_config option ->
            OpamTypes.global_config option -> unit
          val setup_list : OpamTypes.shell -> OpamTypes.filename -> unit
          val exec : string -> unit
          val includes : is_rec:bool -> OpamTypes.name list -> unit
          val list : OpamTypes.name list -> unit
          val variable : OpamTypes.full_variable -> unit
          val subst : OpamTypes.basename list -> unit
        end
      module REPOSITORY :
        sig
          val list : short:bool -> unit
          val add :
            OpamTypes.repository_name ->
            OpamTypes.repository_kind ->
            OpamTypes.address -> priority:int option -> unit
          val remove : OpamTypes.repository_name -> unit
          val priority : OpamTypes.repository_name -> priority:int -> unit
        end
      module SWITCH :
        sig
          val switch : quiet:bool -> warning:bool -> OpamTypes.switch -> unit
          val install :
            quiet:bool ->
            warning:bool ->
            update_config:bool ->
            OpamTypes.switch -> OpamTypes.compiler -> unit
          val import : OpamTypes.filename option -> unit
          val export : OpamTypes.filename option -> unit
          val remove : OpamTypes.switch -> unit
          val reinstall : OpamTypes.switch -> unit
          val list : print_short:bool -> installed:bool -> all:bool -> unit
          val show : unit -> unit
        end
      module PIN :
        sig
          val pin : force:bool -> OpamTypes.pin -> unit
          val list : unit -> unit
        end
    end
end