|
| 1 | +<!DOCTYPE html> |
| 2 | +<!--[if IE]><![endif]--> |
| 3 | +<html> |
| 4 | + |
| 5 | + <head> |
| 6 | + <meta charset="utf-8"> |
| 7 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 8 | + <title>💻 CLI Usage Guide | PromptStream.AI Documentation </title> |
| 9 | + <meta name="viewport" content="width=device-width"> |
| 10 | + <meta name="title" content="💻 CLI Usage Guide | PromptStream.AI Documentation "> |
| 11 | + |
| 12 | + |
| 13 | + <link rel="shortcut icon" href="../favicon.ico"> |
| 14 | + <link rel="stylesheet" href="../styles/docfx.vendor.min.css"> |
| 15 | + <link rel="stylesheet" href="../styles/docfx.css"> |
| 16 | + <link rel="stylesheet" href="../styles/main.css"> |
| 17 | + <meta property="docfx:navrel" content=""> |
| 18 | + <meta property="docfx:tocrel" content=""> |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + </head> |
| 23 | + <body data-spy="scroll" data-target="#affix" data-offset="120"> |
| 24 | + <div id="wrapper"> |
| 25 | + <header> |
| 26 | + |
| 27 | + <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> |
| 28 | + <div class="container"> |
| 29 | + <div class="navbar-header"> |
| 30 | + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> |
| 31 | + <span class="sr-only">Toggle navigation</span> |
| 32 | + <span class="icon-bar"></span> |
| 33 | + <span class="icon-bar"></span> |
| 34 | + <span class="icon-bar"></span> |
| 35 | + </button> |
| 36 | + |
| 37 | + <a class="navbar-brand" href="../index.html"> |
| 38 | + <img id="logo" class="svg" src="../logo.svg" alt=""> |
| 39 | + </a> |
| 40 | + </div> |
| 41 | + <div class="collapse navbar-collapse" id="navbar"> |
| 42 | + <form class="navbar-form navbar-right" role="search" id="search"> |
| 43 | + <div class="form-group"> |
| 44 | + <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> |
| 45 | + </div> |
| 46 | + </form> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + </nav> |
| 50 | + |
| 51 | + <div class="subnav navbar navbar-default"> |
| 52 | + <div class="container hide-when-search" id="breadcrumb"> |
| 53 | + <ul class="breadcrumb"> |
| 54 | + <li></li> |
| 55 | + </ul> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </header> |
| 59 | + <div role="main" class="container body-content hide-when-search"> |
| 60 | + <div class="article row grid"> |
| 61 | + <div class="col-md-10"> |
| 62 | + <article class="content wrap" id="_content" data-uid=""> |
| 63 | +<h1 id="-cli-usage-guide">💻 CLI Usage Guide</h1> |
| 64 | + |
| 65 | +<p>The <strong>PromptStream.AI CLI</strong> allows you to quickly build, validate, and generate prompts directly from the terminal.</p> |
| 66 | +<hr> |
| 67 | +<h2 id="-build">🧱 Build</h2> |
| 68 | +<p>Render a prompt template with variables.</p> |
| 69 | +<pre><code class="lang-bash">promptstream build --template "./examples/welcome.txt" --var name=Andrew |
| 70 | +</code></pre> |
| 71 | +<p>Outputs:</p> |
| 72 | +<pre><code>✅ Prompt built successfully: |
| 73 | +Hello Andrew, welcome to PromptStream.AI! |
| 74 | +</code></pre> |
| 75 | +<hr> |
| 76 | +<h2 id="-validate">✅ Validate</h2> |
| 77 | +<p>Validate a prompt for completeness and token safety.</p> |
| 78 | +<pre><code class="lang-bash">promptstream validate --template "./examples/summary.txt" --var topic=AI |
| 79 | +</code></pre> |
| 80 | +<p>Outputs:</p> |
| 81 | +<pre><code>✅ Valid prompt (37 tokens) |
| 82 | +</code></pre> |
| 83 | +<hr> |
| 84 | +<h2 id="-generate">🤖 Generate</h2> |
| 85 | +<p>Build, validate, and generate a model reply.</p> |
| 86 | +<pre><code class="lang-bash">promptstream generate --template "./examples/summary.txt" --var topic=AI |
| 87 | +</code></pre> |
| 88 | +<p>Outputs:</p> |
| 89 | +<pre><code>✅ Generation complete: |
| 90 | +[TokenFlow gpt-4o-mini] processed 32 tokens. |
| 91 | +</code></pre> |
| 92 | +<hr> |
| 93 | +<h2 id="-context">💬 Context</h2> |
| 94 | +<p>Inspect or manage conversation history.</p> |
| 95 | +<pre><code class="lang-bash">promptstream context --load context.json --summarize |
| 96 | +promptstream context --clear --save context.json |
| 97 | +</code></pre> |
| 98 | +<p>Outputs:</p> |
| 99 | +<pre><code>📂 Loaded 4 messages from context.json |
| 100 | +Summary: 4 messages (user, assistant) |
| 101 | +</code></pre> |
| 102 | +<hr> |
| 103 | +<h3 id="-tips">🌈 Tips</h3> |
| 104 | +<ul> |
| 105 | +<li>Use <code>--template</code> for inline text or a file path.</li> |
| 106 | +<li>Chain variables with multiple <code>--var</code> arguments.</li> |
| 107 | +<li>Combine <code>--context</code> and <code>--save</code> to preserve conversation state.</li> |
| 108 | +</ul> |
| 109 | + |
| 110 | +</article> |
| 111 | + </div> |
| 112 | + |
| 113 | + <div class="hidden-sm col-md-2" role="complementary"> |
| 114 | + <div class="sideaffix"> |
| 115 | + <div class="contribution"> |
| 116 | + <ul class="nav"> |
| 117 | + <li> |
| 118 | + <a href="https://github.com/AndrewClements84/PromptStream.AI/blob/master/docs/cli-usage.md/#L1" class="contribution-link">Edit this page</a> |
| 119 | + </li> |
| 120 | + </ul> |
| 121 | + </div> |
| 122 | + <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> |
| 123 | + <h5>In this article</h5> |
| 124 | + <div></div> |
| 125 | + </nav> |
| 126 | + </div> |
| 127 | + </div> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + |
| 131 | + <footer> |
| 132 | + <div class="grad-bottom"></div> |
| 133 | + <div class="footer"> |
| 134 | + <div class="container"> |
| 135 | + <span class="pull-right"> |
| 136 | + <a href="#top">Back to top</a> |
| 137 | + </span> |
| 138 | + © 2025 AndrewClements84 · Built with DocFX |
| 139 | + |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + </footer> |
| 143 | + </div> |
| 144 | + |
| 145 | + <script type="text/javascript" src="../styles/docfx.vendor.min.js"></script> |
| 146 | + <script type="text/javascript" src="../styles/docfx.js"></script> |
| 147 | + <script type="text/javascript" src="../styles/main.js"></script> |
| 148 | + </body> |
| 149 | +</html> |
0 commit comments