CMDSCOUT lists every custom command defined by a LISP file without loading it. This becomes indispensable the moment a library passes about fifty routines — you are handed a .lsp file and you need to know what commands it would add before you commit to loading it.
What CommandScout does
Loading an unknown file has two risks. It might redefine a command you already rely on, quietly, so that TAPE stops doing what you expect. And it might run startup code you have not read, at load time, before you have typed anything at all.
Reading the file first removes both. You see the command list, decide, and load it or do not.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
CMDSCOUT. - Choose the
.lspfile to inspect. - Read the list of commands it would define.
How it works
The file is read as plain text and scanned with a regular expression for the pattern that defines a command:
\(\s*defun\s+c:(\S+)
which reads as: an opening bracket, optional whitespace, the word defun, whitespace, c:, and then a capture of the run of non-space characters that follows — the command name.
Because this is pure text matching, no code from the file is ever evaluated. A file cannot do anything to your session merely by being inspected. That is the entire safety property, and it is why the routine reads rather than loads.
The regular expression engine and the file reader both come from Windows Scripting COM objects rather than from AutoLISP, which has no native regex support.
Notes and limits
- It finds command definitions, not everything a file does. Helper functions, reactors and startup side effects are not commands and will not be listed.
- A command defined by generated code will be missed. If a file builds a
defunat run time rather than writing it literally, text matching cannot see it. That is rare, and it is the trade for never evaluating anything. - Windows only, because it uses Windows Scripting COM objects for the regular expression engine.
- It reads the file and changes nothing — not the drawing, not your session, not the file itself.
Download and details
| Name | CommandScout — list the commands a LISP file defines, without loading it |
| Download | CommandScout.lsp — 6.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | CMDSCOUT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 6.6 KB, 163 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| Compatibility | AutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- USAGELOG LISP — record which commands actually get used
- STARTUPBUILDER LISP — decide what loads automatically once you have chosen
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program