Skip to content

feat: add project creation command - #47

Merged
aloth merged 2 commits into
aloth:mainfrom
mohamedsobhi777:feat/project-create
Sep 4, 2026
Merged

feat: add project creation command#47
aloth merged 2 commits into
aloth:mainfrom
mohamedsobhi777:feat/project-create

Conversation

@mohamedsobhi777

Copy link
Copy Markdown
Contributor

Summary

  • add OverleafClient.createProject() for blank and example projects
  • add olcli project create <name> with --template blank|example and --json
  • export the new public API types and document the CLI/library workflows
  • add HTTP-level tests for request construction, response mapping, validation, and failures

Usage

olcli project create "My Paper"
olcli project create "Example Paper" --template example
olcli project create "Automation Project" --json

Validation

  • npm test — 10 passing
  • npm run build
  • npm pack --dry-run
  • git diff --check

npm run lint is currently unavailable because the repository does not install the ESLint executable referenced by that script.

Live verification

The authenticated /project/new flow was also verified against overleaf.com with a temporary test project before implementation. The automated suite uses a local HTTP server and does not create remote projects.

mohamedsobhi777 and others added 2 commits September 2, 2026 12:21
Resolves the conflict introduced by ten commits that landed on main after this branch was opened: the diff command from aloth#48, dead-code removal, pull request CI with a working lint setup, the engines correction to Node >=20.18.1, and the 0.10.0 release.

CHANGELOG.md was the only conflict. Both sections are kept as they are: the Unreleased entry from this branch and the [0.10.0] entry from main describe different work, and consolidating them into a single release entry is a separate step.

src/cli.ts and src/client.ts merged cleanly despite both being touched on main, because this branch adds new blocks rather than editing existing ones.
@aloth

aloth commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Thanks for this - the local HTTP server in the tests is the right call. Asserting on the actual request that goes out, without needing an Overleaf account, is exactly the split this repo wants more of.

I pushed a merge of main into your branch rather than asking you to rebase, since the drift was on our side: ten commits landed after you opened this PR.

What changed on main in the meantime:

Only CHANGELOG.md conflicted: your ## Unreleased against the ## [0.10.0] entry. Both sections are kept as they are; consolidating them into one release entry is a separate step. src/cli.ts and src/client.ts merged cleanly despite both being touched, because your change adds new blocks rather than editing existing ones.

One note on your validation section: npm run lint works now. It was broken exactly as you describe when you opened this PR - that was #46, fixed yesterday. Your branch is the first outside contribution to run through the new CI, and both legs pass, Node 20.18.1 and 24.

Verified on the merged state: build and lint clean, 38 tests passing, olcli project create --help resolves.

Merging this now and shipping it as part of 0.11.0. A create_project MCP tool follows as a separate commit - createProject() only exists on main after this merge, so it could not have been written before it.

@aloth
aloth merged commit 26b19f0 into aloth:main Sep 4, 2026
2 checks passed
aloth added a commit that referenced this pull request Sep 4, 2026
`olcli project create` landed in #47 as a CLI command only. The MCP server exposes 18 tools covering listing, pulling, pushing, compiling, renaming and diffing, but nothing that creates a project - so an assistant asked to start a new paper either shells out to the CLI or cannot help. This is a separate commit because `createProject()` only exists on main after that merge; the tool could not have been written before it.

Unlike `plan_project_renames`, this one applies rather than previews. The plan-only restriction there exists because a bulk rename across an account is unrecoverable: Overleaf keeps no name history and tolerates duplicates, so a bad pattern succeeds silently. Creating is the opposite case - additive, nothing existing is touched, and an unwanted project can be deleted afterwards. Making it plan-only would have been caution copied without its reason.

The response is the `CreatedProject` shape from the client plus the template that was used, so a caller can tell a blank project from an example one without asking again.

Registration verified over a real MCP handshake rather than by reading the source: initialize followed by tools/list returns 19 tools including create_project, with `name` required and `template` optional.
aloth added a commit that referenced this pull request Sep 4, 2026
…nfig path

#47 landed with its own Unreleased section. It becomes the 0.11.0 entry, together with the create_project MCP tool added in the previous commit.

0.11.0 rather than 0.10.1: `olcli project create` and `createProject()` are new surface, and the package root exports three new types.

mohamedsobhi777 gets a Contributors line, following the convention already used in 0.4.0, 0.6.0 and 0.10.0. The merge commit records the code authorship; this records the credit where the release notes are read.

The README also stops naming a global config path that is only correct on Linux. Reported in #50: `conf` resolves to ~/Library/Preferences/olcli-nodejs/config.json on macOS, verified here, and no config exists under ~/.config at all. The docs now point at `olcli check`, which prints the real path on any platform. While there, `olcli auth --save-local` is documented as writing .olauth into the current directory, which is usually the user's LaTeX project: this repository gitignores that file, theirs will not.

The remaining points in #50 are left open on purpose. The reporter offered to implement them and they form one coherent piece of work around credential handling; splitting it would put two people in the same code at the same time.
aloth added a commit that referenced this pull request Sep 4, 2026
…nfig path

#47 landed with its own Unreleased section. It becomes the 0.11.0 entry, together with the create_project MCP tool added in the previous commit.

0.11.0 rather than 0.10.1: `olcli project create` and `createProject()` are new surface, and the package root exports three new types.

mohamedsobhi777 gets a Contributors line, following the convention already used in 0.4.0, 0.6.0 and 0.10.0. The merge commit records the code authorship; this records the credit where the release notes are read.

The README also stops naming a global config path that is only correct on Linux. `conf` resolves to ~/Library/Preferences/olcli-nodejs/config.json on macOS, verified here, and no config exists under ~/.config at all. The docs now point at `olcli check`, which prints the real path on any platform. While there, `olcli auth --save-local` is documented as writing .olauth into the current directory, which is usually the user's LaTeX project: this repository gitignores that file, theirs will not.

The release notes deliberately carry no reference to the open credential issue. The README correction stands on its own, and naming that issue here would send a reader of the release notes to open work about logout and plaintext passwords that 0.11.0 does not address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants