config

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultConfigName = "aiscan.yaml"

Variables

View Source
var (
	DefaultProvider = "openai"
	DefaultBaseURL  = ""
	DefaultAPIKey   = ""
	DefaultModel    = ""

	DefaultScannerProxy = ""

	DefaultCyberhubURL  = ""
	DefaultCyberhubKey  = ""
	DefaultCyberhubMode = "merge"

	DefaultVerify = "auto"

	DefaultIOAURL      = ""
	DefaultIOANodeID   = ""
	DefaultIOANodeName = ""
	DefaultSpace       = ""

	DefaultTavilyKeys = ""
)
View Source
var ExtraCommands = map[string]bool{}
View Source
var ExtraScannerUsage = map[string]func() string{}
View Source
var ExtraSummaryEntries []string
View Source
var ExtraUsageEntries []string
View Source
var ScanUsageFunc func() string

ScanUsageFunc is set by the scan package init in non-mini builds.

View Source
var ScannerEnabled = true

ScannerEnabled reports whether built-in scanner commands are available. Defaults to true; cmd/agent sets it to false.

View Source
var Version = "dev"

Functions

func ApplyDefaults

func ApplyDefaults(option *Option)

func ApplyResolvedProviderOptions

func ApplyResolvedProviderOptions(option *Option, cfg agent.ProviderConfig)

func ApplySelectedSkills

func ApplySelectedSkills(text string, selected []string, store *skills.Store) (string, error)

func CLICommandSummary

func CLICommandSummary() string

func DataDir

func DataDir() string

DataDir returns the resolved .aiscan data directory. Priority: AISCAN_DATA_DIR env > config/CLI --data-dir > <binary_dir>/.aiscan

func DataSubDir

func DataSubDir(sub string) string

DataSubDir returns a subdirectory under DataDir, creating it if needed.

func FallbackProviderConfigs

func FallbackProviderConfigs(option *Option) []agent.ProviderConfig

func FormatInputs

func FormatInputs(inputs []string) string

func HasAgentOneShotInput

func HasAgentOneShotInput(opt *Option) bool

func InitDefaultConfig

func InitDefaultConfig() string

func IsScannerHelpRequest

func IsScannerHelpRequest(args []string) bool

func LoadAndApplyConfig

func LoadAndApplyConfig(option *Option) (string, error)

func LoadConfig

func LoadConfig(filename string, v interface{}) error

func MergeRemoteOption added in v0.2.8

func MergeRemoteOption(local *Option, remote *Option)

MergeRemoteOption merges remote config into local option. Local (non-empty) fields take priority.

func ProviderConfig

func ProviderConfig(option *Option) agent.ProviderConfig

func ResolveRuntimeConfig

func ResolveRuntimeConfig(option *Option) (string, error)

func ResolveString

func ResolveString(value, fallback string) string

func ResolveTask

func ResolveTask(opt *Option) (string, error)

func ScannerCommandAvailable

func ScannerCommandAvailable(name string) bool

func ScannerUsageLines

func ScannerUsageLines() string

func SetDataDir

func SetDataDir(dir string)

SetDataDir sets the data directory explicitly (from -c/config). Must be called before any DataDir() call (typically during config resolution).

func StaticScannerUsage

func StaticScannerUsage(name string) (string, bool)

func StdinIsTerminal

func StdinIsTerminal() bool

Types

type AgentOptions

type AgentOptions struct {
	Prompt         string   `short:"p" long:"prompt" description:"Natural language task for the agent"`
	Inputs         []string `short:"i" long:"input" description:"Target input: IP, URL, IP:port, or CIDR. Can specify multiple"`
	Skills         []string `short:"s" long:"skill" description:"Skill to apply (name or file path). Can specify multiple"`
	Tools          []string `` /* 126-byte string literal not displayed */
	TaskFile       string   `long:"task-file" description:"File containing task description"`
	Heartbeat      int      `` /* 132-byte string literal not displayed */
	Timeout        int      `long:"timeout" config:"timeout" description:"Overall timeout in seconds" default:"3600"`
	EvalCriteria   string   `` /* 146-byte string literal not displayed */
	EvalModel      string   `long:"eval-model" config:"eval_model" description:"Model for goal evaluation (defaults to main model)"`
	EvalMaxRetries int      `long:"eval-retries" config:"eval_retries" description:"Max goal evaluation retry rounds" default:"3"`
	WebURL         string   `long:"web-url" config:"web_url" description:"AIScan web server URL for remote REPL and PTY access"`
	Resume         string   `long:"resume" description:"Resume session from a saved session file path"`
	SaveSession    bool     `` /* 135-byte string literal not displayed */
}

