The Eagle [info] command is the interpreter's primary introspection
mechanism, providing 86 sub-commands for querying every aspect of the
runtime environment. Tcl's [info] offers roughly 25 sub-commands focused
on procedure, variable, and script introspection. Eagle extends this
dramatically with .NET/CLR integration, Windows-specific queries, database
connection tracking, plugin/module inspection, policy and security
introspection, culture/localization support, and detailed engine metadata.
Key differentiators from Tcl:
| Area | Tcl | Eagle |
|---|---|---|
| Sub-commands | ~25 | 86 |
| .NET integration | None | assembly, framework, runtime, appdomain, objects, delegates, bindertypes |
| Security introspection | None | policies, decision, administrator |
| Plugin system | [info loaded] (basic) |
plugin, pluginflags, loaded, modules |
| Database | None | connections, transactions |
| Windows-specific | None | hwnd, windows, windowtext |
| Culture/i18n | None | culture, cultures |
| Engine metadata | [info patchlevel] |
engine (9 attributes), setup, source |
| Process info | [info pid] (only) |
pid, ppid, previouspid, ptid, tid, processors |
| Command typing | None | cmdtype, cmdcount (with usage data), ensembles |
| Procedure protection | None | Obfuscated procedure access blocked |
Eagle's [info] command reflects the interpreter's deep .NET/CLR integration
and its role as an embeddable, security-aware scripting engine:
- Reflection infrastructure —
[info assembly],[info engine], and[info identifier]use .NET reflection (Assembly.FullName,FileVersionInfo, assembly attributes) to expose metadata - Security model —
[info policies],[info decision], and safe interpreter sub-command filtering give scripts visibility into the interpreter's security posture - Plugin architecture —
[info plugin],[info pluginflags],[info loaded], and[info modules]reflect Eagle's extensible plugin system - Embeddable runtime —
[info active],[info interps],[info appdomain], and[info context]support multi-interpreter and multi-AppDomain scenarios - Platform awareness — conditional compilation (
#if NATIVE,#if WINDOWS,#if DATA,#if SHELL) enables platform-specific sub-commands without runtime overhead on other platforms
| File | Role |
|---|---|
Commands/Info.cs (~4,589 lines) |
Command implementation: sub-command dispatch, option parsing, policy enforcement |
Components/Private/PolicyOps.cs |
AllowedInfoSubCommandNames — safe interpreter sub-command filtering |
Components/Private/GlobalState.cs |
System paths, active interpreters, process IDs |
Components/Private/RuntimeOps.cs |
Runtime introspection utilities |
Components/Public/Interpreter.cs (~124,855 lines) |
Introspection methods: ListCommands, VariablesToList, ObjectsToString, etc. |
Components/Public/ProcedureData.cs |
Procedure metadata: name, flags, arguments, body, location |
Components/Public/CommandData.cs |
Command metadata: name, flags, type, plugin association |
The [info] command is implemented as a single large switch statement
dispatching on sub-command name (Info.cs lines 152–4564). The
developers acknowledge this design limitation in a TODO comment (lines
70–72), noting that a dictionary-of-delegates approach would be
preferable, but the current approach preserves ease of adding
compile-time conditionals (#if guards) per sub-command.
Eagle's 86 [info] sub-commands are organized below by functional category.
Sub-commands marked (Eagle) have no Tcl equivalent. Sub-commands
marked (Enhanced) extend Tcl's version with additional options or
behavior.
Returns the argument list of procedure procName.
- With
defaultsset to true, includes default values usingNameAndDefaultformatting - Obfuscation protection: returns an error if the procedure has
ProcedureFlags.Obfuscatedset
proc greet {name {greeting Hello}} { puts "$greeting, $name" }
info args greet ;# name greeting
info args greet true ;# {name {}} {greeting Hello}Returns the body of procedure procName.
| Parameter | Default | Description |
|---|---|---|
showLines |
false |
Include line numbers in output |
useLocation |
false |
Use script location for start line number |
- Obfuscation protection: returns an error if
ProcedureFlags.Obfuscatedis set - Formatted via
FormatOps.ProcedureBody()
proc square {x} { expr {$x * $x} }
info body square ;# expr {$x * $x}
info body square true ;# (with line numbers)
info body square true true ;# (line numbers from script location)Returns 1 if argument arg of procedure procName has a default value,
0 otherwise. If a default exists, it is stored in varName.
- Obfuscation protection: blocked for obfuscated procedures
proc greet {name {greeting Hello}} { ... }
info default greet greeting defVal ;# 1 (defVal = "Hello")
info default greet name defVal ;# 0Returns a list of procedures matching pattern. Excludes hidden
procedures and named-argument procedures from the listing.
info procs ;# All visible procedures
info procs greet* ;# Procedures matching "greet*"Returns a list of named-argument procedures matching pattern.
info nprocs ;# All named-argument procedures
info nprocs greet* ;# Named-argument procedures matching "greet*"Returns the source file location of the specified procedure, or of the current script if no procedure name is given.
info source ;# /path/to/current/script.eagle
info source myProc ;# Source location of myProc
info source myProc true ;# Full source location detailsReturns 1 if the variable nameVarName exists, 0 otherwise.
Eagle extends Tcl's version with an optional valueVarName: if the
variable exists, its value is copied into valueVarName and 1 is
returned. This enables atomic check-and-read.
- Thread-safe: uses
lock (interpreter.InternalSyncRoot)
set x 42
info exists x ;# 1
info exists nosuch ;# 0
# Eagle extension: check-and-read
info exists x val ;# 1 (val = "42")
info exists nosuch val ;# 0 (val unchanged)Returns a list of global variables matching pattern.
info globals ;# All global variables
info globals tcl_* ;# Variables matching "tcl_*"Implementation: interpreter.VariablesToList(VariableFlags.GlobalOnly, ...)
Returns a list of local variables in the current scope matching pattern.
proc example {a b} {
set c 3
info locals ;# a b c
}Returns all variables in the current scope matching pattern.
Options:
| Option | Description |
|---|---|
-interpreter |
(Unsafe) Query a different interpreter's variables |
Eagle supports an InterpreterFlags.InfoVarsMayHaveGlobal flag that
causes [info vars] to include global variables merged with locals,
matching Tcl's behavior where [info vars] at the global level returns
globals.
info vars ;# All variables in current scope
info vars tcl_* ;# Filtered by patternReturns a list of system variables (interpreter-internal variables)
matching pattern.
info sysvars ;# System-level variablesImplementation: interpreter.VariablesToList(VariableFlags.System, ...)
Returns a list of variables that have been referenced but not yet defined.
info undefined ;# Variables referenced but not setReturns a list of linked variables (variable aliases created with
[upvar] or similar mechanisms) matching pattern.
info varlinks ;# All variable linksReturns the qualified name of the link target for the variable
varName (i.e., for variables created via [upvar] or similar
linking mechanisms), conforming to TIP #471.
info linkedname myLink ;# Qualified name of the link targetReturns a list of commands matching criteria. This is the most feature-rich sub-command, with extensive filtering options.
Options:
| Option | Description |
|---|---|
-interpreter |
(Unsafe) Query a different interpreter |
-sdk type |
Filter by SdkType: Default, Initialize, License, Security, NonCritical |
-breakpoint |
Include breakpoint commands |
-core |
Include core commands |
-library |
Include library procedures |
-nocore |
Exclude core commands |
-nolibrary |
Exclude library procedures |
-interactive |
Include interactive procedures |
-nocommands |
Skip command listing |
-noprocedures |
Skip procedure listing |
-noexecutes |
Skip IExecute listing |
-noaliases |
Skip alias commands |
-safe |
Include safe commands |
-unsafe |
Include unsafe commands |
-standard |
Include standard commands |
-nonstandard |
Include non-standard commands |
-hidden |
Include hidden commands/procedures |
-hiddenonly |
Show only hidden items |
-strict |
Compatibility flag (Eagle Beta) |
Security: When querying a different interpreter via -interpreter,
the calling interpreter's safe status is checked (not the target's).
Safe interpreters cannot see hidden items.
info commands ;# All visible commands
info commands string* ;# Commands matching "string*"
info commands -safe ;# Only safe commands
info commands -hidden ;# Include hidden commands
info commands -nocommands -library ;# Only library proceduresReturns the type of commandName as one of: [proc], alias, [object],
ensemble, or native.
The implementation inspects the IExecute interface hierarchy:
- Checks for
IAlias(unwrapsIWrapperif needed) - Checks for
ICommandand inspects for ensemble sub-commands viaPolicyOps.GetSubCommandsUnsafe()
info cmdtype puts ;# native
info cmdtype myProc ;# proc
info cmdtype myAlias ;# alias
info cmdtype string ;# ensembleReturns command execution counts. Eagle extends Tcl's simple counter
with detailed tracking via CommandCountType enum.
| Type | Description |
|---|---|
OperationCount |
Total operations executed |
CommandCount |
Named command invocations |
UnknownCount |
Unknown command invocations |
With path, queries a nested interpreter. With type, returns
specific count types or queries IUsageData interfaces for custom
usage tracking.
info cmdcount ;# Simple count (Tcl-compatible)
info cmdcount {} OperationCount ;# Specific counter typeReturns 1 if script is syntactically complete (balanced braces,
quotes, brackets), 0 otherwise.
Implementation: Parser.IsComplete() with engine and substitution flags.
info complete {set x [expr} ;# 0 (unbalanced bracket)
info complete {set x 42} ;# 1Returns the sub-commands of ensemble command name, optionally filtered
by pattern.
Options:
| Option | Description |
|---|---|
-hidden |
Boolean controlling hidden command lookup |
Lookup behavior:
-hidden true: looks up hidden commands only-hidden false: looks up regular commands only- No
-hidden: tries regular first, falls back to hidden in safe interpreters
info subcommands string ;# {compare first index is ...}
info subcommands string is* ;# Sub-commands matching "is*"Without name, returns a list of all known syntax names. With name,
returns the syntax values for that specific syntax entry.
info syntax ;# All syntax names
info syntax "string is" ;# Syntax for "string is"Implementation: SyntaxOps.GetNames() / SyntaxOps.GetValues()
Returns a list of ensemble commands matching pattern.
info ensembles ;# {string file info clock ...}Returns a list of expression functions matching criteria.
Options:
| Option | Description |
|---|---|
-interpreter |
(Unsafe) Query a different interpreter |
-safe |
Include safe functions |
-unsafe |
Include unsafe functions |
-standard |
Include standard functions |
-nonstandard |
Include non-standard functions |
-hidden |
Include hidden functions |
Safe interpreters cannot see hidden functions.
info functions ;# All visible functions
info functions sin* ;# Functions matching "sin*"
info functions -safe ;# Only safe functionsReturns a list of expression operators matching criteria.
Options:
| Option | Description |
|---|---|
-interpreter |
(Unsafe) Query a different interpreter |
-standard |
Include standard operators |
-nonstandard |
Include non-standard operators |
-hidden |
Include hidden operators |
info operators ;# All visible operators
info operators -hidden ;# Include hidden operatorsReturns the operands (arguments) of a function or operator. Tries as a function first, then as an operator.
info operands sin ;# Argument info for sin()
info operands + ;# Operand info for + operatorReturns the current call level (depth of procedure nesting).
proc inner {} { info level }
proc outer {} { inner }
outer ;# 2 (two levels of procedure nesting)Returns the call frame ID for the current level, providing a unique identifier for the execution frame.
info levelid ;# Unique frame identifierNot implemented. This sub-command exists as a compatibility stub for Tcl TIP #280 style stack frame introspection. Returns an error indicating the feature is not supported.
Returns the name of the currently executing script file. With new,
sets the script name (bidirectional getter/setter).
info script ;# /path/to/current/script.eagle
info script newscript.eagle ;# Set script nameReturns the full command-line of the current process.
Implementation: Environment.CommandLine
info cmdline ;# "eagle.exe -script test.eagle arg1 arg2"Returns the saved shell arguments.
info argv ;# {arg1 arg2 arg3}Returns 1 if the interpreter is in interactive mode, 0 otherwise.
info interactive ;# 1 (in shell) or 0 (in script)Returns library path information. With refresh true, forces a
refresh of the cached library path.
info library ;# /path/to/eagle/library
info library true ;# Refresh and return library pathReturns the current interpreter context information.
info context ;# Context detailsReturns the Windows idle time tick count via
WindowOps.GetLastInputTickCount(). Takes no arguments.
info lastinput ;# Tick count of last input eventReturns the operating system name and version.
- With
refreshtrue, queriesPlatformOps.GetOSVersion()directly - Safe interpreters cannot refresh (returns cached platform variable)
info os ;# "Windows NT 10.0.22621.0" or "Unix 5.15.0.0"Returns the machine hostname.
- With
refreshtrue, queriesEnvironment.MachineName - Safe interpreters cannot refresh
info hostname ;# "WORKSTATION01"Returns the current user name.
Implementation: PlatformOps.GetUserName(true)
info user ;# "jsmith"Returns 1 if the current process is running with administrator/root
privileges. Windows-only via native API check.
info administrator ;# 0 or 1Returns the current process ID.
Implementation: ProcessOps.GetId()
info pid ;# 12345Returns the parent process ID.
Implementation: NativeOps.GetParentProcessId()
info ppid ;# 12340Returns the process ID of the last process spawned by [exec].
Supports optional reset and explicit ID setting.
| Parameter | Description |
|---|---|
reset |
Boolean — reset the tracking |
newId |
Long — set a new value explicitly |
Thread-safe via lock (interpreter.InternalSyncRoot).
exec echo hello
info previouspid ;# PID of "echo" process
info previouspid true ;# Reset trackingReturns the number of logical processors.
Security: safe interpreters always report 1 to prevent
fingerprinting.
Implementation: Environment.ProcessorCount
info processors ;# 8 (or 1 in safe interpreter)Returns thread identification.
| Argument | Returns |
|---|---|
| (none) | System thread ID |
true |
Native thread ID |
false |
Managed (.NET) thread ID |
info tid ;# System thread ID
info tid true ;# Native thread ID
info tid false ;# Managed thread IDReturns a combined process/thread ID pair.
info ptid ;# "12345.67890"Returns the base path of the Eagle installation.
Implementation: GlobalState.GetBasePath()
info base ;# /usr/local/lib/EagleReturns the path to the binary executable. AppDomain-aware: in
non-default AppDomains, returns the entry assembly path instead of
BaseDirectory.
info binary ;# /usr/local/bin/eagle.exeReturns the name of the main executable.
Implementation: PathOps.GetUnixPath(PathOps.GetExecutableName())
info nameofexecutable ;# /usr/local/share/dotnet/dotnet (host/muxer on .NET Core)Returns the file extension of the executable.
info programextension ;# .exeReturns the platform-appropriate shared library extension.
info sharedlibextension ;# .dll (Windows), .so (Linux), .dylib (macOS)Returns the shell library path information.
Returns the platform newline character(s).
Implementation: Environment.NewLine
info newline ;# \r\n (Windows) or \n (Unix)Returns a string containing all recognized whitespace characters.
Implementation: Characters.WhiteSpaceChars
info whitespace ;# All whitespace charactersReturns the library search path.
Implementation: GlobalState.GetLibraryPath()
info path ;# /usr/local/lib/Eagle/libReturns the externals path (location of external dependencies).
Implementation: GlobalState.GetExternalsPath()
info externals ;# /usr/local/lib/Eagle/externalsReturns the .NET Framework version. The deprecated alias clr is
still accepted for backward compatibility.
- With
refreshtrue, queriesCommonOps.Runtime.GetFrameworkVersion() - Safe interpreters cannot refresh
- Returns cached platform variable when not refreshing
info framework ;# "4.0.30319.42000" or "6.0.11"
info clr ;# Same (deprecated alias)Returns extra .NET framework version information beyond the base version.
Implementation: CommonOps.Runtime.GetFrameworkExtraVersion()
info frameworkextra ;# Additional version detailsReturns the .NET runtime identifier.
info runtime ;# ".NET Framework" or ".NET" or "Mono"Returns detailed .NET runtime version information with platform-specific checks across multiple runtime environments.
info runtimeversion ;# Detailed runtime version stringReturns the current AppDomain ID.
Implementation: AppDomainOps.GetId(interpreter)
info appdomain ;# 1 (default AppDomain)Returns assembly information as a list of {FullName Location}.
| Parameter | Description |
|---|---|
| (none) | Eagle core assembly |
true |
Entry assembly (host application) |
Uses .NET reflection: Assembly.FullName, Assembly.Location.
info assembly ;# {Eagle, Version=1.0... /path/to/Eagle.dll}
info assembly true ;# Entry assembly infoReturns Eagle engine metadata. This is the most detailed version information sub-command, supporting 9 named attributes.
Attributes (via EngineAttribute enum):
| Attribute | Description |
|---|---|
Name |
Package name (Vars.Package.Name) |
Culture |
Assembly culture info |
Version |
Major.minor version |
PatchLevel |
Full assembly version |
Release |
Assembly release attribute |
SourceId |
Source control ID |
SourceTimeStamp |
Source timestamp |
StrongNameTag |
Strong name tag |
Configuration |
Build configuration (Debug/Release) |
| Parameter | Default | Description |
|---|---|---|
attribute |
— | Specific attribute to query |
refresh |
false |
Force refresh from assembly reflection |
all |
false |
Return all attributes |
Security: safe interpreters cannot use refresh.
info engine ;# Default engine info
info engine PatchLevel ;# "1.0.9999.12345"
info engine Configuration ;# "Release"
info engine Name false true ;# All attributes as dictionaryReturns the Tcl-compatibility patch level (not Eagle's build version;
use info engine PatchLevel for the build version).
info patchlevel ;# "8.4.21"Returns the emulated Tcl version. Eagle reports "8.4" as its Tcl
compatibility level.
info tclversion ;# "8.4"Returns setup/installation configuration information.
info setup ;# Setup configuration detailsReturns a list of .NET objects currently registered in the interpreter's object table.
info objects ;# All registered objects
info objects System* ;# Objects matching "System*"Implementation: interpreter.ObjectsToString(pattern, false)
Returns a list of dynamically created delegates (from [library declare]
or Reflection.Emit operations).
info delegates ;# All dynamic delegatesReturns a list of types that the script binder can marshal strings to.
Requires the interpreter to have an IScriptBinder with
HasChangeTypes() capability.
Thread-safe: locked access to interpreter sync root.
info bindertypes ;# All bindable types
info bindertypes System* ;# Filtered by patternReturns a list of registered interpreter callbacks matching pattern.
info callbacks ;# All registered callbacksImplementation: interpreter.CallbacksToString(pattern, false)
Returns a list of open I/O channels matching pattern.
info channels ;# {stdin stdout stderr ...}
info channels file* ;# Channels matching "file*"Returns a list of open database connections matching pattern.
info connections ;# All database connectionsImplementation: interpreter.DbConnectionsToString(pattern, false)
Returns a list of active database transactions matching pattern.
info transactions ;# All active transactionsImplementation: interpreter.DbTransactionsToString(pattern, false)
Returns a list of active interpreters matching pattern.
Implementation: GlobalState.ActiveInterpretersToString(pattern, false)
— this method is thread-safe.
info active ;# All active interpretersReturns a list of existing interpreters matching pattern. With all
set to true, includes all interpreters regardless of visibility.
info interps ;# All interpreters
info interps * true ;# All interpreters including hiddenReturns a list of loaded packages/plugins. Supports a -nocore option
to exclude core packages. With [interp], queries a specific interpreter.
With pattern, filters the results by pattern.
info loaded ;# All loaded packages
info loaded -nocore ;# Exclude core packages
info loaded -nocore {} MyPkg* ;# Filtered, non-core packagesReturns a list of loaded modules (dynamically emitted assemblies).
info modules ;# All loaded modulesReturns detailed information about a loaded plugin.
info plugin MyPlugin ;# Plugin informationReturns plugin flags for the plugin identified by name.
info pluginflags MyPlugin ;# Plugin flags for MyPluginReturns a list of registered security policies matching pattern.
info policies ;# All registered policiesImplementation: interpreter.PoliciesToString(pattern, false)
Returns policy decision information, optionally filtered by
PolicyDecisionType enum.
info decision ;# All policy decisions
info decision SecurityDecision ;# Specific decision typeImplementation: PolicyOps.QueryDecisions()
Gets or sets the current culture. Bidirectional: without argument returns the current culture; with argument, sets it.
Supports the string "null" to represent a null culture via opaque
object handle.
info culture ;# "en-US"
info culture "fr-FR" ;# Set to French
info culture "null" ;# Set to null cultureImplementation: CultureInfo constructor with exception handling.
Returns a list of all available cultures matching pattern.
Implementation: CultureInfo.GetCultures()
info cultures ;# All available cultures
info cultures en-* ;# English variantsReturns information about a named identifier (command, function, operator, etc.).
| Parameter | Default | Description |
|---|---|---|
name |
— | Identifier name |
kind |
Command |
IdentifierKind enum |
full |
false |
Return complete metadata dictionary |
Full output includes: type, kind, id, name, group, description, plugin, version, release, sourceid, sourcetimestamp, strongnametag, configuration.
info identifier puts ;# Basic info
info identifier puts Command true ;# Full metadata dictionary
info identifier sin Function true ;# Function metadataReturns window information for a window handle as a list:
{hWnd processId threadId}.
Platform-aware: handles both 32-bit and 64-bit pointer sizes
(IntPtr.Size == sizeof(long)).
info hwnd 0x001A02B4 ;# {hWnd processId threadId}Enumerates windows, optionally filtered by class name or window text.
| Parameter | Default | Description |
|---|---|---|
full |
false |
Include full info vs. handle only |
pattern |
— | Filter by class name or text |
Implementation: WindowOps.WindowEnumerator
info windows ;# All window handles
info windows true ;# Full window info
info windows true *Eagle* ;# Windows matching "Eagle"Returns the title/text of a window by handle.
info windowtext 0x001A02B4 ;# "Eagle Interactive Shell"The [info] command uses PolicyOps.AllowedInfoSubCommandNames to
restrict which sub-commands are available in safe interpreters. The
command is marked with CommandFlags.Unsafe | CommandFlags.Standard,
and implements IPolicyEnsemble for fine-grained sub-command control.
The following sub-commands are permitted in safe interpreters:
appdomain, args, body, commands, complete, context,
default, engine, ensembles, exists, functions, globals,
level, [library], locals, nprocs, objects, operands,
operators, patchlevel, procs, script, subcommands,
tclversion, vars
All other sub-commands are blocked, including:
- System information:
os,hostname,user,[pid],ppid,processors,tid,binary,path,cmdline,administrator - Security/policy:
policies,decision - .NET details:
assembly,framework,runtime,appdomain(allowed but with restricted refresh) - Database:
connections,transactions - Windows:
hwnd,windows,windowtext - Plugin internals:
plugin,pluginflags,modules
Even for allowed sub-commands that support a refresh parameter
(engine, patchlevel, tclversion), safe interpreters are blocked
from refreshing. They receive cached platform variable values instead,
preventing safe interpreters from triggering reflection operations.
Hidden item visibility
The security model uses the calling interpreter's safe status to
determine visibility of hidden items, not the target interpreter's.
This prevents a safe interpreter from using -interpreter to inspect
a parent interpreter's hidden commands:
listHidden = hidden && !interpreter.InternalIsSafe()[info processors] always returns 1 in safe interpreters to prevent
system fingerprinting.
Eagle supports procedure obfuscation via ProcedureFlags.Obfuscated.
When this flag is set, the [info] command blocks access to sensitive
procedure internals:
| Sub-command | Blocked behavior |
|---|---|
[info args] |
Returns error: "procedure {name} arguments are unavailable" |
[info body] |
Returns error: "procedure {name} body is unavailable" |
[info default] |
Returns error (cannot inspect argument defaults) |
This mechanism protects intellectual property in distributed Eagle scripts, preventing introspection of procedures that have been explicitly marked as obfuscated.
The [info] command uses .NET reflection extensively for engine and
assembly introspection:
[info assembly] accesses:
Assembly.FullName— fully qualified assembly nameAssembly.Location— filesystem path to the assembly
Entry assembly vs. Eagle assembly selection:
GlobalState.GetAssembly()— Eagle core assemblyGlobalState.GetEntryAssembly()— host application assembly
[info engine] uses multiple reflection APIs:
AttributeOps.GetAssemblyConfiguration()— Debug/ReleaseSharedAttributeOps.GetAssemblyRelease()— release stringSharedAttributeOps.GetAssemblySourceId()— source control IDSharedAttributeOps.GetAssemblySourceTimeStamp()— build timestampSharedAttributeOps.GetAssemblyStrongNameTag()— strong name tag
[info identifier] queries interfaces:
IIdentifier— base metadata (name, group, description)ISyntax— syntax informationIPlugin— plugin association and metadata
[info cmdtype] inspects the interface hierarchy:
IExecute— base execution interfaceIAlias→IWrapper— alias with target unwrappingICommand→PolicyOps.GetSubCommandsUnsafe()— ensemble detection
Several [info] sub-commands require thread-safe access to interpreter
state:
[info exists]withvalueVarName—lock (interpreter.InternalSyncRoot)[info bindertypes]— locked access to script binder[info previouspid]— locked access to process tracking[info vars]— frame-level locking marked withTRANSACTIONALcomment
Many sub-commands implement a lazy caching pattern:
- Check
interpreter.HavePlatformVariables()— are values cached? - If not cached and
refreshrequested (and not safe interpreter): query the actual system value - Otherwise: return the cached platform variable via
interpreter.GetVariableValue2()
This pattern appears in: framework, frameworkextra, hostname, os,
patchlevel, runtime, runtimeversion, tclversion.
The caching reduces overhead for frequently-queried values and provides a security boundary — safe interpreters always receive cached values and cannot trigger system queries.
The [info] command uses preprocessor symbols to include platform-specific
sub-commands only when the build supports them:
| Symbol | Sub-commands enabled |
|---|---|
NATIVE |
administrator, ppid, hwnd, windows, windowtext |
WINDOWS |
hwnd, windows, windowtext |
SHELL |
argv, shelllibrary |
DATA |
connections, transactions |
EMIT && NATIVE && LIBRARY |
delegates, modules |
!NET_STANDARD_20 |
setup, frameworkextra |
This ensures no runtime overhead for features not supported by the current platform build.
# List all procedures and inspect one
set procs [info procs my*]
foreach p $procs {
puts "Proc: $p"
puts " Args: [info args $p]"
puts " Type: [info cmdtype $p]"
}# Eagle extension: atomic check and read
if {[info exists myVar val]} {
puts "myVar = $val"
} else {
puts "myVar not set"
}# Handle commands differently by type
switch [info cmdtype $cmd] {
proc { puts "Procedure: [info body $cmd]" }
alias { puts "Alias command" }
ensemble { puts "Ensemble: [info subcommands $cmd]" }
native { puts "Built-in command" }
}# Adapt behavior based on runtime environment
set os [info os]
set framework [info framework]
set isAdmin [expr {[catch {info administrator} result] == 0 && $result}]
puts "OS: $os"
puts "Framework: $framework"
puts "Admin: $isAdmin"# Check engine version before using features
set ver [info engine PatchLevel]
set config [info engine Configuration]
puts "Eagle $ver ($config)"# Determine available info sub-commands
proc infoHas {subcmd} {
expr {![catch {info $subcmd}]}
}
if {[infoHas hostname]} {
puts "Host: [info hostname]"
} else {
puts "Hostname not available (safe interpreter)"
}# List active database connections and transactions
set conns [info connections]
set trans [info transactions]
puts "Open connections: [llength $conns]"
puts "Active transactions: [llength $trans]"# Save, change, and restore culture
set saved [info culture]
info culture "de-DE"
# ... German locale operations ...
info culture $saved# Find all safe, standard commands
set safeCmds [info commands -safe -standard]
# Find only library procedures
set libProcs [info commands -nocommands -library]
# Find hidden commands (requires unsafe interpreter)
set hidden [info commands -hiddenonly]# Get complete process/thread identity
puts "PID: [info pid]"
puts "PPID: [info ppid]"
puts "TID: [info tid]"
puts "Native: [info tid true]"
puts "Managed: [info tid false]"
puts "PTID: [info ptid]"| Feature | Tcl [info] |
Eagle [info] |
|---|---|---|
| Procedure introspection | args, body, default, procs | Same + nprocs, source, obfuscation protection |
| Variable introspection | exists, globals, locals, vars | Same + sysvars, undefined, varlinks, check-and-read exists |
| Command introspection | commands, complete | Same + cmdtype, cmdcount (detailed), ensembles, subcommands, syntax |
| Functions/operators | functions (Tcl 8.5+) | functions + operators + operands (with filtering options) |
| Call stack | level, frame | level + levelid; frame is stub |
| Script info | script, nameofexecutable | Same + cmdline, argv, interactive, context, lastinput |
| System info | hostname, pid | Same + os, user, administrator, ppid, previouspid, processors, tid, ptid |
| Path info | library, patchlevel, tclversion, sharedlibextension | Same + base, binary, path, externals, programextension, newline, whitespace |
| .NET/CLR | None | framework, frameworkextra, runtime, runtimeversion, appdomain, assembly |
| Engine metadata | patchlevel only | engine (9 attributes), setup, source |
| Objects/types | None | objects, delegates, bindertypes, callbacks |
| Database | None | connections, transactions |
| Plugins | loaded (basic) | loaded + plugin, pluginflags, modules |
| Security | None | policies, decision, safe sub-command filtering |
| Culture | None | culture, cultures |
| Windows | None | hwnd, windows, windowtext |
| Interpreters | interps (Tcl 8.x) | interps + active (thread-safe) |
| Identifiers | None | identifier (with IdentifierKind and full metadata) |
Many [info] sub-commands reveal system details that could aid an
attacker:
[info os],[info hostname],[info user]— system identification[info pid],[info ppid],[info processors]— process fingerprinting[info binary],[info path],[info base]— installation paths[info assembly],[info framework]— runtime version fingerprinting[info windows],[info hwnd]— window enumeration
All of these are blocked in safe interpreters via
PolicyOps.AllowedInfoSubCommandNames.
ProcedureFlags.Obfuscated provides a code protection boundary, but
it is enforced only at the [info] command level. Other introspection
mechanisms (direct interpreter API access from .NET code) may bypass
this protection. The obfuscation flag should be considered a
script-level access control, not a cryptographic protection.
The -interpreter option on [info commands], [info functions],
[info operators], and [info vars] allows querying other interpreters.
This option is marked Unsafe and is blocked in safe interpreters.
Security checks use the calling interpreter's safe status, preventing
privilege escalation.
The refresh restriction for safe interpreters means they may receive stale cached values for system information. This is by design — it prevents safe interpreters from triggering potentially expensive or information-revealing system queries.
- Source:
eagle/Eagle/Library/Commands/Info.cs— command implementation - Policy:
eagle/Eagle/Library/Components/Private/PolicyOps.cs—AllowedInfoSubCommandNames - Interpreter:
eagle/Eagle/Library/Components/Public/Interpreter.cs— introspection methods - Procedure data:
eagle/Eagle/Library/Components/Public/ProcedureData.cs - Command data:
eagle/Eagle/Library/Components/Public/CommandData.cs - Core language reference:
core_language.md§ Introspection →[info]command - Examples:
core_examples.md§ info - Tcl reference: Tcl
[info]manual page