Repository navigation
Add cross-platform lightweight CLI for ad-hoc and cron usage - #10
Merged
Merged
Conversation
Introduces a single-file Python 3 script (cli/pingclaude.py) that performs one ping to claude.ai and exits, suitable for Linux, cron, and ad-hoc use without the macOS GUI. Includes CLI-specific docs, config template, and .gitignore. Updates main README with pointer to CLI docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cli/directory with a Python script (pingclaude.py) that performs one ping to the claude.ai web API and exits — for ad-hoc terminal use or cron/Task Scheduler on macOS, Linux, and Windows. Hardcoded haiku, prints success/failure plus 5-hour and 7-day window utilization and reset times to stdout (human or--json).~/.config/pingclaude/config.json→ the existing GUI app's macOS plist (read-only auto-detect, zero-config on Macs); no credential CLI flags so secrets never appear inps.curl_cffi(Safari TLS impersonation) because claude.ai is fronted by Cloudflare and stdliburllib/systemcurlget 403'd at the edge regardless of cookies — verified empirically; Safari impersonation succeeds with the same credentials.cli/README.mdwith venv install (PEP 668), cron examples (use venv's Python directly),--json >>history-log pattern, exit codes (incl. 5 = missing dep), and a VPN-troubleshooting note.Test plan
python3 -m venv ~/.pingclaude/venv && ~/.pingclaude/venv/bin/pip install curl_cffi~/.pingclaude/venv/bin/python3 cli/pingclaude.py→ prints help, exits 0python3 cli/pingclaude.py ping→ exits 5 with install instructions (system Python lacks curl_cffi)~/.pingclaude/venv/bin/python3 cli/pingclaude.py ping→ success with 5h/7d windows + reset times~/.pingclaude/venv/bin/python3 cli/pingclaude.py ping --json | python3 -m json.tool→ well-formed JSON~/.pingclaude/venv/bin/python3 cli/pingclaude.py ping --quiet→ silent on success, exit 0🤖 Generated with Claude Code