fix: replace python3 with py/jq throughout scripts and docs
Windows Store python3 stub returns exit 49 instead of running Python. Replace with: py (Windows launcher) for actual Python code, jq for simple JSON extraction. Reorder fallback loops to try py first. Add Bash(py:*) to settings.local.json allowlist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -154,18 +154,12 @@ op vault list --format=json # Vaults as JSON
|
||||
## Useful Patterns
|
||||
|
||||
```bash
|
||||
# Find item by field value (search)
|
||||
op item list --format=json | \
|
||||
python3 -c "import sys,json; [print(i['title']) for i in json.load(sys.stdin)]"
|
||||
|
||||
# Export all items in a vault to JSON (backup)
|
||||
op item list --vault Dev --format=json | \
|
||||
python3 -c "import sys,json; ids=[i['id'] for i in json.load(sys.stdin)]"
|
||||
# (then loop to get each)
|
||||
# List item titles
|
||||
op item list --format=json | jq -r '.[].title'
|
||||
|
||||
# Check if a specific item exists
|
||||
op item get "My Item" &>/dev/null && echo "exists" || echo "not found"
|
||||
|
||||
# Get item ID (for scripting)
|
||||
op item get "My Item" --format=json | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])"
|
||||
op item get "My Item" --format=json | jq -r '.id'
|
||||
```
|
||||
|
||||
@@ -102,8 +102,7 @@ op run --env-file=n8n.env.tpl -- docker compose up n8n
|
||||
|
||||
```bash
|
||||
# List all fields in an item
|
||||
op item get "Item Name" --format=json | \
|
||||
python3 -c "import sys,json; [print(f['label']) for f in json.load(sys.stdin)['fields'] if f.get('value')]"
|
||||
op item get "Item Name" --format=json | jq -r '.fields[] | select(.value) | .label'
|
||||
|
||||
# Or view interactively
|
||||
op item get "Item Name"
|
||||
|
||||
Reference in New Issue
Block a user