Name | tmplcl JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | A utility for quickly copying a given string (template) to your clipboard |
upload_time | 2025-08-31 18:11:42 |
maintainer | None |
docs_url | None |
author | delfanbaum |
requires_python | >=3.13 |
license | None |
keywords |
cli tools
copy-to-clipboard
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# A Template to Clipboard Utility
Templates to your clipboard: because sometimes you *just* can't be bothered to
type it again. While this utility was created as an exercise to relearn `typer`
(which is great, though really all CLI tools should be "rewritten in Rust") and
a few other tools (and whack this out as quickly as possible), but hopefully
it's at least of some use to some folks. Eventually, the idea is to also
leverage [template strings](https://peps.python.org/pep-0750/) once those become
available, because really that is a great idea.
## Installation
The recommended installation path is via the `uv tool` interface, installing via
the GH link or PyPI, as you please:
```sh
uv tool install tmplcl
```
```sh
uv tool install git+https://github.com/delfanbaum/tmplcl
```
## Usage
This package provides two executable commands: `tmplcl` and `tcl`. `tmplcl` is
the "app" version of the tool, allowing you to perform all the expected CRUD
tasks such as creating, listing, deleting, and updating your various templates.
`tcl` is essentially just a shortcut for `tmplcl copy TEMPLATE_ID`, because who
wants to do all that typing.
The usage for each is as follows:
```console
tmplcl --help
Usage: tmplcl [OPTIONS] COMMAND [ARGS]...
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to │
│ copy it or customize the installation. │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────╮
│ copy Copies the requested template to your clipboard │
│ delete Deletes the template with the provided identifier │
│ add Adds a template with the provided identifier and string │
│ list Lists all available templates, including a preview of each │
│ show Displays the full text of a given template │
│ update Updates a given template with a new string │
╰────────────────────────────────────────────────────────────────────────────╯
```
```console
tcl --help
Usage: tcl [OPTIONS] TEMPLATE
Finds a template by its id and copies the resultant string to the clipboard
╭─ Arguments ────────────────────────────────────────────────────────────────╮
│ * template TEXT [default: None] [required] │
╰────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────╯
```
## Data Storage
Following the [XDG Base Directory
Specification](https://specifications.freedesktop.org/basedir-spec/latest/),
data will stored in `$XDG_DATA_HOME/tmplcl`.
If you would like to define your templates manually, it's all just JSON, so open
up `$XDG_DATA_HOME/tmplcl/data.json` and have at it. The schema is roughly
as follows:
```json
{
"description": "The model for the templates copied over to the clipboard. Contains the\ntemplate identifier as well as the template string.\n\nNote that the id may contain only alphanumeric characters or `-` and `_`",
"properties": {
"identifier": {
"minLength": 1,
"pattern": "^[a-zA-Z0-9_-]+$",
"title": "Identifier",
"type": "string"
},
"template": {
"minLength": 1,
"title": "Template",
"type": "string"
}
},
"required": [
"identifier",
"template"
],
"title": "Template",
"type": "object"
}
```
## Development
To get started, run `uv sync`.
## The Future
Eventually, the goal is to support these "templates" as actual... templates.
Like, being able to run `tcl my_template foo` where `my_template` is `"My
favorite food is {}` and `"My favorite food is foo"` gets put on your clipboard.
But that'll be a 0.1.2 thing.
Raw data
{
"_id": null,
"home_page": null,
"name": "tmplcl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.13",
"maintainer_email": null,
"keywords": "CLI tools, copy-to-clipboard",
"author": "delfanbaum",
"author_email": "delfanbaum <delfanbaum@oreilly.com>",
"download_url": "https://files.pythonhosted.org/packages/c5/3b/1ebc45b867300ba67671d79df3172a6d454c46f97967b3e128801c3268c9/tmplcl-0.1.1.tar.gz",
"platform": null,
"description": "# A Template to Clipboard Utility\n\nTemplates to your clipboard: because sometimes you *just* can't be bothered to\ntype it again. While this utility was created as an exercise to relearn `typer`\n(which is great, though really all CLI tools should be \"rewritten in Rust\") and\na few other tools (and whack this out as quickly as possible), but hopefully\nit's at least of some use to some folks. Eventually, the idea is to also\nleverage [template strings](https://peps.python.org/pep-0750/) once those become\navailable, because really that is a great idea.\n\n## Installation\n\nThe recommended installation path is via the `uv tool` interface, installing via\nthe GH link or PyPI, as you please:\n\n```sh\nuv tool install tmplcl\n```\n\n```sh\nuv tool install git+https://github.com/delfanbaum/tmplcl\n```\n\n## Usage\n\nThis package provides two executable commands: `tmplcl` and `tcl`. `tmplcl` is\nthe \"app\" version of the tool, allowing you to perform all the expected CRUD\ntasks such as creating, listing, deleting, and updating your various templates.\n`tcl` is essentially just a shortcut for `tmplcl copy TEMPLATE_ID`, because who\nwants to do all that typing.\n\nThe usage for each is as follows:\n\n```console\ntmplcl --help\n \n Usage: tmplcl [OPTIONS] COMMAND [ARGS]... \n \n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --install-completion Install completion for the current shell. \u2502\n\u2502 --show-completion Show completion for the current shell, to \u2502\n\u2502 copy it or customize the installation. \u2502\n\u2502 --help Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 copy Copies the requested template to your clipboard \u2502\n\u2502 delete Deletes the template with the provided identifier \u2502\n\u2502 add Adds a template with the provided identifier and string \u2502\n\u2502 list Lists all available templates, including a preview of each \u2502\n\u2502 show Displays the full text of a given template \u2502\n\u2502 update Updates a given template with a new string \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n```\n\n```console\ntcl --help\n \n Usage: tcl [OPTIONS] TEMPLATE \n \n Finds a template by its id and copies the resultant string to the clipboard \n \n \n\u256d\u2500 Arguments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 * template TEXT [default: None] [required] \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --help Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n```\n\n## Data Storage\n\nFollowing the [XDG Base Directory\nSpecification](https://specifications.freedesktop.org/basedir-spec/latest/),\ndata will stored in `$XDG_DATA_HOME/tmplcl`. \n\nIf you would like to define your templates manually, it's all just JSON, so open\nup `$XDG_DATA_HOME/tmplcl/data.json` and have at it. The schema is roughly\nas follows:\n\n```json\n{\n \"description\": \"The model for the templates copied over to the clipboard. Contains the\\ntemplate identifier as well as the template string.\\n\\nNote that the id may contain only alphanumeric characters or `-` and `_`\",\n \"properties\": {\n \"identifier\": {\n \"minLength\": 1,\n \"pattern\": \"^[a-zA-Z0-9_-]+$\",\n \"title\": \"Identifier\",\n \"type\": \"string\"\n },\n \"template\": {\n \"minLength\": 1,\n \"title\": \"Template\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"identifier\",\n \"template\"\n ],\n \"title\": \"Template\",\n \"type\": \"object\"\n}\n```\n\n\n## Development\n\nTo get started, run `uv sync`.\n\n## The Future\n\nEventually, the goal is to support these \"templates\" as actual... templates.\nLike, being able to run `tcl my_template foo` where `my_template` is `\"My\nfavorite food is {}` and `\"My favorite food is foo\"` gets put on your clipboard.\nBut that'll be a 0.1.2 thing.\n",
"bugtrack_url": null,
"license": null,
"summary": "A utility for quickly copying a given string (template) to your clipboard",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"cli tools",
" copy-to-clipboard"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "709378b3a16fb369f806e0c06b5611481b5c48def8a13d894f6107ecdcfe5d00",
"md5": "9ba0491f066be4bd34d1fc24344b256a",
"sha256": "fd7765d7103ce7d11cda7059eb541733e0fcfff31ee1322d7f2471901e00f50c"
},
"downloads": -1,
"filename": "tmplcl-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ba0491f066be4bd34d1fc24344b256a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.13",
"size": 6757,
"upload_time": "2025-08-31T18:11:40",
"upload_time_iso_8601": "2025-08-31T18:11:40.423513Z",
"url": "https://files.pythonhosted.org/packages/70/93/78b3a16fb369f806e0c06b5611481b5c48def8a13d894f6107ecdcfe5d00/tmplcl-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c53b1ebc45b867300ba67671d79df3172a6d454c46f97967b3e128801c3268c9",
"md5": "905a7add3b27240ee449a68021d73f5d",
"sha256": "dd32d20f53575fc2c9598fa36c6fef5ed8c0defb13920542cab6451b38a49076"
},
"downloads": -1,
"filename": "tmplcl-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "905a7add3b27240ee449a68021d73f5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.13",
"size": 4820,
"upload_time": "2025-08-31T18:11:42",
"upload_time_iso_8601": "2025-08-31T18:11:42.184529Z",
"url": "https://files.pythonhosted.org/packages/c5/3b/1ebc45b867300ba67671d79df3172a6d454c46f97967b3e128801c3268c9/tmplcl-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 18:11:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "tmplcl"
}