Skip to main content

title: xi-cli description: A rich CLI template for pastebin CLI tools pypi_url: https://pypi.org/project/ix-cli/#files tar_url: https://pypi.org/project/ix-cli/#files github_url: https://github.com/arnos-stuff/ix

A rich CLI template for pastebin CLI tools

ix is a command line interface for ix.io, a pastebin service.

I tried to make this CLI as "reusable" as possible, so that you can clone this repository and use it as a template for your own pastebin CLI tool.

How to use this template

  1. Clone this repository
  2. Rename the ix_cli directory to the name of your pastebin service
  3. Replace the variable PROVIDER_URL in ix_cli/utils.py with the URL of your pastebin service (e.g. https://paste.example.com)
  4. Replace the name of the app in pyproject.toml with the name of your pastebin service in both the name and [tool.poetry.scripts] sections
  5. Install poetry and run poetry install to install the dependencies
  6. Run a basic command to make sure everything works: <new-app-name> s "Hello, world!"
  7. Edit the README to your liking
  8. Commit your changes and push them to your repository
  9. Publish your app to PyPI using poetry build and poetry publish

Installation

Using pip

pip install ix-cli

Cloning the repository

git clone https://github.com/arnos-stuff/ix.git

Basic usage

As a Python module

from ix_cli import uploadFromFile, uploadFromStdin, download, getHistory

# Upload from stdin
url = uploadFromStdin("Hello, world!")
print(url)

# Upload from file
url = uploadFromFile("README.md")
print(url)

# Download
data = download(url)
print(data)

As a CLI tool

Using ix is simple. Just pipe some text into it:

echo "Hello, world!" | ix s

This will print the URL of the paste to stdout. You can also use ix to upload files:

ix f README.md

This CLI has an extra feature: it stores the past 100 URLs in a local cache. You can use this to quickly access your pastes:

ix h

This will print a list of your pastes, with the most recent at the top. You also have the option to limit the number of pastes shown:

ix h -n 3

This will print the 3 most recent pastes.

Getting the data back

You can use ix to retrieve the data from a paste by using the g command:

ix g https://ix.io/1QZp

or simply

ix g 1QZp

This will print the contents of the paste to stdout.

License

This project is licensed under the MIT License - see the LICENSE file for details

Metadata

Release files for ix-cli 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ix-cli 0.1.3
File Size Uploaded Provenance Actions
ix_cli-0.1.3.tar.gz 5.5 kB Without provenance Details for ix_cli-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ix-cli 0.1.3
File Interpreter ABI Platform Actions
ix_cli-0.1.3-py3-none-any.whl Python 3 none any Details for ix_cli-0.1.3-py3-none-any.whl

Total release size: 12.3 kB

Release files / ix_cli-0.1.3.tar.gz

Download URL ix_cli-0.1.3.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
82745efb94d09c2d3a53ee90382f310f83caaa5154a36897cd554a28e36e4193
BLAKE2b-256 checksum
How to use checksums
abcc1ee6dac4b4876e9bcc29be73bf3855abb5aa310c919e5c2da5cf953409ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/6.3.12-204.fsync.fc38.x86_64

Release files / ix_cli-0.1.3-py3-none-any.whl

Download URL ix_cli-0.1.3-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6afd2b53bc309d4389d75c31466c5ab14f7eaaed8c7d8bf513c7f13f186f515
BLAKE2b-256 checksum
How to use checksums
9fb8975a8597204ab59c9a39d080ef20686abcb05ab745d5b0e6a52c498d7908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/6.3.12-204.fsync.fc38.x86_64

Security for ix-cli 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page