Print@SoC Python CLI
Python wrapper for the Print@SoC desktop app and MCP stdio server.
Installation
pip install print-at-soc
Commands
All command names launch the same wrapper:
print-at-soc
print-soc
psoc
Useful options:
print-soc --help
print-soc --version
print-soc --install
print-soc --path
print-soc --doctor
Submit a file without opening the desktop UI:
print-soc print assignment.pdf --printer psts-dx --copies 1
Inspect live SoC printing state:
print-soc printer list --username your-soc-id --ask-password
print-soc job list --printer psts-dx --json
print-soc quota show --json
The inspection commands support --server stu|stf, --host, --port,
--username, --password-stdin, --ask-password, --key-path, and the
PSOC_SSH_* environment variables listed below. Human-readable commands print
tables/key-value output; pass --json for scripts.
Updates and uninstall
print-soc self update --check
print-soc self update
print-soc self update --auto apply
print-soc self update --rollback
print-soc self uninstall --dry-run
print-soc self uninstall --purge --remove-cli
Updates verify downloads before replacing the desktop and retain a previous
version for rollback. Normal CLI desktop launches check daily (notification by
default); automatic installation is opt-in on macOS/Linux. The uninstall wizard
previews owned components and lets you retain data or purge app data and saved
credentials. Use --plain for simple text, or --non-interactive --yes in scripts.
Python/npm package upgrades and CUPS service refreshes remain separate from
desktop updates. See maintenance and recovery details, including Windows
native-installer limits and the intentionally retained non-secret lock file.
Virtual Printer
macOS and Linux can install a CUPS virtual printer queue named PrintAtSoC.
After installation, normal apps can print to Print@SoC Virtual Printer; the CUPS
queue uses the bundled PDF driver (not a raw queue), and the CUPS
backend forwards the spool file to the configured SoC SSH server and submits it
with remote lpr. The default remote queue is psts-dx; use --printer to
choose another SOCprint queue such as psc008-dx or psts-sx.
Install the Python package, configure SSH/default printer settings, and install the system queue:
pip install print-at-soc
print-soc --install-virtual-printer --username your-soc-id --ask-password --printer psts-dx
Configuration is stored in ~/.PrintAtSoC/virtual-printer.json with mode 0600.
Use --password-stdin instead of --ask-password for scripted setup, or use
--key-path for SSH key authentication. The default server is
stu.comp.nus.edu.sg; pass --server stf for staff accounts.
Start the interactive installer with:
print-soc virtual-printer install
The terminal wizard offers arrow-key menus for the server, authentication, paper and sides; validates typed values; hides password input; and previews the account and destination before asking to install. Decline the confirmation to edit the settings or cancel before any system changes. Animated stage indicators run only while work is happening, and stop before password prompts. Ctrl+C exits cleanly. The result explains how to use the printer or shows stage-specific repair steps when setup fails. Re-running setup repairs an existing queue.
# Walk through setup without passwords, sudo or system changes:
print-soc virtual-printer install --dry-run
# Simple numbered prompts, without colors or animation:
print-soc virtual-printer install --plain
# Scripted installation: authenticate the administrator separately first.
sudo -v
print-soc virtual-printer install --non-interactive --username YOUR_SOC_ID --key-path ~/.ssh/id_ed25519
Scripts can provide a password through --password-stdin (one line) or the
existing PSOC_SSH_PASSWORD environment variable. Avoid --password in shell
history. Non-interactive mode never prompts, including for sudo; missing inputs
produce an actionable error and nonzero exit code. Redirected output, NO_COLOR
and TERM=dumb produce plain logs. --yes skips only the final confirmation;
use --non-interactive to disable all prompts. Authentication sources are
mutually exclusive. Exit status is 0 for success/declined review, 1 for a
handled failure, 2 for invalid command arguments, and 130 for Ctrl+C/EOF.
A successful installation verifies the local queue, not remote SSH connectivity
or physical printing. Setup never automatically submits a test page.
In the desktop app, open Settings → Advanced → Add system printer.
Setup opens Terminal to request the SoC password and administrator authentication;
return to the app and refresh integration status after installation completes.
The same installer is available through the command above. Run it as your normal
user: it requests sudo only for system changes. A working CUPS service and a
system/Homebrew Python installed outside the home directory are required.
The installer snapshots the backend and its installed dependencies into a
root-owned system directory (/Library/Application Support/PrintAtSoC/cups on
macOS, /usr/local/lib/print-at-soc/cups on Linux). It stores the forwarding
configuration in /etc/print-at-soc/virtual-printer.json with mode 0600 and
copies an explicitly configured SSH key there with the same permissions. This
allows the CUPS service to run without access to a logged-in user's home or SSH
agent. All local Print@SoC queues use this system forwarding account. Re-run the
installer after upgrading the CLI to update the installed backend snapshot.
The normal user configuration remains available for CLI commands; configuring
an installed virtual printer also updates its system configuration.
Useful virtual printer commands:
print-soc virtual-printer configure --server stu --username your-soc-id --ask-password --printer psts-dx
print-soc virtual-printer install
print-soc virtual-printer status
print-soc virtual-printer uninstall
# Backward-compatible flag forms remain available:
print-soc --configure-virtual-printer --server stu --username your-soc-id --ask-password --printer psts-dx
print-soc --install-virtual-printer
print-soc --virtual-printer-status
print-soc --uninstall-virtual-printer
Run cleanup before uninstalling the Python package:
print-soc --uninstall-virtual-printer
pip uninstall print-at-soc
pip uninstall only removes Python package files. It does not know about CUPS
queues, backend files, or Print@SoC config created outside package metadata.
Windows virtual printer support is not installed by this command. Windows needs the modern Print Support App/MSIX virtual printer path rather than a CUPS backend.
Start the MCP server over stdio:
print-soc mcp
psoc mcp
MCP mode requires the desktop binary to already be installed. Run print-soc --install first if needed.
MCP Environment Variables
connect_ssh can read credentials from arguments or these environment variables:
PSOC_SSH_SERVER=stu
PSOC_SSH_HOST=stu.comp.nus.edu.sg
PSOC_SSH_PORT=22
PSOC_SSH_USERNAME=your-soc-username
PSOC_SSH_PASSWORD=your-password
PSOC_SSH_KEY_PATH=/path/to/private/key
PSOC_SSH_KEY_PASSPHRASE=optional-passphrase
MCP Tools
connect_sshdisconnect_sshconnection_statuslist_print_queuescheck_print_quotacheck_printer_queuesubmit_pdf_print_job
submit_pdf_print_job requires confirm=true because it submits a real print job.
Requirements
- Python 3.8+
- macOS, Linux, or Windows x64/arm64 as supported by the released desktop binaries
- NUS SoC network access or VPN for SSH printing
0.1.1
- Fix Windows installer execution and MSI asset selection; report unsuccessful installations.
- Run
--doctorwithout downloading or launching the desktop app. - Support passphrase-protected SSH keys through Paramiko.
- Clean up uploaded print files when a remote print command fails.
The desktop application is downloaded separately from GitHub Releases. This Python package update does not replace the desktop release.
macOS raw-queue installation error
If an older installation reports Raw queues are no longer supported on macOS,
upgrade the Python package and reinstall the queue:
python -m pip install --upgrade print-at-soc
python -m print_at_soc virtual-printer install --username your-soc-id --ask-password
The installer now registers the packaged PDF PPD on both macOS and Linux. A4/A3 and duplex choices from the print dialog are forwarded to the SoC submission. No real print job is sent while installing the queue.
Metadata
Release files for print-at-soc 0.375.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| print_at_soc-0.375.4.tar.gz | 73.8 kB | Without provenance | Details for print_at_soc-0.375.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| print_at_soc-0.375.4-py3-none-any.whl | Python 3 | none | any | Details for print_at_soc-0.375.4-py3-none-any.whl |
Total release size: 133.8 kB
Release files / print_at_soc-0.375.4.tar.gz
| Download URL | print_at_soc-0.375.4.tar.gz |
|---|---|
| Size | 73.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
172e7f8019cf18d14a07de24f063fa99645e104de49e00517347aeb211de8303
|
|
BLAKE2b-256 checksum How to use checksums |
222e5e194db2b8a4cf835101b51baeb4aa059732c7b126fa4f11b6d824637d25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / print_at_soc-0.375.4-py3-none-any.whl
| Download URL | print_at_soc-0.375.4-py3-none-any.whl |
|---|---|
| Size | 59.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5984c9002d1d272db92dd97ea15003333d1d1b9c06dbdc026c23c5021a662b6f
|
|
BLAKE2b-256 checksum How to use checksums |
17d219e2bccd7866b8c21013f3f9952c2e04385d6e7beddd9dcaee5fdc3faab1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for print-at-soc 0.375.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.