CLI Usage¶
The naste CLI client sends text to a paste server and returns a URL. It can also fetch pastes with the get subcommand.
Installation¶
Add naste to home.packages and set PASTE_ENDPOINT via sessionVariables.
Fetching Pastes¶
Use the get subcommand to fetch paste content:
# Public paste
naste get hello
# Private paste (uses creds from config/env, prompts if missing)
naste get -p hello
If no credentials are configured and a private paste is requested, the CLI prompts for username and password interactively.
Flags¶
| Flag | Shorthand | Description |
|---|---|---|
--slug <name> |
-s |
Custom slug for the paste |
--private |
-p |
Create/fetch a private paste (requires auth) |
--force |
-f |
Force overwrite if slug exists |
--lang <lang> |
-l |
Language for syntax highlighting (auto-detected from file extension if not set) |
--version |
-v |
Print version and exit |
--help |
-h |
Show help |
Input Methods¶
Pipe from stdin¶
File argument¶
Pass a file path as a positional argument. Language is auto-detected from the extension.
Configuration¶
Config file¶
Create ~/.config/naste/config.toml:
Environment variables¶
Environment variables override the config file:
| Variable | Description |
|---|---|
PASTE_ENDPOINT |
Server URL (default: https://paste.semi.sh) |
PASTE_USER |
Username for private pastes |
PASTE_PASS |
Password for private pastes |
PASTE_USER_FILE |
File containing username (overrides PASTE_USER) |
PASTE_PASS_FILE |
File containing password (overrides PASTE_PASS) |
File-based credentials take precedence over inline env vars. File contents are trimmed of whitespace. Use with sops-nix for secret management.
Language Detection¶
Auto-detected from file extension when using file arguments. Override with --lang.
| Extension | Language |
|---|---|
.go |
go |
.py .pyw |
python |
.js .jsx .mjs |
javascript |
.ts .tsx |
typescript |
.rs |
rust |
.c .h |
c |
.cpp .cxx .cc .hpp |
cpp |
.sh .bash |
bash |
.nix |
nix |
.yaml .yml |
yaml |
| ... | 30+ languages total |
Overwrite Behavior¶
If a slug already exists in the same scope (public or private) and --force is not passed, the CLI prompts interactively:
The same slug can exist independently in both public and private scopes. The prompt reads from /dev/tty (not stdin), so it works even when piping content.
Exit Codes¶
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (network, file read, server rejection) |
Examples¶
# Quick paste
echo "hello" | naste
# Named paste with language
cat script.sh | naste -s deploy -l bash
# Private paste
cat secrets.env | naste -p -s secrets
# Overwrite existing
naste updated.go -f -s mycode
# Pipe kubectl output
kubectl get pods -o yaml | naste -s k8s-debug
# Fetch a public paste
naste get hello
# Fetch a private paste
naste get -p hello