Console¶
The console
module provides the interactive command-line interface. It can control PAMIQ-Core system externally.
PAMIQ Console¶
After launching a PAMIQ-Core system, you can connect to it using the pamiq-console
command-line tool:
The console prompt shows the current system state (e.g., active
, paused
, shutting down
) in parentheses.
Available Commands¶
h
orhelp
- Show all available commands and their descriptionsp
orpause
- Pause the systemr
orresume
- Resume the systemsave
- Save a checkpoint of the current system stateshutdown
- Shutdown the system (requires confirmation)q
orquit
- Exit the console (does not affect the running system)
Launch Options¶
The pamiq-console
command accepts the following options:
--host
: Hostname or IP address of the PAMIQ system (default: localhost)--port
: Port number for the web API connection (default: 8391)
Example with custom connection settings:
NOTE: You can modify the default address used by the system by changing the web_api_address
parameter in LaunchConfig.
Web API¶
PAMIQ-Core exposes a RESTful API that allows controlling the system over a network connection. This enables integration with external applications, monitoring tools, or custom interfaces.
API Endpoints¶
GET /api/status
- Retrieve the current system statusPOST /api/pause
- Pause the systemPOST /api/resume
- Resume the systemPOST /api/shutdown
- Shutdown the systemPOST /api/save-state
- Save the current system state
Example API Usage¶
Using curl
to interact with the API:
# Get current status
curl http://localhost:8391/api/status
# Pause the system
curl -X POST http://localhost:8391/api/pause
# Save current state
curl -X POST http://localhost:8391/api/save-state
Response format is JSON, for example:
System Status¶
The status endpoint returns one of the following values:
active
- System is running normallypausing
- System is in the process of pausingpaused
- System is fully pausedresuming
- System is in the process of resumingshutting down
- System is shutting down
Keyboard Shortcut Controller¶
PAMIQ-Core provides a keyboard shortcut controller. Users can pause/resume a agent by keyboard shortcuts.
Default Shortcuts¶
- Windows/Linux:
Alt+Shift+P
(Pause) andAlt+Shift+R
(Resume) - macOS:
Option+Shift+P
(Pause) andOption+Shift+R
(Resume) - Windows also supports
Alt+Shift+Q
to quit the controller
Installation¶
Note for Linux users: The following dependencies may be required:
Usage¶
macOS Accessibility Permissions¶
On macOS, you must grant Accessibility permissions to your terminal application before using pamiq-kbctl
:
- Go to System Settings → Privacy & Security → Accessibility
- Click the "+" button
- Add your terminal application (Terminal, iTerm2, VS Code Terminal, etc.)
- Restart your terminal application after granting permissions
Without these permissions, macOS will prevent keyboard monitoring and pamiq-kbctl
will not function properly.
Command-line Options¶
--host
: Hostname of the PAMIQ system (default: localhost)--port
: Port number for the web API (default: 8391)--pause-key
: Custom key combination for pause--resume-key
: Custom key combination for resume--quit-key
: Custom key combination to exit the controller
Example with custom shortcuts:
API Reference¶
For detailed information about the classes and methods in the console module, check out the API Reference.