type IOAClientArgs

type IOAClientArgs struct {
	Space     string
	MessageID string
}

type IOAConfig

type IOAConfig struct {
	URL           string
	NodeID        string
	NodeName      string
	Space         string
	RegisterTools bool
	AutoRegister  bool
	NodeMeta      map[string]any
}

type IOAOptions

type IOAOptions struct {
	IOAURL      string `long:"server-url" config:"url" description:"Server URL for agent connection (supports http://token@host:port)"`
	IOAToken    string `long:"server-token" config:"token" description:"Server access key (auto-generated if empty)"`
	IOANodeID   string `long:"node-id" description:"Existing node id for agent tools"`
	IOANodeName string `long:"node-name" config:"node_name" description:"Node name when auto-registering"`
	Space       string `long:"space" config:"space" description:"Space name" default:"default"`
	IOAJSON     bool   `long:"json" description:"Output query results in JSON format"`
}

type LLMOptions

type LLMOptions struct {
	Provider  string             `` /* 135-byte string literal not displayed */
	BaseURL   string             `long:"base-url" config:"base_url" description:"LLM API base URL (leave empty to use provider default)"`
	APIKey    string             `long:"api-key" config:"api_key" description:"LLM API key (or env: OPENAI_API_KEY, ANTHROPIC_API_KEY, AISCAN_API_KEY)"`
	Model     string             `long:"model" config:"model" description:"LLM model name"`
	LLMProxy  string             `long:"llm-proxy" config:"proxy" description:"Proxy for LLM API requests"`
	Providers []LLMProviderEntry `no-flag:"true" config:"providers" description:"Additional LLM providers for fallback or multi-model routing"`
	AI        bool               `long:"ai" description:"Analyze direct scanner output with an LLM"`
}

type LLMProviderEntry

type LLMProviderEntry struct {
	Provider string `config:"provider" yaml:"provider"`
	BaseURL  string `config:"base_url" yaml:"base_url"`
	APIKey   string `config:"api_key" yaml:"api_key"`
	Model    string `config:"model" yaml:"model"`
	Proxy    string `config:"proxy" yaml:"proxy"`
	Timeout  int    `config:"timeout" yaml:"timeout"`
	Images   *bool  `config:"images" yaml:"images,omitempty"`
}

type MiscOptions

type MiscOptions struct {
	ConfigFile string `short:"c" long:"config" description:"Path to config file (default: ./aiscan.yaml, <binary_dir>/aiscan.yaml)"`
	DataDir    string `long:"data-dir" config:"data_dir" description:"Data directory for cache, arsenal, history (default: <binary_dir>/.aiscan)"`
	InitConfig bool   `long:"init" description:"Generate default aiscan.yaml and exit"`
	ViewFile   string `short:"F" long:"view" description:"View a scan record JSONL file"`
	ViewFormat string `short:"o" long:"output" description:"Output format for -F: terminal (default), markdown" default:"terminal"`
	ViewOutput string `short:"f" long:"file" description:"Write -F output to file instead of stdout"`
	Debug      bool   `long:"debug" config:"debug" description:"Enable debug logging"`
	Verbose    []bool `short:"v" long:"verbose" description:"Increase verbosity (-v tools, -vv thinking)"`
	Quiet      bool   `short:"q" long:"quiet" config:"quiet" description:"Quiet mode — only show final result"`
	NoColor    bool   `long:"no-color" config:"no_color" description:"Disable ANSI colors in scanner output"`
	Version    bool   `long:"version" description:"Print version and exit"`
}

type Option

type Option struct {
	LLMOptions     `group:"LLM Options" config:"llm"`
	ScannerOptions `group:"Scanner Options" config:"cyberhub"`
	AgentOptions   `group:"Agent Options" config:"agent"`
	IOAOptions     `group:"Server Options" config:"ioa"`
	ReconOptions   `group:"Recon Options" config:"recon"`
	MiscOptions    `group:"Miscellaneous Options" config:"misc"`
	ScanConfig     ScanConfigOptions `no-flag:"true" config:"scan"`
}

