solid-auth-cli is a Node.js and command-line client library designed to facilitate persistent authentication with Solid Pods. It provides an API that mirrors solid-auth-client, enabling scripts to function in both browser (via solid-auth-client) and server-side/CLI environments (via solid-auth-cli) with minimal code changes. The current stable version is 1.0.15. While a specific release cadence isn't detailed, its versioning suggests a mature and stable 1.x branch. A key differentiator is its support for persistent logins using configuration files or environment variables, making it ideal for automated scripts or server-side applications that interact with Solid resources. It also offers a custom fetch implementation that can be integrated with rdflib.js (version 0.19.1 or newer) for graph data manipulation, or used directly for fetching resources via standard REST APIs, allowing programmatic interaction with the Solid ecosystem.
npm install solid-auth-cliVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to log in persistently, fetch an authenticated resource from a Solid Pod, and check its content.
Ensure rdflib.js is installed at version 0.19.1 or higher. Run `npm install rdflib@^0.19.1` or update your `package.json`.
Use `const solid = require('solid-auth-cli')` or ensure your Node.js environment is configured for CommonJS. If you must use ESM, consider dynamic `import()` or a wrapper.Upgrade `rdflib.js` to version 0.19.1 or newer: `npm install rdflib@^0.19.1`.
Ensure your project's `package.json` specifies `"type": "commonjs"`, or rename your file to `.cjs`. Alternatively, wrap `solid-auth-cli` in a CJS file or use dynamic `import()` if truly in an ESM context.
Provide credentials directly to `login({ idp: '...', username: '...', password: '...' })`, or create a `~/.solid-auth-cli-config.json` file, or set the necessary environment variables before running your script.