CLI for pbnj.sh - A minimal pastebin for code snippets
npm install @pbnjs/cli


_The official CLI for pbnj - paste code from your terminal_
``bash`
npm install -g @pbnjs/cli
Or use without installing:
`bash`
npx @pbnjs/cli myfile.py
`bashConfigure your pbnj instance
pbnj --init
Setup
Configure your pbnj instance:
`bash
pbnj --init
`This will prompt you for:
- Host URL: Your pbnj instance URL
- Auth Key: Your secret key for creating pastes
Configuration is saved to
~/.pbnj.Alternatively, use environment variables:
`bash
export PBNJ_HOST=https://your-instance.workers.dev
export PBNJ_AUTH_KEY=your-secret-key
`Commands
$3
`bash
From a file
pbnj script.pyFrom stdin
cat error.log | pbnj
echo "console.log('hello')" | pbnj -L javascriptWith custom filename
pbnj -f "app.js" - < code.txt
`$3
`bash
Update with new file content
pbnj -u newfile.pyUpdate from stdin
cat updated.log | pbnj -u
`$3
`bash
List recent pastes (default: 10)
pbnj -lList more pastes
pbnj -l 20
`$3
`bash
pbnj -d
`Options
| Option | Description |
|--------|-------------|
|
-L, --language | Override automatic language detection |
| -f, --filename | Set filename for the paste |
| -u, --update | Update an existing paste |
| -d, --delete | Delete a paste by ID |
| -l, --list [n] | List recent pastes (default: 10, or specify count) |
| -n, --no-copy | Don't copy URL to clipboard after creating paste |
| -p, --private | Create a private (unlisted) paste |
| -s, --secret | Set a secret key for private paste |
| -h, --help | Show help |
| -v, --version | Show version |
| --init | Configure your pbnj instance |
| --show-config | Show current host URL configuration |Supported Languages
The CLI automatically detects language from file extensions:
- JavaScript (
.js, .jsx)
- TypeScript (.ts, .tsx)
- Python (.py)
- Rust (.rs)
- Go (.go)
- Ruby (.rb`)MIT