func FetchRemoteConfig added in v0.2.8

func FetchRemoteConfig(webURL string) (*Option, error)

FetchRemoteConfig contacts the aiscan web server and returns an Option populated with the server-managed configuration. The caller merges it with local config (local wins).

type ReconOptions

type ReconOptions struct {
	FofaEmail    string `long:"fofa-email" config:"fofa_email" hidden:"true"`
	FofaKey      string `long:"fofa-key" config:"fofa_key" hidden:"true"`
	HunterToken  string `long:"hunter-token" config:"hunter_token" hidden:"true"`
	HunterAPIKey string `long:"hunter-api-key" config:"hunter_api_key" hidden:"true"`
	TavilyKey    string `long:"tavily-key" config:"tavily_key" hidden:"true"`
	ReconProxy   string `long:"recon-proxy" config:"proxy" hidden:"true"`
	ReconLimit   *int   `long:"recon-limit" config:"limit" hidden:"true"`
}

type RunMode

type RunMode string
const (
	RunModeAgent       RunMode = "agent"
	RunModeIOAServe    RunMode = "ioa serve"
	RunModeIOASpaces   RunMode = "ioa spaces"
	RunModeIOAMessages RunMode = "ioa messages"
	RunModeIOAContext  RunMode = "ioa context"
	RunModeIOANodes    RunMode = "ioa nodes"
	RunModeScanner     RunMode = "scanner"
	RunModeNoCommand   RunMode = ""
)

type RuntimeConfig

type RuntimeConfig struct {
	Provider      RuntimeProviderConfig
	Scanner       ScannerConfig
	Tools         ToolConfig
	IOA           *IOAConfig
	Logger        telemetry.Logger
	CLISkillPaths []string
	SkipEngines   bool
}

func AppConfig

func AppConfig(option *Option, features RuntimeFeatures, logger telemetry.Logger) RuntimeConfig

type RuntimeFeatures

type RuntimeFeatures struct {
	ProviderEnabled  bool
	ProviderOptional bool
	ToolsEnabled     bool
	AIEnabled        bool
	ScannerAI        bool
	Warning          string
}

type RuntimeProviderConfig

type RuntimeProviderConfig struct {
	Enabled   bool
	Config    agent.ProviderConfig
	Fallbacks []agent.ProviderConfig
	Optional  bool
}

type ScanConfigOptions

type ScanConfigOptions struct {
	Verify string `config:"verify"`
}

type ScannerCommands

type ScannerCommands struct {
	Scan    struct{} `command:"scan" description:"Run the scan pipeline"`
	Gogo    struct{} `command:"gogo" description:"Run gogo scanner"`
	Spray   struct{} `command:"spray" description:"Run spray scanner"`
	Katana  struct{} `command:"katana" description:"Run katana web crawler"`
	Zombie  struct{} `command:"zombie" description:"Run zombie weakpass scanner"`
	Neutron struct{} `command:"neutron" description:"Run neutron POC scanner"`
	Passive struct{} `command:"passive" description:"Run passive cyberspace recon"`
}

type ScannerConfig

type ScannerConfig struct {
	CyberhubURL  string
	CyberhubKey  string
	CyberhubMode string
	AIEnabled    bool
	VerifyMode   string
	Proxy        string
	FofaEmail    string
	FofaKey      string
	HunterToken  string
	HunterAPIKey string
	ReconProxy   string
	ReconLimit   int
}

type ScannerOptions

type ScannerOptions struct {
	CyberhubURL  string `long:"cyberhub-url" config:"url" description:"Cyberhub server URL for loading fingers/templates"`
	CyberhubKey  string `long:"cyberhub-key" config:"key" description:"Cyberhub API key"`
	CyberhubMode string `long:"cyberhub-mode" config:"mode" description:"Cyberhub resource mode: merge or override"`
	Proxy        string `` /* 151-byte string literal not displayed */
}

type ToolConfig

type ToolConfig struct {
	Enabled       bool
	BashTimeout   int
	TavilyKeys    string
	OptionalTools []string // optional tool groups to enable (e.g. "search", "browser")
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL