# Contributing to Papilot Thanks for helping. Papilot is young, so every bug report, idea and pull request shapes it. ## Ways to help - **Try it and tell us what broke.** Open an [issue](https://github.com/PapilotAI/papilot/issues/new/choose) with your Papilot version (`papilot --version`), your OS, Node.js and TeX distribution, and the steps to reproduce. - **Share ideas and questions** in [Discussions](https://github.com/PapilotAI/papilot/discussions), including how you use Papilot on your own papers. - **Pick up an issue.** Issues labelled [good first issue](https://github.com/PapilotAI/papilot/labels/good%20first%20issue) are small and well described; [help wanted](https://github.com/PapilotAI/papilot/labels/help%20wanted) ones are larger. - **Improve the docs**: the [README](../README.md), its [Chinese version](../docs/readme/README.zh-CN.md), the [user documentation](../docs/guide.md) ([简体中文](../docs/guide.zh-CN.md), source in `docs/guide/`) and [development internals](../docs/development.md). ## Set up You need Node.js 22.22+, Git and a full TeX distribution. An agent is only needed to run real tasks; the tests never start one. With [Nix](../docs/nix.md), run `nix develop` inside the checkout to provide these tools, then follow the npm steps below. ```sh git clone https://github.com/PapilotAI/papilot && cd papilot npm ci npm run setup:review # install and build the review engine npm run build npm start # http://127.0.0.1:7274 ``` `npm run demo` adds the example paper. Use another `PAPILOT_PORT` and `PAPILOT_DATA` to run beside an instance you already use. On Windows, install [Git for Windows](https://git-scm.com/download/win) and a TeX distribution (MiKTeX or TeX Live) and run the same commands in PowerShell or CMD. Tests that need POSIX signals or a POSIX shell skip themselves; the rest run natively. `npm run dev` restarts the server when its code changes. After changing the interface, run `npm run build` and reload the page; the server serves the new build without a restart. To run this checkout alongside your usual instance with separate state: ```sh npm run build PAPILOT_PORT=7276 PAPILOT_DATA="$HOME/.papilot-dev" PAPILOT_PUBLIC_ORIGIN= npm run dev ``` Open `http://127.0.0.1:7276`. For the latest committed development version without running a checkout, use **Settings → Updates → Dev (GitHub main)** in an installed Papilot. ## Where things are | Path | What it holds | | --- | --- | | `src/server` | The Fastify server, the agent adapters (Papilot Writer, Pi through RPC, Codex, Claude, Cursor, GLM, Antigravity, and Copilot, Grok, Kimi, DeepSeek, Qwen and OpenCode through ACP), tasks, Git and the PDF build | | `src/web` | The React interface and the PDF viewer | | `src/shared.ts` | Types shared by the server and the interface | | `desktop/` | Electron app, native assets, packaging and desktop runtime | | `docs/` | User documentation (`docs/guide/`, plus GitHub hubs `docs/guide.md` and `docs/guide.zh-CN.md`), [development internals](../docs/development.md), architecture notes, images and translated READMEs in `docs/readme/` | | `i18n/` | Translation configuration, source catalogs and translation state | | `.github/` | Workflows, contribution guide, security policy and community files | | `engine/` | The review engine that builds and compares the PDFs, with its own tests | | `bin/papilot.mjs` | The `papilot` command installed by npm | | `examples/papilot-paper` | The example paper used by `papilot demo` | | `tests`, `scripts/check-ui.mjs` | Unit tests and the browser checks | ## Before you open a pull request ```sh npm run typecheck npm test npm run test:ui # interface changes; needs Chrome ``` Changes to the review engine also need `npm test` in `engine/`. - Keep a pull request to one change, and add or update tests for any change in behavior. - Match the code around you: its naming, comment density and idioms. - Interface text is in English and says plainly what happens. - Write commit messages as a short imperative summary, with a body that explains why. - Attach screenshots for interface changes. - When an interface change shows in the homepage's windows (`site/index.html`), redraw them there; `npm run readme:showcase` then recaptures the README images in `docs/assets/readme-showcase/` from the homepage and the real interface. By contributing, you agree that your work is released under the [MIT License](../LICENSE). Please follow the [Code of Conduct](CODE_OF_CONDUCT.md).