A system patch for AmigaOS (1.3+ compatible) that intercepts standard intuition.library/AutoRequest() calls and prevents the graphical dialog window from opening and instead routes the text and choices directly to CLI.
  • C 98.2%
  • Makefile 1.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-09 15:34:04 +02:00
docs Update README 2026-07-09 14:49:53 +02:00
.gitignore Update .gitignore 2026-07-09 14:29:00 +02:00
CLIReq.c Bug fixes 2026-07-09 15:34:04 +02:00
LICENSE Initial commit 2026-07-09 12:08:06 +02:00
Makefile Bug fixes 2026-07-09 15:34:04 +02:00
README.md Bug fixes 2026-07-09 15:34:04 +02:00

CLIReq - Amiga Command Line Requester Intercept

Version: 0.1 Compatibility: AmigaOS 1.3 - 3.2+ (MMU-Safe for 68040/060, PiStorm, and Vampire)

Overview

CLIReq is an AmigaOS system patch that intercepts standard Intuition GUI popups (System Requesters) and seamlessly routes them directly to your Command Line Interface (Shell) as text prompts.

Instead of having your workflow interrupted by a blocking GUI window asking you to click "Proceed" or "Cancel", CLIReq prints the requester natively in your terminal. It intelligently extracts the keyboard shortcuts, enters RAW input mode, and lets you answer immediately with a single keystroke—no mouse required.

Features

  • Universal Intercept: Catches both legacy OS 1.3 AutoRequest calls and modern OS 2.0+ EasyRequestArgs calls.
  • Volume Request Handling: Hooks BuildSysRequest and BuildEasyRequestArgs to intercept background AmigaDOS volume requests (e.g., "Please insert volume...") by generating invisible "Fake Windows" in RAM.
  • RAW Mode Input: No need to press Enter. Just tap the corresponding letter (P for Proceed, A for Abort) and the program instantly continues.
  • Auto-Defaulting: Pressing Enter automatically selects the positive/first gadget. Pressing Escape automatically selects the negative/last gadget.
  • MMU & Accelerator Safe: Uses dynamic AllocMem for its internal assembly stubs and flushes the instruction cache (CacheClearU), making it 100% stable on 68040/060, PiStorm, and Apollo Vampire accelerators.
  • Thread Safe: Validates that the requesting task is a foreground CLI process (pr_CLI != 0) before routing to the terminal. Background system daemons fall back to standard GUI popups to prevent system crashes.

Installation & Usage

For standard use, you should run CLIReq in the background (e.g., from your S:Startup-Sequence or S:User-Startup):

Run >NIL: CLIReq

Arguments

CLIReq supports several arguments to customize its behavior, especially regarding how it handles background OS tasks.

Command Description
CLIReq (Default) CLI programs prompt in the terminal. Background tasks (like AmigaDOS missing volume requests) will still use standard GUI popups.
CLIReq NOSYSREQ CLI programs prompt in the terminal. Background OS requests are auto-cancelled (fails silently instead of showing a GUI).
CLIReq NOREQ Total Silence. All requests (CLI and Background) are auto-cancelled. Excellent for unattended batch scripts.
CLIReq STATUS Prints whether CLIReq is currently running, and which mode it is using.
CLIReq RESTORE Signals the resident background task to cleanly remove its patches, free its memory, and restore default AmigaOS behavior.
CLIReq ? Displays the help and usage information.

(Note: If you run CLIReq in the foreground, you can safely shut it down by pressing CTRL-C.)


Examples

Standard AmigaOS Behavior: If a program asks for a file, Intuition halts the CLI and draws a blocking GUI window in the middle of your Workbench screen.

With CLIReq Installed: The popup is blocked, and the text is routed to your shell:

--- SYSTEM REQUEST ---
Cannot open file 'data.bin'!

P) Proceed 
A) Abort 
Select: 

You simply press P or A on your keyboard (or Enter or Esc), and the program instantly continues.


Technical Details (Under the Hood)

When installed, CLIReq patches the following intuition.library LVOs (Library Vector Offsets):

  • -348 (AutoRequest)
  • -360 (BuildSysRequest)
  • -372 (FreeSysRequest)
  • -588 (EasyRequestArgs) (OS 2.0+ Only)
  • -594 (BuildEasyRequestArgs) (OS 2.0+ Only)
  • -600 (SysReqHandler) (OS 2.0+ Only)

For standard requesters, it intercepts the call, reads the text, outputs it to pr_COS, and reads from pr_CIS. For DOS Volume Requesters (which use the Build* and Handler loops), it allocates a dummy Window structure in RAM with a secret magic byte (0xDEADBEEF), runs the text prompt, stores the result, and feeds the fake window back to AmigaDOS to instantly resolve the handler.

Compilation

A Makefile is provided for building the project using VBCC and the Amiga NDK.

To compile the executable, simply run:

make

(or make all)

To clean up the directory by removing the compiled binary and any intermediate object files, run:

make clean