@aloth/olcli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexander Loth
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # olcli
2
+
3
+ **Overleaf CLI** — Sync and manage your LaTeX projects from the command line.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/olcli.svg)](https://www.npmjs.com/package/olcli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Features
9
+
10
+ - 📋 **List** all your Overleaf projects
11
+ - ⬇️ **Pull** project files to local directory
12
+ - ⬆️ **Push** local changes back to Overleaf
13
+ - 🔄 **Sync** bidirectionally with smart conflict detection
14
+ - 📄 **Compile** and download PDFs
15
+ - 📦 **Download** individual files or full project archives
16
+ - 📤 **Upload** files to projects
17
+ - 📊 **Output** compile artifacts (`.bbl`, `.log`, `.aux` for arXiv submissions)
18
+
19
+ ## Installation
20
+
21
+ ### Homebrew (macOS/Linux)
22
+
23
+ ```bash
24
+ brew tap aloth/tap
25
+ brew install olcli
26
+ ```
27
+
28
+ ### npm
29
+
30
+ ```bash
31
+ npm install -g olcli
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### 1. Authenticate
37
+
38
+ Get your session cookie from Overleaf:
39
+
40
+ 1. Log into [overleaf.com](https://www.overleaf.com)
41
+ 2. Open Developer Tools (F12) → Application → Cookies
42
+ 3. Copy the value of `overleaf_session2`
43
+
44
+ ```bash
45
+ olcli auth --cookie "your_session_cookie_value"
46
+ ```
47
+
48
+ ### 2. List Projects
49
+
50
+ ```bash
51
+ olcli list
52
+ ```
53
+
54
+ ### 3. Pull a Project
55
+
56
+ ```bash
57
+ olcli pull "My Thesis"
58
+ cd My_Thesis/
59
+ ```
60
+
61
+ ### 4. Edit and Sync
62
+
63
+ ```bash
64
+ # Edit files locally with your favorite editor
65
+ vim main.tex
66
+
67
+ # Push changes back to Overleaf
68
+ olcli push
69
+
70
+ # Or sync bidirectionally
71
+ olcli sync
72
+ ```
73
+
74
+ ### 5. Compile and Download PDF
75
+
76
+ ```bash
77
+ olcli pdf
78
+ ```
79
+
80
+ ## Commands
81
+
82
+ All commands auto-detect the project when run from a synced directory (contains `.olcli.json`).
83
+
84
+ | Command | Description |
85
+ |---------|-------------|
86
+ | `olcli auth` | Set session cookie |
87
+ | `olcli whoami` | Check authentication status |
88
+ | `olcli logout` | Clear stored credentials |
89
+ | `olcli list` | List all projects |
90
+ | `olcli info [project]` | Show project details and file list |
91
+ | `olcli pull [project] [dir]` | Download project files to local directory |
92
+ | `olcli push [dir]` | Upload local changes to Overleaf |
93
+ | `olcli sync [dir]` | Bidirectional sync (pull + push) |
94
+ | `olcli upload <file> [project]` | Upload a single file |
95
+ | `olcli download <file> [project]` | Download a single file |
96
+ | `olcli zip [project]` | Download project as zip archive |
97
+ | `olcli compile [project]` | Trigger PDF compilation |
98
+ | `olcli pdf [project]` | Compile and download PDF |
99
+ | `olcli output [type]` | Download compile output files |
100
+ | `olcli check` | Show config paths and credential sources |
101
+
102
+ ## arXiv Submissions
103
+
104
+ Download the `.bbl` file for arXiv submissions:
105
+
106
+ ```bash
107
+ olcli output bbl --project "My Paper"
108
+ # Downloads: bbl
109
+ ```
110
+
111
+ List all available compile output files:
112
+
113
+ ```bash
114
+ olcli output --list
115
+ # Available output files:
116
+ # aux output.aux
117
+ # bbl output.bbl
118
+ # blg output.blg
119
+ # log output.log
120
+ # ...
121
+ ```
122
+
123
+ ## Sync Behavior
124
+
125
+ ### Pull
126
+ - Downloads all files from Overleaf
127
+ - **Skips** local files modified after last pull (won't overwrite your changes)
128
+ - Use `--force` to overwrite local changes
129
+
130
+ ### Push
131
+ - Uploads files modified after last pull
132
+ - Use `--all` to upload all files
133
+ - Use `--dry-run` to preview changes
134
+
135
+ ### Sync
136
+ - Pulls remote changes
137
+ - Preserves local modifications (local wins if newer)
138
+ - Pushes local changes to remote
139
+ - Use `--verbose` to see detailed file operations
140
+
141
+ ## Configuration
142
+
143
+ Credentials are stored in (checked in order):
144
+
145
+ 1. `OVERLEAF_SESSION` environment variable
146
+ 2. `.olauth` file in current directory
147
+ 3. Global config: `~/.config/olcli-nodejs/config.json` (macOS/Linux)
148
+
149
+ ### .olauth File
150
+
151
+ For project-specific credentials, create `.olauth` in your project directory:
152
+
153
+ ```
154
+ s%3AyourSessionCookieValue...
155
+ ```
156
+
157
+ ## Examples
158
+
159
+ ### Work on a thesis
160
+
161
+ ```bash
162
+ # Initial setup
163
+ olcli pull "PhD Thesis" thesis
164
+ cd thesis
165
+
166
+ # Daily workflow
167
+ vim chapters/introduction.tex
168
+ olcli sync
169
+ olcli pdf -o draft.pdf
170
+ ```
171
+
172
+ ### Quick PDF download
173
+
174
+ ```bash
175
+ olcli pdf "Conference Paper" -o paper.pdf
176
+ ```
177
+
178
+ ### Download a single file
179
+
180
+ ```bash
181
+ olcli download main.tex "My Project"
182
+ ```
183
+
184
+ ### Upload figures
185
+
186
+ ```bash
187
+ cd my-project
188
+ olcli upload figures/diagram.png
189
+ ```
190
+
191
+ ### Backup all projects
192
+
193
+ ```bash
194
+ for proj in $(olcli list --json | jq -r '.[].name'); do
195
+ olcli zip "$proj" -o "backups/${proj}.zip"
196
+ done
197
+ ```
198
+
199
+ ### Prepare for arXiv
200
+
201
+ ```bash
202
+ cd my-paper
203
+ olcli output bbl -o main.bbl
204
+ olcli zip -o arxiv-submission.zip
205
+ ```
206
+
207
+ ## Troubleshooting
208
+
209
+ ### Session expired
210
+
211
+ If you get authentication errors, your session cookie may have expired. Get a fresh one from the browser and run `olcli auth` again.
212
+
213
+ ### Compilation fails
214
+
215
+ Check the Overleaf web editor for detailed error logs. Common issues:
216
+ - Missing packages
217
+ - Syntax errors in `.tex` files
218
+ - Missing bibliography files
219
+
220
+ ## Contributing
221
+
222
+ Contributions are welcome! Please open an issue or submit a pull request.
223
+
224
+ ## License
225
+
226
+ MIT © [Alexander Loth](https://alexloth.com)
package/dist/cli.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * olcli - Overleaf Command Line Interface
4
+ *
5
+ * Command-line access to Overleaf projects using session cookies
6
+ * for authentication. Download, upload, sync, and compile LaTeX projects.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}