vibepaper
AI-agent-friendly scientific paper builder — analysis outputs wire directly into manuscript text.
No reported result value in a vibepaper document is typed by hand. Analysis scripts write key results to named CSV files; the paper references those values by name using Jinja2 templates; the build substitutes every reference before producing Word output. Every number in the final document traces back to a computed file — not the author's memory, and not an AI agent's memory.
The name is a nod to vibe coding: give an AI agent write access to output/facts/, have it update CSVs as it runs analysis, and rebuild. The agent authors the narrative and iterates the analysis; it cannot inject numeric values directly into the manuscript. Nothing falls out of date.
Using an AI agent?
Paste ONBOARDING_PROMPT.md into your LLM agent in the target project. It walks through auditing hardcoded numbers, writing facts CSVs from your analysis scripts, and verifying the build. Already using vibepaper? RETROFIT_PROMPT.md converts the hand-written words next to your facts ("under 1%", "nearly a year") into word filters and asserts. The typical loop from there:
- Agent reads existing paper sections and analysis scripts
- Agent writes/updates
output/facts/*.csvafter each analysis run - You run
vibepaper— numbers update everywhere, with a hard error if any reference is missing
For a manual walkthrough, see the end-to-end example below.
The problem
Numbers in scientific prose go stale. You finish the analysis, write up the results, and six months later a reviewer asks you to rerun with a corrected dataset. Now you have updated CSVs and a paper full of hardcoded figures: "the mean increased from 4.6 to 9.2", "of the 7,318 variants that lost HIGH impact". Finding every number, checking which is still current, updating without introducing new errors — this is tedious, error-prone, and nearly impossible to review.
The solution
vibepaper separates computation from communication. Analysis scripts write their key results to named CSV files. The paper references those values by name using Jinja2 template syntax. The build pipeline substitutes every reference before passing the document to pandoc for final Word output.
Mean transcripts per variant doubled from
{{ vep_impact.giab_mean_v112 | dp(1) }} to
{{ vep_impact.giab_mean_v115_full | dp(1) }} on upgrading to Ensembl v115.
When you rerun the analysis, you rerun the build. The numbers update everywhere, simultaneously, with a loud error if any reference is missing.
Three design principles:
- Templates express intent; scripts express computation. No arithmetic in templates. If you need a percentage increase, the analysis script computes and writes it. The template formats it.
- Loud failures over silent omissions. A missing or renamed CSV column is a build error, not an empty string in the output.
- Every inserted value can be traced back to its template reference and source data file. Nothing is injected silently — if a value is in the paper, there is a
{{ }}reference in the Markdown and a data file that supplied it.
These constraints matter most in an agent-driven workflow: an agent can iterate analysis freely and update CSVs, but it cannot introduce transcription errors because no values are ever typed by hand.
Why not Quarto or R Markdown? Those tools embed code in the document itself (literate programming) and are excellent for that model. vibepaper is language-agnostic — your analysis scripts can be Python, R, bash, or anything else, and the paper is plain Markdown. Word output is first-class for journal submission. And an AI agent can iterate the analysis and update CSVs without ever touching the manuscript source.
End-to-end example
-
Create a facts CSV with your analysis result:
mkdir -p output/facts printf "field,value\nn,412\nmean_age,54.3\n" > output/facts/cohort.csv
-
Write a Markdown section referencing those values — save as
paper/results.md:# Results The cohort included {{ cohort.n | commas }} participants with a mean age of {{ cohort.mean_age | dp(1) }} years. -
Create
paper.toml:[paper] sections = ["paper/results.md"] name = "my_paper"
-
Build:
vibepaper
-
The output at
output/my_paper_<date>.docxcontains:The cohort included 412 participants with a mean age of 54.3 years.
Now update cohort.csv (rerun your analysis), rebuild, and the numbers update everywhere automatically.
Installation
Requirements: Python ≥ 3.10.
Install vibepaper
pip install vibepaper
Verify: vibepaper --help
pandoc — which converts the rendered Markdown to Word — ships bundled with the install (via pypandoc-binary), so there is no separate system pandoc to install and no version wall (--citeproc needs pandoc ≥ 2.11). To use a specific pandoc instead of the bundled one, set the PYPANDOC_PANDOC environment variable to its path.
Installing into a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install vibepaper
Installing from source
git clone https://github.com/SACGF/vibepaper
cd vibepaper
pip install -e .
The -e flag installs in editable mode so changes to the source are reflected immediately.
Quick start
Option 1 — paper.toml (recommended for full papers)
Create paper.toml in your project root:
[paper]
sections = [
"paper/abstract.md",
"paper/introduction.md",
"paper/methods.md",
"paper/results.md",
"paper/discussion.md",
"paper/references.md",
"paper/figures.md",
]
supplementary = ["paper/supplementary.md"]
name = "my_paper"
Then build:
vibepaper
# outputs: output/my_paper_2025-06-01.docx
# output/my_paper_supplementary_2025-06-01.docx
Option 2 — sections file
Create a plain text file listing your sections in order:
# order.txt
paper/abstract.md
paper/methods.md
paper/results.md
paper/discussion.md
Then:
vibepaper --sections-file order.txt --name my_paper
Lines starting with # and blank lines are ignored. Paths are relative to the sections file's location.
Option 3 — direct file list
vibepaper paper/abstract.md paper/results.md paper/discussion.md --name my_paper
Template syntax
vibepaper uses Jinja2 for template substitution. References follow the pattern {{ namespace.field | filter }}.
Number formatting filters
| Filter | Example | Output |
|---|---|---|
| commas |
{{ n | commas }} |
254,129 |
| dp(n) |
{{ mean | dp(1) }} |
9.2 |
| fold(n) |
{{ ratio | fold(1) }} |
2.0-fold |
| fmt(spec) |
{{ v | fmt('+.1f') }} |
+3.7 |
dp (decimal places) is for numbers that will have surrounding text (e.g. "mean TPV was 9.2"). Use fmt for any format string Python's format() accepts.
There are also word filters (approx, orders_of_magnitude, within_pct, direction, article, number_word) that render the qualifier next to a number from the fact itself. See Words that depend on facts.
Percentages: fact scripts emit pre-multiplied percent values (a rate of 0.522 is stored as 52.2); templates only format them — {{ rate \| dp(1) }}% → 52.2%. There is deliberately no pct filter: its name invited passing a fraction while it expected an already-multiplied percent, which silently rendered the wrong magnitude (0.923 → 0.9% instead of 92.3%). See issue #4.
Examples
Of {{ clinvar.total_variants | commas }} ClinVar variants, {{ clinvar.gained_high_count | commas }}
({{ clinvar.gained_high_pct | dp(2) }}%) gained HIGH impact on upgrading to v115.
Mean transcripts per variant increased {{ vep.mean_fold | fold }} from
{{ vep.mean_v112 | dp(1) }} to {{ vep.mean_v115 | dp(1) }}.
Words that depend on facts
vibepaper keeps the digits in a paper current. The words next to the digits also make claims about them: direction ("falls from"), magnitude ("under 1%", "two orders of magnitude"), approximation ("close to a year"), ordering ("dominated by A then B"), totality ("all 8,409,757"). When a facts CSV is refreshed, the number updates but the words do not, so the sentence can end up contradicting its own number. vibepaper gives you three tools for this, best first:
- Word filters generate the word from the fact, so the two cannot disagree.
{% assert %}pins the condition a hand-written word depends on. The build fails if the condition stops holding.vibepaper lintandvibepaper difflist the sentences that neither of the above covers, so a re-read can start with them.
Word filters
Each filter takes one pre-computed fact, such as a ratio, a percent difference or a delta that your script emits. There is still no arithmetic in templates.
| Filter | Example | Output |
|---|---|---|
orders_of_magnitude |
{{ bench.rest_vs_uta_ratio | orders_of_magnitude }} |
over two orders of magnitude (130), nearly three orders of magnitude (850), roughly two and a half orders of magnitude (300) |
within_pct |
{{ r3.rest_vs_local_diff_pct | within_pct }} |
within 1% (0.7), within 2% (1.5) |
approx(sig=1, per=None, noun=None, plural=None) |
{{ bench.uta_days | approx(per=365, noun='year') }} |
over a year (408) |
{{ cohort.n | approx(sig=2) }} |
about 8,400,000 (8,409,757) |
|
{{ n | approx }} |
nearly 900 (870), just over 1,000 (1,030) |
|
direction(up, down, flat='is unchanged', tol=0) |
{{ eras.delta_pct | direction('rises', 'falls') }} |
rises / falls / is unchanged |
article |
{{ coverage.improvement_fold | fold(1) | article }} |
an 11.5-fold / a 13.9-fold |
number_word |
{{ n_cohorts | number_word }} |
three (3), 12 (12) |
How they choose a word:
approxrounds to an anchor: a 0.5 grid below 3 (so 1.5 and 2.5 are anchors), otherwisesigsignificant figures. Within ±2% of the anchor it says about, 2–10% below nearly, 2–5% above just over, and further above over. More than 10% below, it drops to the grid point below and says over.perdivides first (days → years). Withnoun, an anchor of one reads "a year" or "an hour".orders_of_magnitudeuseslog10(ratio). Within about ±5% of a power of ten it gives the plain count, up to 0.25 decades below nearly n, up to 0.25 above over n, and otherwise roughly n and a half. Ratios below 1 are treated as their reciprocal. Say "faster" or "slower" yourself, or usedirection.within_pctpicks the smallest band from 0.5, 1, 2, 5, 10, 20 and 50% that contains the value. Above 50% the build fails, because "within" is no longer an honest claim.directionchooses by sign. You supply the verbs, so tense and register stay yours.articlegoes by the first sound: 8, 11, 18, 80–89 and 800–899 (and 11,000 or 18,500) take an; vowel sounds, silent h and acronyms such as an SNV or an HGVS are handled.- Integers up to 10 are spelled out ("three"). Set
spell_out_up_toinpaper.tomlto change this (0 turns it off).
Before and after, from the vibepaper papers that prompted this (#9):
| Hand-written (went stale) | With a word filter |
|---|---|
differing by under 1% |
differing by {{ r3.diff_pct | within_pct }} |
roughly two orders of magnitude faster |
{{ bench.ratio | orders_of_magnitude }} faster |
extrapolates to close to a year |
extrapolates to {{ bench.uta_days | approx(per=365, noun='year') }} |
an {{ fold | fmt('.1f') }}× increase |
{{ fold | fold(1) | article }} increase |
UTA falls from X% to Y% |
UTA {{ eras.uta_delta | direction('rises', 'falls') }} from X% to Y% |
{% assert %}: make a hand-written claim checkable
Some wording cannot be generated: ordering, totality, or the threshold behind a judgement word. For those, keep your words and state the condition they rely on directly above the sentence:
{% assert residual.indel_count > residual.multi_locus_count, "'dominated by indel ... then paralog' order" %}
... is dominated by indel-representation differences ({{ residual.indel_count | commas }}) and by
paralog and copy-number transcripts ({{ residual.multi_locus_count | commas }}) ...
{% assert vsv.n_coordinate_changes == 0, "'every one ... gives the same coordinate'" %}
every one that resolves under the substitute gives the same coordinate
{% assert eras.old_uta < eras.mid_uta and eras.recent_uta < eras.mid_uta, "UTA lowest on oldest, mid era is best" %}
An assert renders nothing, and its line is removed, so it does not split the paragraph below it. If the condition is false, the build fails with the message, the file and line, and every fact the condition reads:
RuntimeError: paper/results.md:8: assertion failed: 'dominated by indel ... then paralog' order
residual.indel_count = 100
residual.multi_locus_count = 418
Comparisons inside an assert do not break "no arithmetic in templates", because nothing computed is printed. Name the sentence the assert protects in its message.
vibepaper lint: find the wording nothing checks
vibepaper lint # sections from paper.toml
vibepaper lint --check # exit 1 if anything is flagged (CI)
Lint lists every sentence that references a {{ fact }} and contains a claim word (rises, falls, higher, under, within, nearly, roughly, about, over, all, every, none, only, dominated, largest, most, doubled, -fold, versus, …), where the paragraph has neither a word filter nor an {% assert %}:
paper/results.md:3: roughly, orders of magnitude, faster
"REST throughput is {{ bench.rest_tps }} HGVS/s, roughly two orders of magnitude faster than UTA."
paper/results.md:11: every
"Every variant matched ({{ bench.matched_pct | dp(1) }}%)."
paper/results.md:11: {{ bench.matched_pct | dp(1) }} renders '100.0' but the value is 99.97: the rounded digits make a totality word ('all', 'every', 'none') look true
"Every variant matched ({{ bench.matched_pct | dp(1) }}%)."
The second kind of finding needs facts, and is reported even in covered paragraphs: a value that only rounds to 100.0 or 0.0 next to "every" or "none".
For a word that really is a hedge or a judgement ("just", "only", "striking"), accept it by adding {# lint-ok: reason #} anywhere in the paragraph. Put the comment at the end of a line rather than on a line of its own, so it does not leave a blank line in the output.
vibepaper diff: what changed, and which words to re-read
vibepaper build caches the facts it used (build/.last_facts.json) alongside the rendered Markdown. After you refresh the CSVs, vibepaper diff reports which facts changed, by name and by how much, and where the paper uses them. It then lists the unchecked sentences that use a changed fact, and finally the changed paragraphs:
3 fact(s) referenced in the paper changed:
bench.diff_pct 0.7 → 1.5 (+114%), referenced in paper/results.md ×2
bench.ratio 130 → 850 (+554%), referenced in paper/results.md
bench.rest_tps 16 → 111 (+594%), referenced in paper/results.md ×2
2 sentence(s) use a changed fact beside unchecked claim words (re-read these):
paper/results.md:3: roughly, orders of magnitude, faster
"REST throughput is {{ bench.rest_tps }} HGVS/s, roughly two orders of magnitude faster than UTA."
...
Retrofitting an existing paper
RETROFIT_PROMPT.md is an agent prompt for papers that already use vibepaper. It works through the vibepaper lint output and converts each flagged sentence to a word filter, an assert, or a documented lint-ok.
Data sources
Facts CSVs (primary)
The main data binding mechanism. Analysis scripts write CSVs to output/facts/. The filename stem becomes the template namespace; field names become template variables. One file per result group keeps each namespace small, explicit, and easy to diff in version control.
output/facts/
transcript_growth.csv → {{ transcript_growth.v112_count | commas }}
vep_impact.csv → {{ vep_impact.giab_mean_v115_full | dp(1) }}
clinvar_reclassification.csv → {{ clinvar_reclassification.total_variants | commas }}
Two CSV formats are supported (auto-detected):
Vertical format (preferred)
Two columns named field and value, one row per fact. Easier to read and diff when you have many fields:
field,value
v112_count,254129
v115_count,509650
Horizontal format
Column names as the header, with a single data row:
v112_count,v115_count
254129,509650
Both formats are referenced the same way:
Transcripts grew from {{ transcript_growth.v112_count | commas }}
to {{ transcript_growth.v115_count | commas }}.
vibepaper raises a hard error if a referenced field doesn't exist. It warns if the rendered output contains literal nan, None, or unresolved {{.
The facts_dir variable
The resolved facts directory path is automatically available in templates as {{ facts_dir }}. This is useful for image paths that live alongside your facts CSVs — especially when the output directory changes between runs (e.g. timestamped or hashed paths):


If your analysis writes to output/2026-03-21_8b1471f/, pass --facts-dir and the image paths update automatically:
vibepaper --facts-dir output/2026-03-21_8b1471f
No more editing hardcoded paths in the Markdown every time the analysis reruns.
JSON facts
JSON can be used instead of (or alongside) facts CSVs. Pass a JSON file or inline dict with --data:
# From file
vibepaper --data results.json
# Inline dict
vibepaper --data '{"cohort_size": 412, "stats": {"pvalue": 0.003}}'
Top-level keys become namespaces:
Cohort: {{ cohort_size }} participants (p = {{ stats.pvalue | dp(3) }}).
JSON values are merged on top of any facts CSVs. Nested dicts are deep-merged at the namespace level; scalar values override directly:
# facts CSV: stats.pvalue = 0.01, stats.n = 100
# JSON --data: {"stats": {"pvalue": 0.03}}
# result: stats.pvalue = 0.03, stats.n = 100
Use JSON when you prefer a single structured file over a directory of 1-row CSVs, or when your analysis already produces JSON output.
Table Directives
For supplementary tables, embed CSVs directly into the Markdown with a directive comment:
<!-- include-csv: output/consequence_changes.csv
columns: [consequence, v112_count, v115_count, pct_change]
rename:
v112_count: v112
v115_count: v115
pct_change: Change (%)
format:
v112_count: ",d"
v115_count: ",d"
pct_change: ".1f"
sort: [-pct_change]
max_rows: 20
-->
Directive options:
| Option | Description |
|---|---|
columns |
List of columns to include, in order |
rename |
Dict mapping column names to display names |
format |
Dict mapping column names to Python format specs |
align |
left, right, center, or per-column dict |
sort |
List of column names; prefix - for descending |
filter |
pandas query() expression |
max_rows |
Truncate to this many rows |
na_rep |
String to use for missing values (default: —) |
Citations
vibepaper supports pandoc's native citation processing. Write citations in your Markdown using [@citekey] syntax:
Variant consequences were predicted using VEP [@McLaren2016].
Variants were called against the MANE Select transcript set [@Morales2022; @Pozo2022].
pandoc resolves these against a BibTeX file and formats them using a CSL style file.
Setup
-
Create a
.bibfile (paper/references.bib) with your references in BibTeX format. Most reference managers (Zotero, Mendeley, Papers) can export this directly. -
Download a CSL file for your target journal:
vibepaper fetch-csl vancouver # numbered, most biomedical journals vibepaper fetch-csl nature vibepaper fetch-csl biomed-central vibepaper fetch-csl apa
This saves
paper/<style>.csl— commit it to your repo. Browse all ~10,000 available styles at zotero.org/styles. -
Add both to
paper.toml:bibliography = "paper/references.bib" csl = "paper/vancouver.csl"
-
Add a references section to your paper. Include a
{#refs}div so pandoc places the bibliography there rather than appending at the end:# References {% raw %} ::: {#refs} ::: {% endraw %}The
{% raw %}blocks prevent Jinja2 from interpreting the{#refs}syntax — they are stripped during the template pass and do not appear in the output.
BibTeX entry example
@article{McLaren2016,
author = {McLaren, William and others},
title = {The {Ensembl} Variant Effect Predictor},
journal = {Genome Biology},
year = {2016},
volume = {17},
pages = {122},
doi = {10.1186/s13059-016-0974-4},
}
@misc{MyDatabase,
author = {{My Consortium}},
title = {My Database},
year = {2024},
url = {https://example.org},
note = {Accessed 2024},
}
paper.toml reference
[paper]
# Manuscript sections in order (paths relative to paper.toml)
sections = [
"paper/title.md",
"paper/abstract.md",
"paper/introduction.md",
"paper/methods.md",
"paper/results.md",
"paper/discussion.md",
"paper/references.md",
"paper/figures.md",
]
# Built as a separate .docx unless --combined is passed
supplementary = ["paper/supplementary.md"]
# Output filename stem: {name}_{date}.docx
# Default: parent directory name
name = "my_paper"
# Directory of 1-row facts CSVs
# Default: "output/facts"
facts_dir = "output/facts"
# Output directory for .docx files
# Default: "output"
output_dir = "output"
# Intermediate build directory
# Default: "build"
build_dir = "build"
# Word reference document for custom formatting (double spacing, line numbers, etc.)
# Only used if the file exists; ignored if not present.
# Default: "paper/reference.docx"
reference_doc = "paper/reference.docx"
# BibTeX bibliography file. Enables pandoc --citeproc when present.
# Use [@citekey] syntax in Markdown to cite.
bibliography = "paper/references.bib"
# CSL citation style file. Download from zotero.org/styles.
# Falls back to pandoc's default (Chicago author-date) if omitted.
csl = "paper/vancouver.csl"
# Word filters (approx, orders_of_magnitude, number_word) spell out integers
# up to this value ("three" rather than "3"). 0 disables.
# Default: 10
spell_out_up_to = 10
Word reference document
To apply journal-specific formatting (e.g. double line spacing, continuous line numbering):
- Open a blank Word document
- Set paragraph spacing to Double and enable Layout → Line Numbers → Continuous
- Save as
paper/reference.docx
vibepaper will use it automatically if it exists at the configured path.
PDF output
Pass --pdf to produce a PDF alongside each .docx:
vibepaper --pdf
Note: PDF output is not suitable for journal-specific layout requirements. Use
.docxfor submission; PDF is useful for sharing readable drafts.
The pipeline is: pandoc renders the Markdown sections to a self-contained HTML document (images embedded as data URIs), then weasyprint converts that HTML to PDF entirely in Python. Citations and bibliography work the same as for Word output. This works well for typical manuscript content; complex layout requirements (multi-column, precise figure placement, journal-specific PDF templates) may not render as expected.
PDF system libraries. Unlike DOCX (pandoc is bundled), PDF output needs weasyprint's native libraries (pango, cairo, gdk-pixbuf, harfbuzz). If they are missing, --pdf exits non-zero with install instructions instead of a raw traceback (sudo apt-get install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf-2.0-0 libffi-dev libcairo2 on Debian/Ubuntu; brew install pango gdk-pixbuf libffi on macOS; see the weasyprint install guide).
For build pipelines that should produce a PDF only when the toolchain is present:
vibepaper --pdf-if-available # builds the PDF if possible, otherwise warns and skips it (still exits 0)
vibepaper build --is-pdf-available # probe only: prints "yes"/"no" and exits 0/1 so a script can branch
CLI reference
vibepaper [build] [FILE.md ...] [options]
Input (choose one):
FILE.md ... Markdown files in order (no paper.toml needed)
--sections-file FILE Plain text file with one .md path per line
--config FILE paper.toml config file (default: paper.toml)
Data:
--data JSON JSON file path or inline dict for template context
--facts-dir DIR Override facts CSV directory
Output:
--output-dir DIR Output directory for .docx files
--name NAME Output filename stem
--combined Merge supplementary into main document
--pdf Also produce a PDF alongside each .docx (errors if the
weasyprint toolchain is missing)
--pdf-if-available Produce a PDF when the toolchain is present, else skip it
--is-pdf-available Probe the PDF toolchain; print yes/no and exit 0/1
--md Also write rendered Markdown alongside each .docx
Flags:
--verbose, -v Print detailed progress
vibepaper fetch-csl <style> [--output FILE]
Download a CSL style file from zotero.org/styles to paper/<style>.csl.
Commit the downloaded file to your repo.
vibepaper fetch-csl vancouver
vibepaper fetch-csl nature --output paper/custom.csl
vibepaper wrap <FILE.md ...> [--width N] [--check]
Wrap long lines in Markdown files without breaking {{ ... }} template
expressions. Treats template expressions as atomic tokens that are never
split across lines. Preserves headings, blank lines, list items, tables,
code blocks, and indentation.
vibepaper wrap paper/results.md # in-place, default 88 cols
vibepaper wrap paper/*.md --width 72 # custom width
vibepaper wrap paper/*.md --check # exit 1 if changes needed (CI)
vibepaper lint [FILE.md ...] [--config FILE] [--facts-dir DIR] [--check]
List sentences that reference a {{ fact }} and contain a claim word
(rises, within, nearly, all, every, dominated, ...) with no word filter or
{% assert %} in the paragraph, and facts that round to 100.0/0.0 beside
"every"/"none". Mark a paragraph {# lint-ok: reason #} to accept it.
vibepaper lint # sections from paper.toml
vibepaper lint --check # exit 1 if anything flagged (CI)
vibepaper diff [--config FILE]
Compare the current render against the last build: which facts changed
(by name, with where they are used), which unchecked sentences use a
changed fact, and which paragraphs changed.
vibepaper sync [--config FILE] [--dry-run] [--verbose]
Push paragraph-level changes to a Google Doc as tracked-change suggestions.
On first run, creates a new Google Doc. On subsequent runs, diffs against
the last-synced version and pushes only changed paragraphs.
Requires .vibepaper/credentials.json (a "Desktop app" OAuth client secret
from Google Cloud Console). Will open a browser for authentication on first
use. See "Setting up Google Docs sync" below. Keep .vibepaper/ out of git.
Install sync dependencies: pip install vibepaper[sync]
vibepaper sync # push changes
vibepaper sync --dry-run # preview without pushing
Setting up Google Docs sync
vibepaper sync pushes each rebuild into a Google Doc as tracked-change suggestions, so collaborators' comments survive. It needs a one-time Google Cloud setup to get an OAuth client secret. This is free and needs no app verification for personal or lab use.
- Install the sync extras:
pip install vibepaper[sync] - Create (or pick) a Google Cloud project at console.cloud.google.com.
- Enable the Google Docs API: APIs & Services → Library → Google Docs API → Enable. vibepaper only requests the
https://www.googleapis.com/auth/documentsscope, so the Drive API is not needed. If you skip this step, the first sync fails atbatchUpdate. - Configure the OAuth consent screen: APIs & Services → OAuth consent screen (called Google Auth Platform in newer consoles).
- User type External (or Internal if you are on a Google Workspace org and only org members will sync).
- Fill in the app name and your email; no other fields are needed.
- Leave the app in Testing. You do not need to publish it or have it verified.
- Under Test users, add the Google account you will sign in with. While the app is in Testing, Google rejects sign-in from any account that is not on this list.
- Create the OAuth client: APIs & Services → Credentials → Create credentials → OAuth client ID → Application type Desktop app.
- It must be Desktop app, not Web application. vibepaper uses the installed-app flow (a local browser redirect), which only works with Desktop clients. You can check the downloaded JSON: a Desktop secret has a top-level
"installed"key, a Web one has"web". vibepaper refuses a Web secret with an explanatory error.
- It must be Desktop app, not Web application. vibepaper uses the installed-app flow (a local browser redirect), which only works with Desktop clients. You can check the downloaded JSON: a Desktop secret has a top-level
- Download the JSON and save it as
.vibepaper/credentials.jsonin your project root (next topaper.toml). - Keep
.vibepaper/out of git. It holds the client secret and, after the first sync, a refresh token (token.json) that grants access to your Google Docs. Add this to your project's.gitignore:/.vibepaper/vibepaper syncprints a warning if it finds.vibepaper/is not ignored. - Build, then run the first sync:
vibepaper vibepaper syncA browser opens for sign-in. Because the app is unverified you will see "Google hasn't verified this app". This is expected for your own Testing app: click Advanced → Go to (app name) (unsafe), then allow access. The token is cached in.vibepaper/token.json, so later syncs do not open a browser.
The first sync creates a new Google Doc and prints its URL. Share it with collaborators as usual. Later syncs push only the changed paragraphs as suggestions (use --dry-run to preview them).
Headless / CI use: the first authorization has to happen in a browser. Run vibepaper sync once on a machine with a browser, then copy .vibepaper/token.json, credentials.json and sync_state.json to the headless machine, for example from a CI secret. Do not commit them.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Error 403: access_denied in the browser |
Your account is not listed under Test users on the consent screen |
... is a 'Web application' OAuth client secret |
The client was created as Web application; create a Desktop app client instead |
Google Docs API has not been used in project ... or it is disabled |
Enable the Google Docs API (step 3) |
invalid_grant / token expired |
Delete .vibepaper/token.json and re-run to sign in again. Refresh tokens for apps in Testing expire after 7 days |
Project layout convention
my_paper/
├── paper.toml
├── .gitignore ← include /.vibepaper/ if you use sync
├── .vibepaper/ ← sync credentials + state (secrets, never commit)
├── paper/
│ ├── abstract.md
│ ├── introduction.md
│ ├── methods.md
│ ├── results.md
│ ├── discussion.md
│ ├── references.md
│ ├── figures.md
│ ├── supplementary.md
│ ├── reference.docx ← optional Word formatting template
│ ├── references.bib ← BibTeX bibliography
│ └── vancouver.csl ← CSL citation style
├── output/
│ ├── facts/
│ │ ├── cohort.csv ← field,value: n_patients, n_controls, ...
│ │ ├── model_results.csv ← field,value: auc, pvalue, effect_size, ...
│ │ └── ...
│ └── tables/
│ └── full_results.csv ← multi-row: used in include-csv directives
└── scripts/
└── run_analysis.py ← writes to output/facts/
Migrating an existing paper
Use ONBOARDING_PROMPT.md — see Using an AI agent? above.
What vibepaper does not do
vibepaper keeps manuscripts consistent with analysis outputs; it does not make analyses themselves reproducible. These are deliberately out of scope:
- Running your analysis scripts — vibepaper reads their outputs; it does not execute them or manage dependencies between them.
- Tracking whether outputs are current — it trusts whatever is in
output/facts/at build time. If you rerun a script and forget to rebuild, the paper will use stale data. A Snakemake workflow or similar is the right tool for dependency tracking. - Figure generation — plots and diagrams are produced by your scripts and embedded in Markdown as normal images. vibepaper does not generate or verify them.
- Environment reproducibility — Python versions, package versions, and input datasets are outside its scope. Use conda environments, Docker, or similar for that.
- Reference management — vibepaper delegates citation processing entirely to pandoc and the BibTeX/CSL ecosystem.
Changelog
See CHANGELOG.md for release history.
Metadata
Release files for vibepaper 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vibepaper-0.9.0.tar.gz | 240.9 kB | Without provenance | Details for vibepaper-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vibepaper-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for vibepaper-0.9.0-py3-none-any.whl |
Total release size: 293.4 kB
Release files / vibepaper-0.9.0.tar.gz
| Download URL | vibepaper-0.9.0.tar.gz |
|---|---|
| Size | 240.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f08b809aec50fd993f311a72fd7f7cde42121fb61e34cf6196f4f948c0d47648
|
|
BLAKE2b-256 checksum How to use checksums |
1e5d084b5e39132783ba2043cf9a41d78ff105a995ab49eabdbe01b751658a3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / vibepaper-0.9.0-py3-none-any.whl
| Download URL | vibepaper-0.9.0-py3-none-any.whl |
|---|---|
| Size | 52.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
000c82ce803f3edea99af8c99b4f724a385d913eacf6d6c120dd4acbcea5f2ac
|
|
BLAKE2b-256 checksum How to use checksums |
3efda503407fc6bc9f7ef151e4613737da5a4b617506cbe9b2883f885358d5c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for vibepaper 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.