/0x45-cli

A modern CLI tool for 0x45.st - Upload files, shorten URLs, and manage your content with style 🚀

Primary LanguageGoMIT LicenseMIT

0x45-cli

0x45 Logo
Go Reference Go Report Card Test Status Code Coverage License

A command-line interface for interacting with the 0x45.st file and URL sharing service.

Features

  • 📤 Upload files and get shareable links
  • 🔗 Shorten URLs
  • 📋 List your uploaded files and shortened URLs
  • 🗑️ Delete uploaded content
  • ⚙️ Configurable settings
  • 🔑 API key management

Installation

From Source

Requires Go 1.18 or later.

go install github.com/watzon/0x45-cli/cmd/0x45@latest

The command will be installed as 0x45 in your $GOPATH/bin directory.

Alternatively, you can clone and build from source:

git clone https://github.com/watzon/0x45-cli.git
cd 0x45-cli
go build -o $GOPATH/bin/0x45 ./cmd/0x45

Configuration

Before using the CLI, you'll need to configure it with your 0x45.st API key:

0x45 config set api_key YOUR_API_KEY

You can also configure the API URL if you're using a self-hosted instance:

0x45 config set api_url https://your-instance.com

Usage

Upload a File

0x45 upload path/to/file.txt

Options:

  • --private: Make the upload private
  • --expires: Set expiration time (e.g., "24h", "7d", "1month")

Shorten a URL

0x45 shorten https://very-long-url.com

Options:

  • --private: Make the shortened URL private
  • --expires: Set expiration time

List Your Content

List all your uploads:

0x45 list pastes

List shortened URLs:

0x45 list urls

Options:

  • --page: Page number for pagination
  • --limit: Number of items per page

Delete Content

0x45 delete CONTENT_ID

Configuration Management

Get a config value:

0x45 config get KEY

Set a config value:

0x45 config set KEY VALUE

API Key

To get an API key, visit 0x45.st and request one using:

0x45 key request --name "You Name" --email "your@email.com"

Development

Requirements

Running Tests

go test -v ./...

Linting

golangci-lint run

License

MIT License - see LICENSE for details.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -am 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Credits

Built by watzon for use with 0x45.st