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.1.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.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inprompt-1.1.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.9 Darwin/24.3.0

File hashes

Hashes for inprompt-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ac7cebb4fb1958154f0c7cb6614f2d0470a3a60eb4efbc0aa8a9469053521572
MD5 76eed2bb1f28c2c325c634ae507c7ff2
BLAKE2b-256 cf2e29237918f8743964551b94faaaa18cea10362bfa387258f47ef98c7a5bbc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for inprompt-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40c44e46d320e197acc4220931505cbb1e27c98c410d0599d391a95b403cf8ca
MD5 7b632b5a9d065361328bda06cdb549a7
BLAKE2b-256 5708164d1a729b41aa0b14ab804f88beff54bdff38c8e046d0d89f9d8fe40053

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