go-book-ai
is a CLI tool for generating book chapters using AI. It leverages language models like OpenAI's GPT to create detailed outlines and content for book chapters.
- Go 1.20 or later
- OpenAI API Key
-
Clone the repository:
git clone https://github.com/yourusername/go-book-ai.git cd go-book-ai
-
Initialize the Go module:
go mod init go-book-ai go mod tidy
-
Set the OpenAI API Key as an environment variable:
export OPENAI_API_KEY=your_openai_api_key
-
Build the CLI application:
go build ./cmd/bookcli
To create a new book with a specific topic:
./bookcli new "Your Book Topic"
To continue working on an existing book:
./bookcli continue "book_id"
Run the tests to ensure everything is working correctly:
go test ./...
The application includes robust error handling with retries and exponential backoff for network-related issues and rate limits.
Feel free to submit issues, fork the repository, and send pull requests. Contributions are welcome!
This project is licensed under the MIT License.