Skip to main content

Simple CLI to output source code blocks for LLM prompts.

Project description

inprompt

A tiny CLI for outputting files or glob patterns as Markdown code blocks. Useful when you need to copy code into prompts for large language models (e.g., ChatGPT).

Usage

From the command line, you can pass files and glob patterns to inprompt:

inprompt pyproject.toml '**/*.py' | pbcopy

Note: It's important to enclose glob patterns (like '**/*.py') in single or double quotes. This prevents your shell from expanding the pattern before inprompt sees it, ensuring correct file matching, especially for recursive patterns (**).

The | pbcopy (or equivalent) then pipes the formatted output directly to your clipboard:

  • On macOS, pbcopy copies STDOUT to the clipboard.

  • On Ubuntu/Linux, you can use xclip. Define aliases for convenience:

    alias pbcopy='xclip -selection clipboard'
    alias pbpaste='xclip -selection clipboard -o'
    

    Then you can use the same inprompt ... | pbcopy pattern.

Any matched files will be printed to standard output (and thus copied by pbcopy) in the format:

<filename>
````
<file contents>
````

You can then paste those code blocks into an LLM prompt.

Installation

Option 1: With pip

pip install inprompt

This installs the inprompt command on your system or in your virtual environment.

Option 2: With pipx

pipx install inprompt

This installs inprompt globally, isolated from your system's site packages.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inprompt-1.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inprompt-1.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file inprompt-1.2.0.tar.gz.

File metadata

  • Download URL: inprompt-1.2.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.10 Darwin/24.3.0

File hashes

Hashes for inprompt-1.2.0.tar.gz
Algorithm Hash digest
SHA256 a1ab9420cddef73a84501aa18320516f0e3406c2807758e037898ab1c2b38cf2
MD5 d9674f1c079b63483f9c50d5a410fe88
BLAKE2b-256 17dab837256b7415331bea74ef0ed530f1795f2b1ab924c4519d520ab413b70e

See more details on using hashes here.

File details

Details for the file inprompt-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: inprompt-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.10 Darwin/24.3.0

File hashes

Hashes for inprompt-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb5fcc71ce5a54a2da2c7d623dd5541cf1e537825d863e843c228ff63559a575
MD5 164249b6dbfd44d75a6b3ac5e13bc3c1
BLAKE2b-256 f77513c3fc267ce3e3286d4e91b12f8bfd84ef981c59e78c18d5af51f4556ac9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page