PnPjs Console Coming soon
Write and run your own PnPjs code against a site
A code editor for PnPjs, the community library for SharePoint and Microsoft Graph. Write TypeScript or JavaScript with full IntelliSense, run it against the site you chose, and see the output, any tables and every request it made. Scripts are ordinary .ts files: save them, open them again later, keep them in a folder or in source control. An AI assistant beside the editor can write, explain and fix scripts for you, using your own Anthropic, OpenAI or Azure OpenAI key.
What it does
- Anything PnPjs can read: lists, items, files, permissions, users, search, site settings.
- Microsoft Graph too, on App authentication or Cert authentication.
- Your own one-off reports: console.table() output appears in the Results tab, and Export results saves it to Excel or CSV.
- A script written from a plain-English request. The AI assistant reads the site's real list and field names first, so the code uses names that exist.
How it runs
- Sign in. One sign-in when you click the tile. Any of the three credentials works for SharePoint.
- Choose a site. The console's sp object is connected to it. Open another console for another site.
- Write or open a script. Start from a sample, open one of My scripts, or open any .ts or .js file.
- Run. Ctrl+Enter or F5. Output, tables and requests appear under the editor. Stop ends the script at once.
- Save. Ctrl+S. Scripts go to the PnPjs Scripts folder by default, or anywhere you choose.
- Ask the AI assistant (optional). Add your key once in Settings, AI assistant (or the gear on the assistant pane). Ask for a script, click Explain script or Fix last error, or click Analyze on an error in the console. Code comes back as a proposal with the changed lines marked: Apply puts it in the editor, Apply and run also runs it in Read mode.
How it works
The editor runs in an embedded browser that loads only the app's own files and cannot navigate anywhere else. Your script never sends a request itself: every request is handed to ShareMaster, which checks the address, decides whether it is a read or a change, and sends it signed with the credential you connected with. Only this tenant's SharePoint addresses (including its admin and OneDrive hosts) and Microsoft Graph are reachable; anything else is answered with a refusal and never leaves the computer.
Reads are requests that change nothing, plus the few posted requests that only query, such as search, and a batch counts as a read only when every part of it is a read. Anything else is a change. In Read mode the first change shows you the method and address and waits; Allow switches that console to Write mode until you switch it back or close the console, and a batch of changes fired together asks only once. Permanent deletes of items, files, folders, lists and sites are always refused, as are Graph permanent deletes and Graph list item deletes, which skip the recycle bin. Deleting something that has no recycle bin at all, such as a column, a view or a webhook subscription, is treated as an ordinary change: it asks in Read mode and is not backed up.
Every change that is sent is written to the app log with its method, address and credential type, and every refused request is logged with its reason. The console adds no permission of its own: each request succeeds or fails exactly as SharePoint or Graph answers it for your sign-in.
The AI assistant talks to your provider from the app, never from the editor page, using your key, which is stored protected for your Windows account and is never passed to the page. With each message it sends your text, the site's address and title, the credential type, the console mode, the script's name and the outcome of the last run, up to the last five error lines, and the script itself (a script over 40,000 characters is left for the assistant to ask for). It can also ask to read the console output, the site's details including the signed-in user, the visible lists, and a list's fields; those reads go through the same checks as your own script, and each result is cut at 30,000 characters. It has no way to write. Its code appears as a proposal; nothing runs until you click Apply and run, or Run on its request, and that run always starts in Read mode, switching the console back from Write mode if needed, so any change it attempts stops at the same question.
What you need
- Whatever permission your script's requests need on the site. The console adds none of its own.
- Microsoft Graph calls need App authentication or Cert authentication; Graph does not accept a browser session.
- For the AI assistant: your own API key from Anthropic, OpenAI or Azure OpenAI (with the resource's endpoint and a chat model deployment). Your provider bills you directly; each reply shows the tokens it used and an estimated cost, and the pane shows the total for the session.
What it will not do
- Requests can only reach this tenant's SharePoint and Microsoft Graph. Anything else is refused, so a script can never send tenant data elsewhere.
- Your code never sees a token or a cookie: ShareMaster signs each request for it.
- FormData bodies and XMLHttpRequest are not supported; PnPjs does not need them.
- The AI assistant cannot change SharePoint. Its code runs in Read mode only, so any change it tries asks you first, and permanent deletes are refused as always. It reads the site only through the same checks as your scripts.
- Your script, its output and anything the assistant reads from the site are sent to your AI provider under your own account. You are told this once per provider before anything is sent. Your key stays on this computer, protected for your Windows account, and never enters the editor page.
- The console keeps the first 100,000 rows of each table; Export results says when a table had more.