Custom bash configuration and CLI tools for Argo sailboat autonomous control system.
cd ~/argo
make install-argo-cli
source ~/.bashrcThis will add source ~/argo/dotfiles/bashrc to your ~/.bashrc file.
Quick commands for Argo robot control:
al- Start Argo nodesaq- Stop Argo nodesars- Restart all Argo launch nodes (aq && al), or one node:ars argo_web_dashboardas- Show Argo statusam- Monitor modear- Start recordingac- Stop recordingabat- Get battery status (formatted JSON)astore- Toggle storage rundown (enable/disable discharge to 7.6V then shut down; mode cleared on reboot)ah- Show argo helpag- Start argo GUIalog- Show argo launch logsasim- Local simulationasimr- Remote simulation
argo_status()- Manual status check (always shows full details)argo_quick_timer()- Throttled status checking (5+ minutes since last check)
Intelligent argument completion for all Argo Python scripts:
Completion works for BOTH invocation methods:
python3 script.py --<TAB>(via global argcomplete)./script.py --<TAB>(via global argcomplete)
Scripts with completion enabled:
- ✅
launch/argo_lifecycle_manager.py- Commands: run, stop, restart, status, simulate_local, simulate_remote - ✅
nodes/bno085.py- Commands: bridge, calibrate, verify, status - ✅
nodes/controller.py- Full argument completion - ✅
nodes/anem.py- Full argument completion - ✅
nodes/gps.py- Full argument completion - ✅
nodes/argo_battery_water.py- Full argument completion - ✅
nodes/argo_unified_simulator_bridge.py- Full argument completion - ✅
nodes/rudder_sail_radio.py- Full argument completion - ✅
nodes/temp_monitor.py- Full argument completion - ✅
nodes/lora.py- Full argument completion - ✅
power_control/argo_power_control.py- Full argument completion
Custom tmux settings for terminal multiplexing.
With BNO085, calibration is stored on the sensor itself (on-chip) and does not use a repo-managed JSON calibration file.
The tab completion system uses Python's argcomplete library:
- One-time hook: Run
activate-global-python-argcomplete3 --user(oractivate-global-python-argcomplete --user) once so~/.bash_completion.d/python-argcomplete.shexists. Optional:ARGO_BOOTSTRAP_ARGCOMPLETE=1 bashruns the same from.bash_completion_argo. The script only sources the hook if present so every login stays fast. - Auto-Detection: Scripts with the
PYTHON_ARGCOMPLETE_OKmarker are automatically detected - Works Everywhere: Completion works with
python3 script.pyor./script.py
Scripts need 3 elements for completion to work:
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK # Marker for global argcomplete
import argparse
import argcomplete # After argparse import
def main():
parser = argparse.ArgumentParser(...)
# ... add arguments ...
argcomplete.autocomplete(parser) # Before parse_args()
args = parser.parse_args()Use the helper script to automatically add all required elements:
bash scripts/add_argcomplete_to_script.sh path/to/script.pyThis will:
- Add
# PYTHON_ARGCOMPLETE_OKmarker (line 2) - Add
import argcomplete(after argparse import) - Add
argcomplete.autocomplete(parser)(before parse_args())
Open a new terminal (or run source ~/.bashrc) and try:
# Lifecycle manager commands
python3 launch/argo_lifecycle_manager.py <TAB>
# Shows: run stop restart status simulate_local simulate_remote
# IMU node commands/args
python3 nodes/bno085.py --<TAB>
# Power control options
python3 power_control/argo_power_control.py --sim<TAB>
# Completes: --simulate-double-tap --simulate-triple-tap --simulate-critical-battery --simulate-low-battery
# Direct invocation also works
./nodes/bno085.py --<TAB>-
Verify argcomplete is installed:
pip3 show argcomplete
-
Check if global argcomplete is set up:
ls -la ~/.bash_completion.d/python-argcomplete.shIf missing, it will be auto-installed when you reload bash.
-
Reload bash configuration:
source ~/.bashrc
-
Verify script has the marker:
head -3 nodes/bno085.py | grep PYTHON_ARGCOMPLETE_OK
- Completion runs only when you press TAB
- Takes ~100-200ms (acceptable for interactive use)
- Uses efficient argparse structure parsing
The dotfiles automatically add Argo directories to PATH:
PATH="$HOME/argo/launch:$HOME/argo/nodes:$HOME/argo/scripts:$PATH"This allows you to run scripts from anywhere.
cd ~/argo
git pull # Get latest dotfiles
source ~/.bashrc # Reload configurationEdit dotfiles/bash_aliases and run:
make aliases-install
source ~/.bashrcbash scripts/add_argcomplete_to_script.sh path/to/new_script.py
source ~/.bashrcbash_aliases- Argo command aliases.bash_completion_argo- Tab completion setup.bashrc- Main bash configuration (sources other files).tmux.conf- Tmux configuration- (No repo-managed IMU calibration JSON with BNO085)
README.md- This file