@frogbotai/plugin-dojo
v0.42.0
Published
File storage and AI for FrogBot apps running on Dojo.
Readme
@frogbotai/plugin-dojo
Adds the dojo target to frogbot deploy and the frogbot dojo commands, which manage Dojo from the terminal, and runs a FrogBot app on Dojo with no setup: uploads go to the app's R2 bucket, and AI goes through Dojo's gateway. Docs: https://docs.frogbot.ai/plugins/dojo
Dojo adds this plugin when it builds an app, after the app's own plugins, by setting FROGBOT_PLATFORM_PLUGIN=@frogbotai/plugin-dojo for next build and frogbot commands. An app that lists dojo() itself gets it once: core skips the platform plugin when a listed plugin has the same slug.
Commands
Every command runs as frogbot dojo <command> in an app that lists dojo(), and as npx @frogbotai/plugin-dojo <command> anywhere, with or without an app. Both run the same command list. Shipping an app is not one of them: dojo() adds dojo to cli.deployTargets, and frogbot deploy (or frogbot deploy dojo) is the one command that ships an app to Dojo. It takes the target's flags (--app, --data, --no-data, --replace-data, --workspace, --name, --no-keys, --skip-key, --yes, --update-keys, --wait) beside deploy's own --dry-run, --json, --no-interactive and --env-file.
| Command | Example | Does |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| login | frogbot dojo login | signs in with a code you confirm in the browser; the first one makes your account |
| logout | frogbot dojo logout | revokes the stored sign-in and removes it from auth.json |
| whoami | frogbot dojo whoami | shows the account, the Dojo URL and your workspaces |
| workspaces list \| create <name> \| rename <slug> <name> | frogbot dojo workspaces create "Acme" | lists, creates and renames workspaces |
| members list \| add <email> \| role <email> <role> \| remove <email> | frogbot dojo members add [email protected] --role owner | manages a workspace's members; --workspace <slug> picks one |
| apps pull <app> | npx @frogbotai/plugin-dojo apps pull deals | downloads an app you own or edit into a new folder |
| apps logs <app> | frogbot dojo apps logs deals --follow | prints an app's recent logs, or follows them |
| apps list \| get <app> \| create <name> \| rename <app> <name> \| delete <app> | frogbot dojo apps delete deals --yes | lists and manages apps |
| deployments list <app> \| logs <id> [--follow] | frogbot dojo deployments logs 42 | lists an app's deployments and prints a build log |
| env list <app> \| set <app> KEY=value… \| unset <app> KEY… | frogbot dojo env set deals STRIPE_KEY=sk_live_… | lists keys masked, sets and removes them; the app restarts once |
| domains get <app> \| set <app> <host> \| clear <app> | frogbot dojo domains set deals crm.acme.com | shows, sets and clears the custom domain and its CNAME record |
| sharing list <app> \| invite <app> <email>… \| leave <app> | frogbot dojo sharing invite deals [email protected] --level editor | shares an app at use, editor or owner, or leaves one |
| keys list \| create <name> \| revoke <id> | frogbot dojo keys create ci --json | manages your Dojo API keys; create prints the new key once; revoke reaches only the CLI's own key and the keys it made (revoke others from the admin) |
| billing status \| manage | frogbot dojo billing manage | shows the workspace's plan, or prints the link to manage billing |
frogbot dojo --help lists the commands, frogbot dojo apps --help a noun's verbs, and frogbot dojo apps delete --help a verb's flags. An unknown command or verb prints the list and exits 2.
--jsonon any command prints one JSON value on stdout and nothing else; sign-in links, progress and build lines go to stderr. A failed command prints{ ok: false, error }on stdout;frogbot deploy --jsonprints its own{ target, ok, dryRun, issues, result }object either way.apps logs --followcan't end in one value, so it refuses--json.FROGBOT_DOJO_TOKEN, when set, is the Dojo API key every command uses, ahead of the stored sign-in. If Dojo refuses it, the command exits 3 instead of starting a browser sign-in;whoamiexits 1, because it only reports who is signed in. In CI (CIset, no terminal) with no token and no stored sign-in, it exits 3 at once naming the variable.frogbot deploy --app <slug>ships to an existing app and links the folder, for a fresh clone or CI.FROGBOT_DOJO_URLpoints at another Dojo.- No terminal, no waiting. A command that needs a sign-in exits 3 with the sign-in link and code, and keeps the code: once the person confirms it, running the command again signs in. A command that needs a payment exits 4 with Dojo's upgrade link. Under
--jsonthe error object addsneeds(sign-inorpayment),linkand, for a sign-in,userCode.--waitwaits for the person instead, as a terminal does. - No terminal, no questions. Every question has a flag.
apps delete,members remove,keys revoke,sharing leaveandenv unsetask before acting, and need--yeswithout a terminal (exit 2 otherwise). - Refusals. A
402prints Dojo's upgrade link; with a terminal or--wait,frogbot deployandapps createthen wait up to 30 minutes for the payment, and open the link with a terminal. A403names the access the command needs, such as owner access to the app. - Keys.
keys createmints a key with the CLI's sign-in, never broader than it;--can-mintlets the new key create keys too. When Dojo doesn't let the sign-in create keys, it says which can (a browser sign-in, or a key made with--can-mint) and exits 1. - Signing up is
login: the browser sign-in makes the account the first time. Paying stays in the browser:billing manageprints the link.
What it changes
Apart from the dojo command and the import map entries for the badge and the sign-in buttons, the plugin does nothing unless DOJO=1. On Dojo it reads these variables, and boot fails naming any that is missing:
| Variable | Used for |
| --------------------------- | -------------------------------- |
| DOJO_R2_ENDPOINT | R2's S3 API endpoint |
| DOJO_R2_BUCKET | the app's bucket |
| DOJO_R2_ACCESS_KEY_ID | R2 credentials |
| DOJO_R2_SECRET_ACCESS_KEY | R2 credentials |
| DOJO_AI_BASE_URL | Dojo's gateway, ending /api/v1 |
| DOJO_AI_API_KEY | the app's gateway key |
| DOJO_JOBS_SECRET | Dojo waking the app to run jobs |
- Storage. When the app sets no
storage, every upload collection is stored in R2 under its slug (files/<id>/<filename>). Files stay private and are served through the app, so its access rules apply. - AI. When every provider in
ai.providersis a built-in one with no key, they are replaced by onedojoprovider that calls Dojo's gateway. Old model IDs such asopenai/gpt-5.4-minikeep working. Chat, embeddings and images work through the gateway; transcription, speech and video need your own key. An app with noaiblock, or with any provider key of its own, is left unchanged. - Jobs. Dojo can run due jobs with
Authorization: Bearer <DOJO_JOBS_SECRET>. Everyone else gets the app's ownjobs.access.run. - Sign-in. Adds "Continue with Dojo" (method
dojo) after the user collection's ownauth.signInmethods: OAuth with PKCE against Dojo, usingDOJO_OAUTH_CLIENT_ID,DOJO_OAUTH_CLIENT_SECRETandDOJO_URL. New accounts follow the collection'saccess.create. When the collection has no users at start, it creates one withDOJO_FIRST_USER_EMAIL, the email of the person who created the app on Dojo, so they can sign in first; a failure is a warning, not a failed start. When one of those variables is missing, or core would refuse the method, it adds nothing and logs[plugin-dojo] Sign in with Dojo is off for '<slug>': <reason>.at start.dojo({ signIn: false })turns it off. Even withoutDOJO=1, the plugin lists@frogbotai/ui/admin/rsc#SignInButtonsinadmin.dependencies, for the same reason as the badge. - Badge. Every FrogBot page, login included, gets a small "Made with FrogBot · Share your own" pill in the bottom-left corner, linking to frogbot.ai with the app's slug as
utm_content. It's added after the app's ownadmin.components.providers, renders only in the browser after the page has loaded, and makes no request. It stays hidden on collection lists, where it would cover the pagination, and beside the chat input when the window is too narrow. Visitors can close it for the rest of their browser session.dojo({ badge: false })turns it off. Even withoutDOJO=1, the plugin lists the badge inadmin.dependencies, because Dojo generates the import map at build time, whenDOJO=1isn't set.
