🛠️ Troubleshooting - Build opsctl CLI Foundation
Issue: Command not found after installation
Ensure virtual environment is activated:
(venv) toor@ip-172-31-10-241:~ /opsctl-project$ source ~ /opsctl-project/venv/bin/activate
(venv) toor@ip-172-31-10-241:~ /opsctl-project$
(venv) toor@ip-172-31-10-241:~ /opsctl-project$ pip install -e .
Obtaining file:///home/toor/opsctl-project
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: opsctl
Building editable for opsctl (pyproject.toml) ... done
Created wheel for opsctl: filename=opsctl-0.1.0-0.editable-py3-none-any.whl size=3078 sha256=5dca63529df2d251f6c73c44ef1ec0f3ac7d1a8586fd97cb22f5bc85fe33c269
Successfully built opsctl
Installing collected packages: opsctl
Attempting uninstall: opsctl
Found existing installation: opsctl 0.1.0
Uninstalling opsctl-0.1.0:
Successfully uninstalled opsctl-0.1.0
Successfully installed opsctl-0.1.0
Verify all __init__.py files exist
Check Python path:
(venv) toor@ip-172-31-10-241:~ /opsctl-project$ python3 -c " import sys; print(sys.path)"
[' ' , ' /usr/lib/python312.zip' , ' /usr/lib/python3.12' , ' /usr/lib/python3.12/lib-dynload' , ' /home/toor/opsctl-project/venv/lib/python3.12/site-packages' ]
Issue: Permission denied on config file
Check directory permissions:
(venv) toor@ip-172-31-10-241:~ /opsctl-project$ ls -la ~ /.opsctl/
total 12
drwxr-xr-x 2 toor toor 4096 Apr 12 09:14 .
drwxr-x--- 11 toor toor 4096 Apr 12 09:14 ..
-rw-r--r-- 1 toor toor 234 Apr 12 09:15 config.json
Create directory manually:
(venv) toor@ip-172-31-10-241:~ /opsctl-project$ mkdir -p ~ /.opsctl && chmod 755 ~ /.opsctl
Issue: Arguments not parsing correctly
Verify subparser destination is set: dest='command'
Check that set_defaults(func=execute) is called for each subcommand