dotnet-x 0.3.1

dotnet tool install --global dotnet-x --version 0.3.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dotnet-x --version 0.3.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-x&version=0.3.1
                    
nuke :add-package dotnet-x --version 0.3.1
                    

This CLI allows you to manage your personal posts from the command line. It requires creating a project and app on the X Developer Portal to generate the necessary API keys and secrets.

Usage

> x --help
USAGE:
    x [OPTIONS] <COMMAND>

EXAMPLES:
    x post "Hello, world!" --media path/to/image.png

OPTIONS:
    -h, --help    Prints help information

COMMANDS:
    auth            
    post <TEXT>     

Authentication

Authentication is managed for you by the CLI, using the Git Credential Manager as the cross-platform secure storage for your API key(s). You can login multiple project/key combination and then just change the active one without ever re-entering the keys.

See getting access on X for more details.

> x auth login --help
DESCRIPTION:
Authenticate to X by providing the required secrets. 

Supports API key autentication using the Git Credential Manager for storage.

Switch easily between keys by just specifying an alias for the keys.

Alternatively, x will use the secrets found in environment variables with the 
prefix `X_`: `X_AccessToken`, `X_AccessTokenSecret`, `X_ConsumerKey`, 
`X_ConsumerSecret`.
Using double underscores also works for nested configuration, such as 
`X__ConsumerKey`.
This method is most suitable for "headless" use such as in automation.

For example, to use x in GitHub Actions:
  - name: ✖️ post
    env:
      X_AccessToken: ${{ secrets.X_ACCESS_TOKEN }}
      X_AccessTokenSecret: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
      X_ConsumerKey: ${{ secrets.X_CONSUMER_KEY }}
      X_ConsumerSecret: ${{ secrets.X_CONSUMER_SECRET }}
    run: |
      dotnet tool update -g dotnet-x
      x post "Hello, world!" --media image.png

USAGE:
    x auth login <alias> [OPTIONS]

ARGUMENTS:
    <alias>    Alias to use for the set of credentials

OPTIONS:
    -h, --help    Prints help information                              
        --at      Access token. Required unless previously saved       
        --ats     Access token secret. Required unless previously saved
        --ck      Consumer key. Required unless previously saved       
        --cs      Consumer secret. Required unless previously saved    
> x auth logout --help
DESCRIPTION:
Log out of X

USAGE:
    x auth logout [alias] [OPTIONS]

ARGUMENTS:
    [alias]    Specific alias to log out. Removes all accounts if not provided

OPTIONS:
    -h, --help    Prints help information
> x auth status --help
DESCRIPTION:
Shows the current authentication status

USAGE:
    x auth status [OPTIONS]

OPTIONS:
    -h, --help            Prints help information
        --show-secrets    Display the secrets    

Posting

> x post --help
USAGE:
    x post <TEXT> [OPTIONS]

EXAMPLES:
    x post "Hello, world!" --media path/to/image.png

ARGUMENTS:
    <TEXT>    Text to post

OPTIONS:
    -h, --help               Prints help information                            
        --jq [EXPRESSION]    Filter JSON output using a jq expression           
        --json               Output as JSON. Implied when using --jq            
        --monochrome         Disable colors when rendering JSON to the console  
    -m, --media <MEDIA>      Zero or more media files to attach to the post     
                             (.jpg, .jpeg, .png, .gif, .webp, .mp4, .mov)       

Sponsors

Clarius Org MFB Technologies, Inc. Torutek DRIVE.NET, Inc. Keith Pickford Thomas Bolon Kori Francis Toni Wenzel Uno Platform Reuben Swartz Jacob Foshee alternate text is missing from this package README image Eric Johnson David JENNI Jonathan Charley Wu Ken Bonny Simon Cropp agileworks-eu Zheyu Shen Vezel ChilliCream 4OTC Vincent Limo Jordan S. Jones domischell Justin Wendlandt Adrian Alonso Michael Hagedorn alternate text is missing from this package README image Sebastien Lebreton torutek

Sponsor this project  

Learn more about GitHub Sponsors

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
Version Downloads Last Updated
0.3.1 39 8/25/2025
0.3.0 161 4/2/2025