https://github.com/danburonline/tlmr-cli
A CLI tool that uses GPT-4 to automatically generate summaries of scientific papers, formatted in the IMRaD structure, by simply adding PDFs of the papers to a user-specified directory.
https://github.com/danburonline/tlmr-cli
openai paper tldr
Last synced: about 2 months ago
JSON representation
A CLI tool that uses GPT-4 to automatically generate summaries of scientific papers, formatted in the IMRaD structure, by simply adding PDFs of the papers to a user-specified directory.
- Host: GitHub
- URL: https://github.com/danburonline/tlmr-cli
- Owner: danburonline
- License: mit
- Created: 2023-01-19T18:36:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T15:18:25.000Z (almost 3 years ago)
- Last Synced: 2026-04-22T14:00:03.303Z (about 2 months ago)
- Topics: openai, paper, tldr
- Language: TypeScript
- Homepage:
- Size: 31.7 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Too Long, Might Read
Too Long, Might Read (TLMR) is a CLI tool that uses GPT4 to generate summaries of scientific papers. It targets papers formatted in the [IMRaD](https://en.wikipedia.org/wiki/IMRAD) structure. Just point TLMR to a directory containing your PDFs, and it will do the rest!
## Installation
### Prerequisites
- OpenAI API key
- Bun `>= 0.6.14`
### Steps
1. Clone this repository.
2. Install dependencies with `bun install`.
3. Create a `.env` file in the root directory of the project and add your OpenAI API key:
```txt
OPENAI_API_KEY=
```
Alternatively, when running the tool, you can pass your API key via the `-k` flag.
## Build
To build the project, use Bun to compile the TypeScript:
```bash
bun build ./src/main.ts --compile --outfile tlmr
```
This will create an executable called `tlmr` in the project's root directory.
## Usage
After building, you can run the tool with the following command:
```bash
./tlmr -f
```
If you opted not to use the .env file, pass the API key via the `-k` flag:
```bash
./tlmr -f -k
```
## Development
During development, you can use Bun to run the script directly:
```bash
bun run start -f
```
Or with the API key:
```bash
bun run start -f -k
```
## More About TLMR
TLMR uses [LangChain.js](https://js.langchain.com) to communicate with the OpenAI API. The main logic is in [`src/main.ts`](./src/main.ts).
This project uses [Bun](https://bun.sh) instead of Node. By using Bun, we can write in TypeScript without needing a separate transpiler like Babel. Plus, it's a great opportunity to explore the capabilities of Bun, a promising tool for JavaScript/TypeScript development.
To get started, check out the example PDF in the example folder. There is also an [`.env.template`](.env.template) file in the project's root directory. Use this template to create your own `.env` file.
Happy summarising!