| Crates.io | tpc |
| lib.rs | tpc |
| version | 0.2.3 |
| created_at | 2026-01-09 05:46:52.262343+00 |
| updated_at | 2026-01-25 17:42:42.052238+00 |
| description | CLI for TeaserPaste |
| homepage | |
| repository | https://github.com/TeaserPaste/tpcli |
| max_upload_size | |
| id | 2031631 |
| size | 172,267 |
TeaserPaste CLI (tpc) is a powerful command-line interface for interacting with TeaserPaste. It allows you to create, view, manage, and even execute code snippets directly from your terminal.
tpc run.You can install tpc using the automated installer script (powered by cargo-dist):
Linux & macOS:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/TeaserPaste/tpcli/releases/latest/download/tpc-installer.sh | sh
Windows (PowerShell):
powershell -ExecutionPolicy Bypass -c "irm https://github.com/TeaserPaste/tpcli/releases/latest/download/tpc-installer.ps1 | iex"
Note for Windows ARM64 users: Currently, we do not provide a native
aarch64-pc-windows-msvcbinary. Please use thex86_64version.
If you have Rust installed, you can install the CLI directly from Crates.io:
cargo install tpc
Note: Ensure ~/.cargo/bin is in your PATH.
Before creating or managing private snippets, you need to authenticate.
tpc config set token priv_YOUR_API_TOKEN
The token is stored securely in your operating system's keychain/keyring.
Other Configuration Options:
You can also set default preferences:
# Set default language
tpc config set default_language rust
# Set default visibility
tpc config set default_visibility private
# View current config
tpc config get default_language
# Clear a config
tpc config clear default_visibility
Here are some common examples of how to use tpc.
Interactive Mode (Easiest):
tpc create --interactive
# or simply
tpc create -i
From a File:
tpc create --file ./script.py --title "My Python Script" --visibility public
From Stdin:
echo "console.log('Hello World')" | tpc create --title "Hello" --language javascript
View a snippet:
tpc view <SNIPPET_ID>
Copy content directly to clipboard:
tpc view <SNIPPET_ID> --copy
View output as JSON (useful for scripting):
tpc view <SNIPPET_ID> --json
You can fetch and execute a snippet locally. tpc supports Python, Node.js, Rust, Go, C++, and more.
tpc run <SNIPPET_ID>
Advanced Run Options:
--install-deps: Auto-install detected imports (e.g., npm packages, pip modules) into a temporary environment.--env KEY=VALUE: Pass environment variables.--on-error-paste: If the script fails, automatically upload the error log as a private snippet.tpc run <SNIPPET_ID> --install-deps --env DEBUG=true
Custom Runners (Dynamic Runner):
You can customize the command used to execute snippets.
Via CLI flag: Use --with-runner to specify a command. Use {{file}} as a placeholder for the script path.
tpc run <ID> --with-runner "python3 {{file}}"
tpc run <ID> --with-runner "deno run --allow-net {{file}}"
Via Config: Add a runners map to your config.json file (typically in ~/.config/tpcli/config.json).
{
"runners": {
"python": "python3 {{file}}",
"javascript": "deno run {{file}}"
}
}
Search for public snippets by query:
tpc search "rust web server" --limit 5
tpc clone <ID>tpc copy <ID>tpc statstpc delete <ID>tpc edit <ID> (Opens snippet in your default editor)tpc upgrade (Updates tpc to the latest version. Note: This only works if you installed via the installer script, not cargo install.)-v, -vv, or -vvv for more detailed logs.To see the full list of commands and options, run:
tpc --help
This project is licensed under the MIT or Apache-2.0 license.