# pastebin-ai 📄✨
A pretty CLI for [pastebin.ai](https://pastebin.ai) — share code, logs, and text from your terminal with beautiful output.
```
✨ Paste created!
──────────────────────────────────────────────────
🔗 https://pastebin.ai/p/abc123
📄 https://pastebin.ai/raw/abc123
⏰ Expires: 2026-11-13T17:30:19Z
🗑️ Delete token: abc123...
```
## Features
- 🎨 **Beautiful output** — colors, emojis, spinners
- ⚡ **Fast** — built with Rust, minimal dependencies
- 🔐 **Authentication** — secure token storage
- 📋 **Clipboard integration** — copy URLs/content with `-c`
- 📁 **File input** — `pastebin-ai create -f main.rs`
- 📥 **Stdin support** — `cat file.txt | pastebin-ai create`
- 🔍 **Get pastes** — fetch by ID or URL
- 📋 **List pastes** — see your history (with auth)
- 🗑️ **Delete pastes** — with token or auth
- 🤫 **Quiet mode** — just the URL for scripting
## Installation
### Cargo (recommended)
```bash
cargo install pastebin-ai
```
### Binary releases
Download from [GitHub Releases](https://github.com/mnk-works/pastebin-ai/releases).
### Build from source
```bash
git clone https://github.com/mnk-works/pastebin-ai
cd pastebin-ai
cargo install --path .
```
## Quick Start
```bash
# Create a paste from stdin
# Create from a file with syntax highlighting
pastebin-ai create -f main.rs -l rust
# Create with options
pastebin-ai create "code here" -t "My Title" -l python -v public -e 1d
# Get a paste
pastebin-ai get abc123
# Get raw content only
pastebin-ai get abc123 --raw
# List your pastes (requires auth)
pastebin-ai auth login pba_your_token
pastebin-ai list
# Delete a paste
pastebin-ai delete abc123 --token delete_token_here
```
## Commands
| `create` | Create a new paste |
| `get` | Read a paste by ID |
| `list` | List your pastes (auth required) |
| `delete` | Delete a paste |
| `auth` | Manage authentication |
| `config` | Show configuration |
## Options
### Create Options
```bash
pastebin-ai create [CONTENT] [OPTIONS]
Options:
-f, --file <FILE> Read content from file
-t, --title <TITLE> Paste title
-l, --language <LANG> Syntax highlighting (default: plaintext)
-c, --category <CAT> code | logs | configuration | data | documentation | other (default: code)
--tags <TAGS> Comma-separated tags
--max-views <N> Maximum views (1-1000)
--password <PASS> Password protect
--burn-after-read Delete after first view
--copy Copy URL to clipboard
-q, --quiet Output only URL
```
### Global Options
```bash
--no-color Disable colored output
--no-emoji Disable emoji output
```
## Authentication
Get your API token from [pastebin.ai/settings/api](https://pastebin.ai/settings/api) (starts with `pba_`):
```bash
pastebin-ai auth login pba_your_token_here
```
Tokens are stored in `~/.config/pastebin-ai/config.toml`.
## Examples
```bash
# Share a Rust file with syntax highlighting
pastebin-ai create -f src/main.rs -l rust -t "My Rust snippet"
# Pipe command output
# Create a temporary paste (10 minutes)
pastebin-ai create "temp data" -e 10m
# Create a password-protected paste
pastebin-ai create "secret" --password hunter2
# Burn after read (self-destructing)
pastebin-ai create "one-time secret" --burn-after-read
# Script-friendly: just the URL
url=$(pastebin-ai create "content" -q)
echo "Share: $url"
```
## Configuration
Config file: `~/.config/pastebin-ai/config.toml`
```toml
auth = { token = "pba_..." }
```
## License
MIT OR Apache-2.0