authai-cloud
v0.1.1
Published
AuthAI Cloud — one-command setup. `npx authai-cloud init` registers your app and writes AUTH_AI_SECRET to .env.
Downloads
55
Readme
authai-cloud
One-command setup for AuthAI Cloud. Opens your browser, signs you in with GitHub, registers an app, and writes AUTH_AI_SECRET=… to your .env — all without leaving the terminal.
Use
npx authai-cloud initThe flow:
- The CLI binds
127.0.0.1on a random port and openshttps://authai.io/cli-init?port=…&state=…. - The webapp handles GitHub OAuth + app creation in the browser. No GitHub OAuth code in the CLI.
- The result page POSTs the new API key back to the local listener (POST body, never URL — so the secret never appears in browser history, server logs, or shareable URLs).
- The CLI writes
AUTH_AI_SECRET=…to.envand prints the next steps.
If .env already has AUTH_AI_SECRET=, the CLI refuses to overwrite unless you pass --force.
Next steps
Once your .env has AUTH_AI_SECRET, point a backend OpenAI client at the cloud relay:
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: jwt, // from your @authai-io/react frontend
baseURL: "https://relay.authai.io/v1",
defaultHeaders: { "x-authai-secret": process.env.AUTH_AI_SECRET! },
});For the frontend wiring, see @authai-io/react.
For self-hosting (no npx authai-cloud init needed), see docs/installation.md.
