JSPM

@promptg/cli

0.9.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q87334F
  • License Apache-2.0

Prompts as code: versioned, shareable, standard.

Package Exports

  • @promptg/cli
  • @promptg/cli/dist/cli.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@promptg/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PromptG CLI

Prompts as code. Versioned, shareable, standard.

npm version CI License

PromptG CLI is a tool for managing AI prompts as versioned JSON files, allowing easy storage, sharing, and rendering to plain text for use with any LLM.

promptg get code-review | llm

Quickstart (60 seconds)

Requirements: Node.js 20.12+

# Install
npm install -g @promptg/cli

# Create a project store (.promptg/)
promptg init

Create a prompt (stdin -> stored JSON):

echo "Review this code for correctness, security, and performance." | promptg prompt save code-review

Render it (stdout -> pipe anywhere):

promptg get code-review | llm

CLI (scriptable, pipe-friendly)

The CLI is designed for automation: render prompts to stdout, inject runtime context via variables, and pipe into any runner.

# With variables
promptg get code-review --var language=Python --var focus=security | llm

# Load multiline values from a file (diffs/logs/etc.)
git diff > pr-diff.txt
promptg get pr-review --var diff@pr-diff.txt | llm

How It Works

  • Store prompts/templates as JSON in a user store (~/.promptg/) or a project store (.promptg/).
  • Render prompts with promptg get <name> (plain text to stdout).
  • Templates are not rendered; instantiate them into prompts with promptg prompt new <prompt-name> --from-template <template>.
  • Share across repos/teams by committing .promptg/ or distributing packs.

Core Concepts

  • Prompt: a ready-to-run, concrete prompt. It has final-ish text (may still include variables) and is meant to be rendered and used directly via promptg get <name>.
  • Template: a reusable blueprint designed to be instantiated into prompts. It's the portable, shareable source-of-truth for a workflow (PR review, release notes, issue triage), and can include defaults + optional interactive metadata.
  • Pack: a versioned bundle of prompts/templates for sharing across repos.

Blueprints -> Instances

The intended workflow is:

  • Install or author templates (blueprints) once.
  • Create prompts (instances) from templates for a specific repo/team/task.
  • Dispose/regenerate prompts freely as your context changes; keep templates stable.

Why templates require metadata:

  • Catalog separation: tools can separate a "Template Catalog" (browse blueprints) from "My Prompts" (execute instances), reducing noise.
  • Catalog quality: required displayName/description ensures useful browsable views.

Quick examples:

promptg prompt new my-pr-review --from-template pr-review --var diff@changes.txt
promptg get my-pr-review | llm
echo "Review code" | promptg prompt save code-review         # Save prompt
promptg get code-review | llm                               # Execute prompt

Ecosystem

Routing:

One Prompt Source. Everywhere You Work.

PromptG stores prompts/templates as JSON in git and renders plain text you can use in LLM runners, CI, and editor extensions -- you choose.

  • Stop Slack prompts: the same prompt works for devs and CI.
  • No prompt drift: changes are reviewed, versioned, and reproducible.
  • Templates + variables: one standard prompt, many contexts.
  • Tool-agnostic: swap models/tools without rewriting prompts.

Documentation

Contributing

See CONTRIBUTING.md.

Support

Release Workflow

  • Changes land via PRs to main.
  • Releases are tagged from main as vX.Y.Z and published to npm as @promptg/cli.

License

Apache-2.0