Get started
Install Twitter CLI, connect a developer app, and send a first tweet. This guide is for people who can run commands in a terminal. You need a Twitter account with access to a developer app that can write tweets.
Documentation compatibility
These docs assume Twitter CLI v1.10.0 and later. For instructions specific to a newer release, open the CLI repository, check out that release's tag, and read its README.md:
git clone https://github.com/StanleyMasinde/twitter.git
cd twitter
git checkout RELEASE_TAGReplace RELEASE_TAG with the tag for your release from Releases. Read README.md in that checkout for the release's setup and usage instructions.
Before you begin
Twitter CLI is a standalone executable named twitter. It uses the Twitter API. API access and write permissions depend on your developer app; installing the executable does not grant API access.
Have these ready:
- A Twitter developer app with Read and write permissions.
- The app's OAuth 2.0 client ID and client secret, plus its bearer token for app-only reads and usage.
- A browser you can use for the first authorization.
- On Android, Termux on Android 7 or later, with an aarch64, armv7, or x86_64 environment. 32-bit x86 (i686) is not supported.
- On Windows, PowerShell 7 or later and the Microsoft Visual C++ Redistributable matching your CLI architecture. Install the Redistributable before running
twitter.
Set the app's OAuth 2.0 callback URL to http://127.0.0.1:3000. The CLI asks you to paste the complete callback URL after you authorize it. See Configure authentication for that step.
Install Twitter CLI
Choose the commands for your operating system. On macOS, Linux, and Termux, review the Unix installer script before running it. On Windows, use PowerShell 7 or later and review the PowerShell installer script before running it.
curl -fsSL https://twitter.stanleymasinde.com/install.sh | shpkg update
pkg install curl ca-certificates
curl -fsSL https://twitter.stanleymasinde.com/install.sh | shirm https://twitter.stanleymasinde.com/install.ps1 | iexmacOS and Linux options
The Unix installer detects the operating system and architecture, downloads the matching release archive, and installs twitter in /usr/local/bin. It uses the release metadata to find the archive and verify its SHA-256 digest. A release without the digest cannot be installed by this script.
If you prefer an install directory owned by your user, run:
curl -fsSL https://twitter.stanleymasinde.com/install.sh | TWITTER_INSTALL="$HOME/.local/bin" shAdd that directory to your shell's PATH if twitter is not found. To install a particular release, pass its tag to the script:
curl -fsSL https://twitter.stanleymasinde.com/install.sh | sh -s v1.10.0Replace v1.10.0 with the release tag you want from Releases.
Android with Termux
Use a release that contains an Android archive for your architecture. The installer downloads the matching binary and installs it into $PREFIX/bin without sudo. Android builds bundle curl, OpenSSL, and SQLite; you do not need Rust or build tools to install them.
The supported release archives are:
| Termux architecture | Release archive |
|---|---|
| aarch64 | twitter-aarch64-linux-android.tar.gz |
| armv7 | twitter-armv7-linux-androideabi.tar.gz |
| x86_64 | twitter-x86_64-linux-android.tar.gz |
GNU/Linux archives do not run natively in Termux. See Termux installation errors if installation fails.
To choose another executable directory inside Termux, set TWITTER_INSTALL and ensure the directory is on your PATH:
mkdir -p "$HOME/.local/bin"
curl -fsSL https://twitter.stanleymasinde.com/install.sh | TWITTER_INSTALL="$HOME/.local/bin" shWindows options
The installer selects the x64 or ARM64 release archive for your system, extracts twitter.exe, and installs it in $env:USERPROFILE\bin. It adds that directory to your user and current session PATH and verifies the SHA-256 digest when one is available. Git, Rust, and C++ build tools are not required to install a release archive.
Windows builds require the Microsoft Visual C++ Redistributable runtime. Download the latest supported package directly from Microsoft for your CLI architecture:
- x64 Redistributable for the x64 release.
- ARM64 Redistributable for the ARM64 release.
Run the downloaded installer and complete the setup before running twitter --version. See Microsoft's Redistributable download page for package details. Installing the Redistributable may prompt for administrator approval. The Twitter CLI installer needs administrator rights only for a protected install directory.
To choose an install directory, set TWITTER_INSTALL before running the installer:
$env:TWITTER_INSTALL = "$env:USERPROFILE\.local\bin"
irm https://twitter.stanleymasinde.com/install.ps1 | iexTo install a particular release, pass its tag to the installer:
$installer = irm https://twitter.stanleymasinde.com/install.ps1
& ([scriptblock]::Create($installer)) -Version v1.10.0Replace v1.10.0 with a release tag that includes a Windows archive for your architecture from Releases.
Verify the executable
After installation, check the version and available commands:
twitter --version
twitter --helptwitter --version
twitter --helpThe first command prints the installed version. The second lists top-level commands. If the shell cannot find twitter, see Troubleshooting.
Create a configuration file
Run the initializer:
twitter config --init--init writes a template; it does not ask for credentials, and it replaces an existing configuration. If initialization fails while setting file permissions, it may stop before writing a new file. If that happens, follow the path and recovery steps in Troubleshooting, then run --init again.
Open the template with twitter config --edit, replace the placeholder values, and save it. This command opens the CLI's configuration file for your operating system; you do not need to know its path. See Configuration for each field and a multi-account example.
Authorize and check the account
Run:
twitter meOn first use, the CLI prints an authorization URL. Open it, approve access, and paste the full callback URL into the terminal when asked. The browser might show an unreachable local page after redirecting to 127.0.0.1:3000; copy the URL from its address bar. twitter me then prints the authenticated account's ID, name, and username.
Publish a first tweet
Publishes immediately
The command below sends a real tweet from the selected account. Run twitter me first if you need to check the account.
Run:
twitter tweet --body "Hello from my terminal"A successful request prints the new tweet's ID and body. For editor input, files, images, and threads, see Tweet and write threads.
Update the CLI
On macOS, run twitter update to fetch the latest matching release. If your executable is in a root-owned directory such as /usr/local/bin, the update may need elevated privileges; use sudo twitter update only for that case. A user-owned install directory does not need sudo.
On Linux, run twitter update to fetch the latest matching release. An installation in a root-owned directory may need elevated privileges. If an older CLI reports that no matching asset exists, rerun the Unix installer from Install Twitter CLI.
On Windows, run twitter update. The command downloads the matching x64 or ARM64 release and starts a helper that replaces the executable after the CLI exits. It prints the path to a log containing the replacement result or error. Run twitter --version after replacement completes; if the version remains unchanged, inspect that log. For older CLI versions that cannot find the Windows asset, rerun the PowerShell installer from Install Twitter CLI.
The updater replaces the running executable by default. Set TWITTER_INSTALL to update a binary in another directory instead.
On Termux, run twitter update to download the latest matching Android release and replace the executable. You can also rerun the installer from Android with Termux. Neither method needs sudo for an installation in $PREFIX/bin.
After updating, run twitter --version. On macOS, Linux, or Termux, use command -v twitter to locate the executable; on Windows, use where.exe twitter. If your shell still finds an older binary, see Troubleshooting.
Next steps
- Schedule tweets and set up automatic delivery.
- Read and search without opening the website.
- Command reference for the full command tree.