Small CLI tooling that lets Claude (the assistant) read and write a scoped slice of one or more NextCloud instances — shared Deck boards for planning and shared Files folders — using a dedicated, limited service account per instance rather than admin credentials.
Each instance gets a directory under instances/<name>/ holding its .env,
and a scratch area under scratch/<name>/. Every tool selects the instance via
the NC_INSTANCE env var (e.g. NC_INSTANCE=sproutz scripts/deck GET /boards)
and fails loudly when it's unset.
A NextCloud app password authenticates as the whole user; it can't be restricted per-app or per-board. Permission is scoped at the user level instead. So access is granted by:
- Creating a non-admin user (
claude). - Sharing only specific resources with it (one Deck board, one folder).
- Generating an app password for that user.
If the on-disk credential ever leaks, the blast radius is just what's been
shared with claude, and you revoke a single app password.
-
Create the user. As admin, create a non-admin NextCloud user, e.g.
claude. -
Generate an app password. App passwords are self-service — you must do this as the
claudeuser (admin can't mint one for another account from the admin UI). Log in asclaude→ Settings → Security → Create new app password. Copy it (shown once). -
Share resources with
claude:- Deck: open the planning board → board menu → Sharing → add
claude→ grant edit (and manage only if Claude should create or delete stacks/archive the board). - Files: open the folder → Share → add
claude→ read or read/write. - Forms: open the form → Share → add
claude(or a group it is in). Forms the account creates itself are owned by it.
- Deck: open the planning board → board menu → Sharing → add
-
Create the instance config from the sample (
instances/*/.envis gitignored):mkdir -p instances/<name> scratch/<name> cp instances/sample.env instances/<name>/.env chmod 600 instances/<name>/.env # it's a plaintext secretThen edit
instances/<name>/.envwith your instance URL, the service account username, and the app password from step 2:NEXTCLOUD_URL=https://nextcloud.example.com NEXTCLOUD_USER=claude NEXTCLOUD_APP_PASSWORD=<the app password from step 2>Record the instance-specific details (shared folder names, board ids) where your Claude sessions will see them — e.g.
~/.claude/tools.md. -
Install dependencies:
npm install(pullswebdavandnode-jq).
- Plan in Deck: list boards, read/create/move/edit/delete stacks and cards on the shared board.
- Work with Files: list directories, read files, upload/update files, create directories, and delete within the shared folder.
- Run surveys in Forms: create forms from a JSON spec, read forms shared with the account, and export their responses as JSON.
- "What's on the planning board?" / "Add a card to for ."
- "Move to Done." / "Summarize the cards in ."
- "Read
<shared-folder>/<file>." / "Save these notes to<shared-folder>/<path>."
Claude only ever sees what's shared with the service account — nothing else on the instance.
Copy CLAUDE.md.sample to CLAUDE.md (gitignored) and fill in your
instance-specific details. It documents the deck, forms, dav, and jq commands.