cargo-gpt

Crates.iocargo-gpt
lib.rscargo-gpt
version0.1.1
sourcesrc
created_at2023-03-18 14:22:39.840052
updated_at2023-03-18 14:54:52.434873
descriptionDump your crate contents into a format which can be passed to GPT
homepagehttps://github.com/segeljakt/cargo-gpt
repositoryhttps://github.com/segeljakt/cargo-gpt
max_upload_size
id813766
size9,670
Klas Segeljakt (segeljakt)

documentation

https://github.com/segeljakt/cargo-gpt

README

cargo-gpt

ChatGPT can now handle up to 25000 words of input, making it possible to analyze medium-sized software projects / Rust crates. This is a basic utility which writes all Rust source code in your crate plus markdown documentation and directory structure to standard output so it can be passed as input to ChatGPT.

Installation

cargo install cargo-gpt

Usage

cargo new --bin hello-world
cd hello-world
cargo gpt

Output

```toml
// Cargo.toml
[package]
name = "hello-world"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
```
```rs
// src/main.rs
fn main() {
    println!("Hello, world!");
}
```

Copying to clipboard

You can also copy the output directly to clipboard using:

cd /path/to/crate

cargo gpt | pbcopy  # macOS
cargo gpt | setclip # Linux
cargo gpt | clip    # Windows

Future Extensions

Any ideas for future extensions are welcome. Just open an issue or pull request :blush:

Commit count: 3

cargo fmt