{"_id":"x-api-cli","_rev":"2-816dc51f612afa59bf8e61ecedd68ce5","name":"x-api-cli","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.3":{"name":"x-api-cli","version":"1.0.3","keywords":["twitter","x","api","cli","oauth"],"author":{"name":"Reality Shifting Tech"},"license":"MIT","_id":"x-api-cli@1.0.3","maintainers":[{"name":"eliaseffectsorg","email":"elias@realityshifting.tech"}],"homepage":"https://github.com/eliaseffects/x-api-cli#readme","bugs":{"url":"https://github.com/eliaseffects/x-api-cli/issues"},"bin":{"x-post":"x-post.mjs","x-delete":"x-delete.mjs"},"dist":{"shasum":"7561dba0547f9a6b3d82418c216e35d79b484259","tarball":"https://registry.npmjs.org/x-api-cli/-/x-api-cli-1.0.3.tgz","fileCount":7,"integrity":"sha512-xbEyBs5ygxIJUdLjv/zQ+iXm/jxKKJFVVLw2kc8C7E6IJNUvmQqTkqc4oBpOTrh0NUbV8Bp2IXIo1zp0xzG94w==","signatures":[{"sig":"MEYCIQDygR6ujNu1Oy83e6Wy4QGg9RT+F8maeUj6rCYPq76+IwIhAPsj/LGZ5DPhoTAj2rb4n80DBD9C7LRMXy7ZtVwpcv5k","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/x-api-cli@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21952},"main":"x-post.mjs","type":"module","engines":{"node":">=18.18.0"},"gitHead":"5bbc08f62f62afa74aeadfa465e25866135ab67d","scripts":{"lint":"node --check x-post.mjs && node --check x-delete.mjs && node --check lib/x-cli-common.mjs && node --check test/x-cli-common.test.mjs","test":"npm run lint && node --test","prepublishOnly":"npm test"},"_npmUser":{"name":"eliaseffectsorg","email":"elias@realityshifting.tech"},"repository":{"url":"git+https://github.com/eliaseffects/x-api-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js CLI for posting and deleting tweets with X API v2 using OAuth 1.0a.","directories":{},"_nodeVersion":"20.20.0","dependencies":{"twitter-api-v2":"^1.29.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/x-api-cli_1.0.3_1770639793814_0.3813971473078108","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"x-api-cli","version":"1.0.7","description":"Node.js CLI for posting and deleting tweets with X API v2 using OAuth 1.0a.","homepage":"https://github.com/eliaseffects/x-api-cli#readme","repository":{"type":"git","url":"git+https://github.com/eliaseffects/x-api-cli.git"},"bugs":{"url":"https://github.com/eliaseffects/x-api-cli/issues"},"main":"x-post.mjs","type":"module","bin":{"x-post":"x-post.mjs","x-delete":"x-delete.mjs"},"scripts":{"lint":"node --check x-post.mjs && node --check x-delete.mjs && node --check lib/x-cli-common.mjs && node --check test/x-cli-common.test.mjs","test":"npm run lint && node --test","prepublishOnly":"npm test"},"keywords":["twitter","x","x-api","twitter-api-v2","api","cli","oauth","tweet","automation","developer-tools"],"author":{"name":"Reality Shifting Tech"},"license":"MIT","engines":{"node":">=18.18.0"},"dependencies":{"twitter-api-v2":"^1.29.0"},"gitHead":"1448d392171c49b63859f66aeb73a490d52445eb","_id":"x-api-cli@1.0.7","_nodeVersion":"24.13.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-PctcD7ceTeIz4JbNWXnnEzBk8G2pUWptVaVIRMqxjNV/5bq283OkI1IdIBuiK+ng+r70V0c92WsM+Sq7QN1EJA==","shasum":"c1eefd4ef63f2354d0f6e50cb8f1c4c278a7cecb","tarball":"https://registry.npmjs.org/x-api-cli/-/x-api-cli-1.0.7.tgz","fileCount":8,"unpackedSize":869660,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/x-api-cli@1.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCBmThb0hZtvXonSAQZHmBT9t9kx3kXUbO2HD+GnWiN7gIgAlk8j4UfZeojXzV6UVZkxMz3UX0mHiidh2TeFH2nxdE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6e80f5fa-46ab-492c-9060-4576925e1101"}},"directories":{},"maintainers":[{"name":"eliaseffectsorg","email":"elias@realityshifting.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x-api-cli_1.0.7_1770731605247_0.9723663466266819"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-09T12:23:13.713Z","modified":"2026-02-10T13:53:25.726Z","1.0.3":"2026-02-09T12:23:13.978Z","1.0.7":"2026-02-10T13:53:25.457Z"},"bugs":{"url":"https://github.com/eliaseffects/x-api-cli/issues"},"author":{"name":"Reality Shifting Tech"},"license":"MIT","homepage":"https://github.com/eliaseffects/x-api-cli#readme","keywords":["twitter","x","x-api","twitter-api-v2","api","cli","oauth","tweet","automation","developer-tools"],"repository":{"type":"git","url":"git+https://github.com/eliaseffects/x-api-cli.git"},"description":"Node.js CLI for posting and deleting tweets with X API v2 using OAuth 1.0a.","maintainers":[{"name":"eliaseffectsorg","email":"elias@realityshifting.tech"}],"readme":"# x-api-cli\n\n<p align=\"center\">\n  <img src=\"./assets/social-preview.png\" alt=\"x-api-cli banner\" width=\"100%\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/x-api-cli\"><img alt=\"npm version\" src=\"https://img.shields.io/npm/v/x-api-cli?style=for-the-badge\"></a>\n  <a href=\"https://www.npmjs.com/package/x-api-cli\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dw/x-api-cli?style=for-the-badge\"></a>\n  <a href=\"https://github.com/eliaseffects/x-api-cli/actions/workflows/ci.yml\"><img alt=\"CI\" src=\"https://img.shields.io/github/actions/workflow/status/eliaseffects/x-api-cli/ci.yml?branch=master&style=for-the-badge\"></a>\n  <img alt=\"Node 18+\" src=\"https://img.shields.io/badge/node-%3E%3D18.18-0A84FF?style=for-the-badge&logo=nodedotjs&logoColor=white\">\n  <img alt=\"License\" src=\"https://img.shields.io/npm/l/x-api-cli?style=for-the-badge\">\n</p>\n\nPost and delete tweets from the terminal using the official X API v2 with OAuth 1.0a user tokens.\n\nCommands:\n\n- `x-post`\n- `x-delete`\n\n## Why this CLI\n\n- Safe defaults: help and invalid flag paths never trigger API writes.\n- Predictable errors: strict flag parsing and strict credential validation.\n- Script friendly: stable exit codes for CI and automation.\n- Release ready: CI + semver-tagged releases + publish automation.\n\n## Install\n\n### npm (recommended)\n\n```bash\nnpm install -g x-api-cli\nx-post --help\nx-delete --help\n```\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew tap eliaseffects/tap\nbrew install x-api-cli\n```\n\n### From source (development)\n\n```bash\ngit clone https://github.com/eliaseffects/x-api-cli.git\ncd x-api-cli\nnpm install\nnpm link\n```\n\n## Configure credentials\n\nYou need an X developer app with read/write access and user access tokens (OAuth 1.0a).\nGet them from the X Developer Portal: https://developer.x.com/en/portal/dashboard\n\n### Environment variables (recommended)\n\n```bash\nexport X_API_KEY=\"your-consumer-key\"\nexport X_API_SECRET=\"your-consumer-secret\"\nexport X_ACCESS_TOKEN=\"your-access-token\"\nexport X_ACCESS_SECRET=\"your-access-token-secret\"\n```\n\nAll 4 variables must be set together.\n\n### Config file\n\nCreate a JSON file with:\n\n```json\n{\n  \"consumerKey\": \"your-consumer-key\",\n  \"consumerSecret\": \"your-consumer-secret\",\n  \"accessToken\": \"your-access-token\",\n  \"accessTokenSecret\": \"your-access-token-secret\"\n}\n```\n\nThen use one of these options:\n\n```bash\n# Explicit path\nx-post --config ./secrets/x-api.json \"hello from config\"\n\n# Or env var\nexport X_API_CONFIG=\"./secrets/x-api.json\"\n```\n\nSearch order for config files:\n\n- `--config <path>`\n- `$X_API_CONFIG`\n- `./x-api.json`\n- `./.x-api.json`\n- `~/.config/x-api.json`\n\nOptional legacy support (only if you set `X_API_USE_LEGACY_PATHS=1`):\n\n- `~/.clawdbot/secrets/x-api.json`\n\n## Usage\n\n```bash\n# Post\nx-post \"Hello world from CLI\"\n\n# Reply\nx-post \"Replying to this\" --reply-to 1234567890\n\n# Quote by tweet ID\nx-post \"Read this thread\" --quote 1234567890\n\n# Quote by URL\nx-post \"Read this thread\" --quote-url https://x.com/user/status/1234567890\n\n# Delete one or many\nx-delete 1234567890\nx-delete 1234567890 2345678901 3456789012\n\n# Text that begins with a dash\nx-post -- \"--not-a-flag\"\n\n# Help\nx-post --help\nx-delete --help\n```\n\n## Safety Behaviors\n\n- `--help` always exits with status `0` and no API requests.\n- Unknown flags return status `1` and clear usage guidance.\n- Missing/partial credentials fail early before API calls.\n- `x-delete` exits non-zero when any deletion fails.\n\n## Troubleshooting\n\n- `No credentials found`\n  Set the env vars or create one of the supported config files.\n- `403/401` from X API\n  Your app/tokens likely lack write permissions, are expired, or are from a different app.\n- `Invalid tweet ID`\n  Tweet IDs must be numeric. Use `--quote-url` if you have a URL.\n\n## Development\n\n```bash\nnpm test\n```\n\nTests cover parsing, credential resolution, and edge cases in `test/x-cli-common.test.mjs`.\n\n## Security Notes\n\n- Do not commit credential files.\n- `x-api.json` and `.x-api.json` are ignored by default.\n- Prefer environment variables in CI.\n\n<details>\n<summary>Maintainers</summary>\n\nReleasing (SemVer tags):\n\n```bash\nnpm version patch\ngit push origin HEAD --follow-tags\n```\n\nGitHub Actions runs `.github/workflows/release.yml` and publishes to npm.\n\nTrusted publishing:\n\n- Configure a trusted publisher in npm for `eliaseffects/x-api-cli` with workflow `release.yml`.\n- Set repo variable: `NPM_TRUSTED_PUBLISHING=true`\n- Remove `NPM_TOKEN` after bootstrap.\n\n</details>\n\n## License\n\nMIT\n","readmeFilename":"README.md"}