feat: mode-based REPL auto-imports via activate script
source activate — core (Proxmark3, Cmd, PM3Status, etc.) source activate sim — + SimSession, all transponder models source activate sniff — + SniffSession, trace decoders source activate all — everything Sets PM3PY_MODE env var and PYTHONSTARTUP for the venv. Prompt shows current mode: (pm3py:sim) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
activate
Normal file
21
activate
Normal file
@@ -0,0 +1,21 @@
|
||||
# pm3py venv activation with mode-based auto-imports.
|
||||
# Usage: source activate — core (Proxmark3, Cmd, etc.)
|
||||
# source activate sim — + SimSession, transponder models
|
||||
# source activate sniff — + SniffSession, trace decoders
|
||||
# source activate all — everything
|
||||
#
|
||||
# Then: python — REPL with auto-imports
|
||||
# ipython — IPython with auto-imports (if installed)
|
||||
|
||||
# Activate the venv
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/.venv/bin/activate"
|
||||
|
||||
# Set mode and PYTHONSTARTUP
|
||||
export PM3PY_MODE="${1:-core}"
|
||||
export PYTHONSTARTUP="$(dirname "${BASH_SOURCE[0]}")/.pythonstartup.py"
|
||||
|
||||
# Update prompt to show mode
|
||||
PS1="(pm3py:${PM3PY_MODE}) ${_OLD_VIRTUAL_PS1:-\$ }"
|
||||
export PS1
|
||||
|
||||
echo "pm3py env ready (mode: ${PM3PY_MODE}). Run 'python' for REPL with auto-imports."
|
||||
Reference in New Issue
Block a user