Provide these as environment variables (recommended: ~/.openclaw/.env on the gateway machine):
X_API_KEYX_API_SECRETX_ACCESS_TOKENX_ACCESS_TOKEN_SECRETpython3 {baseDir}/scripts/bootstrap_venv.py
Rationale: this avoids system-wide installs (PEP 668 / externally-managed Python) and keeps dependencies isolated to this skill.
Note: the .venv/ directory is intentionally not shipped in the skill package; each user creates it locally.
Use the OAuth 1.0a 3‑legged flow to obtain X_ACCESS_TOKEN + X_ACCESS_TOKEN_SECRET.
Prereq: set an allowed callback URL in your X app settings (any HTTPS URL is fine, even a dummy page).
Recommended: set X_OAUTH_CALLBACK=https://example.com/callback (and whitelist it in the app).
Start:
# run inside the venv
python3 {baseDir}/scripts/run.py dry-run --text "(noop)" # just to verify venv exists
{baseDir}/.venv/bin/python {baseDir}/scripts/oauth1_flow.py auth-start
Open the printed AUTH_URL, approve, then copy oauth_verifier from the browser redirect URL.
Finish:
{baseDir}/.venv/bin/python {baseDir}/scripts/oauth1_flow.py auth-finish \
--oauth-token "..." \
--oauth-token-secret "..." \
--oauth-verifier "..."
python3 {baseDir}/scripts/run.py publish --text "..." --image "/path/to/image.jpg"
If the user did not approve, only run dry-run:
python3 {baseDir}/scripts/run.py dry-run --text "..." --image "/path/to/image.jpg"
共 1 个版本