Skip to content

Commit

Permalink
Added crate level doc to intro the crate and provide examples
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmayhew committed Jan 29, 2024
1 parent 073367c commit d327a28
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
//! Pipe your content to gpt directly from the command line.
//! A concept that allows for a lot of possibilities in local environments and CI pipelines
//!
//! ```sh
//! tail -30 /var/httpd.log | pipe-gpt --p "Is there anything in the http log file I should fix?"
//! ```
//!
//! ```sh
//! cat main.rs | pipegpt -p "How would you improve this code? Include line numbers in your comments so I can tell where you mean."
//! ```
//!
//!```sh
//!cat main.rs | pipegpt -p "Is this code production ready? If yes reply "Yes". If no, then explain why not. Be concise."
//!```
//!
//! ```sh
//! cat file.json | pipegpt -p "Convert this JSON to YAML" > file.yaml
//! ```
//!
//! ```sh
//! cat french.txt | pipegpt -p "Translate this to English please."
//! ```
//!
//! ```sh
//! git diff -- staged | pipegpt -p "Code review this code change"
//! ```
// atty to determine if data is piped in or not
use atty::Stream;
// clap for command line argument parsing
Expand Down Expand Up @@ -178,24 +205,7 @@ fn args_read (args_setup: Command) -> (std::string::String, i32, f32, f32, bool)
///
/// ## Example Usage
///
/// ```bash
/// tail -30 /var/httpd.log | pipe-gpt --p "Is there anything in the http log file I should fix?"
/// ```
/// ```bash
/// cat main.rs | pipegpt -p "How would you improve this code? Include line numbers in your comments so I can tell where you mean."
/// ```
/// ```bash
/// cat main.rs | pipegpt -p "Is this code production ready? If yes reply "Yes". If no, then explain why not. Be concise."
/// ```
/// ```bash
/// cat file.json | pipegpt -p "Convert this JSON to YAML"
/// ```
/// ```bash
/// cat french.txt | pipegpt -p "Translate this to English please."
/// ```
/// ```bash
/// git diff -- staged | pipegpt -p "Code review this code change"
/// ```
/// Please see [crate] level docs for usage examples
#[tokio::main]
async fn main() {
// enable logging
Expand Down

0 comments on commit d327a28

Please sign in to comment.