void 0.1.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_PROMPT.md +15 -0
- package/README.md +62 -123
- package/dist/auth-BdsJ0Aff.d.mts +43 -0
- package/dist/auth-cmd-Dx8oPKZC.mjs +43 -0
- package/dist/auth-migrations-BAtAck2g.mjs +117 -0
- package/dist/better-auth-shared-C9_GHSkR.d.mts +71 -0
- package/dist/better-auth-shared-CdYmQGry.mjs +163 -0
- package/dist/cache-W82I8ihI.mjs +47 -0
- package/dist/cancel-deploy-BOBTqqh0.mjs +59 -0
- package/dist/cf-access-Dee5cXxL.mjs +22 -0
- package/dist/chunk-DJd-R1mw.mjs +34 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.mjs +1807 -0
- package/dist/client-snXOjrp1.mjs +565 -0
- package/dist/collect-CjeZgz5D.mjs +55 -0
- package/dist/config-BIa9HwVX.mjs +573 -0
- package/dist/config-BzM9Dy7T.mjs +37 -0
- package/dist/config-CvHtTM0q.mjs +30 -0
- package/dist/create-project-BIA15W7z.mjs +90 -0
- package/dist/db-DsRoMcfN.mjs +895 -0
- package/dist/defer-DcxEsVH1.mjs +49 -0
- package/dist/delete-DAP6yDc7.mjs +64 -0
- package/dist/deploy-BPKblFx6.mjs +2424 -0
- package/dist/discover-B7FkXBLB.mjs +40 -0
- package/dist/dist-DUyXJLkq.mjs +2667 -0
- package/dist/dist-Dayj3gCK.mjs +1287 -0
- package/dist/domain-BGofcQ6I.mjs +79 -0
- package/dist/dotenv-DwO4ti0Z.mjs +173 -0
- package/dist/drizzle-NnudE_UN.mjs +232 -0
- package/dist/env-CyG3tvU0.mjs +301 -0
- package/dist/env-helpers-Dr9Y7RnE.d.mts +52 -0
- package/dist/env-raw-BDL4TvdN.mjs +32 -0
- package/dist/env-types-DknSA4SO.mjs +64 -0
- package/dist/env-validation-DJKjR_8q.mjs +163 -0
- package/dist/fetch-error-BQ8sZ5Nd.mjs +266 -0
- package/dist/fetch-error-CVZ5CGA-.d.mts +20 -0
- package/dist/gen-U0Ktr4Zd.mjs +761 -0
- package/dist/handler-B0ds0OHJ.d.mts +269 -0
- package/dist/head-P-egrtFE.d.mts +45 -0
- package/dist/headers-DCXc7mDs.mjs +279 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.mjs +4695 -0
- package/dist/init-C7wS5iGP.mjs +2625 -0
- package/dist/link-p2R6NbgN.mjs +49 -0
- package/dist/list-Bfel-QLc.mjs +113 -0
- package/dist/log-DXdqnmhF.mjs +26 -0
- package/dist/login-CkcXUiIu.mjs +72 -0
- package/dist/logs-DmkrRvx6.mjs +98 -0
- package/dist/magic-string.es-D6g9UnIy.mjs +1011 -0
- package/dist/mcp-CaQzfeUi.mjs +373 -0
- package/dist/node-DDfXj10V.mjs +54 -0
- package/dist/output-BwlcIYSR.mjs +139 -0
- package/dist/pages/client.d.mts +198 -0
- package/dist/pages/client.mjs +980 -0
- package/dist/pages/head-client.d.mts +15 -0
- package/dist/pages/head-client.mjs +90 -0
- package/dist/pages/head.d.mts +2 -0
- package/dist/pages/head.mjs +112 -0
- package/dist/pages/index.d.mts +38 -0
- package/dist/pages/index.mjs +76 -0
- package/dist/pages/islands-plugin.d.mts +50 -0
- package/dist/pages/islands-plugin.mjs +195 -0
- package/dist/pages/prefetch.d.mts +31 -0
- package/dist/pages/prefetch.mjs +90 -0
- package/dist/pages/protocol.d.mts +3 -0
- package/dist/pages/protocol.mjs +193 -0
- package/dist/pages/serialize.d.mts +10 -0
- package/dist/pages/serialize.mjs +14 -0
- package/dist/pathe.M-eThtNZ-D-kmWkCS.mjs +150 -0
- package/dist/plugin-inference-oZ6Ybu2_.mjs +2447 -0
- package/dist/prepare-BAtWufvm.mjs +99 -0
- package/dist/preset-D4I73kT4.mjs +221 -0
- package/dist/project-TqORyHn8.mjs +72 -0
- package/dist/project-cmd-B7lQp3F3.mjs +67 -0
- package/dist/project-slug-CKam8lF9.mjs +11 -0
- package/dist/project-tsconfig-DfkESbDL.mjs +63 -0
- package/dist/protocol-BWzXs2A2.d.mts +34 -0
- package/dist/providers-B3aMxWzP.mjs +67 -0
- package/dist/resolve-project-Br5BR03U.mjs +29 -0
- package/dist/rollback-gyC59l7U.mjs +92 -0
- package/dist/route-types-DReF1gUY.mjs +255 -0
- package/dist/routes-stub.d.mts +55 -0
- package/dist/routes-stub.mjs +1 -0
- package/dist/runner-6Ep3fNQu.mjs +123 -0
- package/dist/runner-pg-D0wWHYnr.mjs +57 -0
- package/dist/runtime/ai.d.mts +127 -0
- package/dist/runtime/ai.mjs +348 -0
- package/dist/runtime/auth-client-react.d.mts +8 -0
- package/dist/runtime/auth-client-react.mjs +6 -0
- package/dist/runtime/auth-client-solid.d.mts +8 -0
- package/dist/runtime/auth-client-solid.mjs +6 -0
- package/dist/runtime/auth-client-svelte.d.mts +8 -0
- package/dist/runtime/auth-client-svelte.mjs +6 -0
- package/dist/runtime/auth-client-vue.d.mts +8 -0
- package/dist/runtime/auth-client-vue.mjs +6 -0
- package/dist/runtime/auth-client.d.mts +8 -0
- package/dist/runtime/auth-client.mjs +6 -0
- package/dist/runtime/auth.d.mts +2 -0
- package/dist/runtime/auth.mjs +22 -0
- package/dist/runtime/better-auth-pg.d.mts +11 -0
- package/dist/runtime/better-auth-pg.mjs +51 -0
- package/dist/runtime/better-auth.d.mts +11 -0
- package/dist/runtime/better-auth.mjs +33 -0
- package/dist/runtime/client.d.mts +6 -0
- package/dist/runtime/client.mjs +5 -0
- package/dist/runtime/db-pg.d.mts +2 -0
- package/dist/runtime/db-pg.mjs +1 -0
- package/dist/runtime/db.d.mts +17 -0
- package/dist/runtime/db.mjs +30 -0
- package/dist/runtime/drizzle-arktype.d.mts +1 -0
- package/dist/runtime/drizzle-arktype.mjs +2 -0
- package/dist/runtime/drizzle-valibot.d.mts +1 -0
- package/dist/runtime/drizzle-valibot.mjs +2 -0
- package/dist/runtime/drizzle-zod.d.mts +1 -0
- package/dist/runtime/drizzle-zod.mjs +2 -0
- package/dist/runtime/env-helpers.d.mts +2 -0
- package/dist/runtime/env-helpers.mjs +173 -0
- package/dist/runtime/env-public-client.d.mts +22 -0
- package/dist/runtime/env-public-client.mjs +54 -0
- package/dist/runtime/env-public.d.mts +143 -0
- package/dist/runtime/env-public.mjs +366 -0
- package/dist/runtime/env.d.mts +13 -0
- package/dist/runtime/env.mjs +51 -0
- package/dist/runtime/fetch-stream.d.mts +51 -0
- package/dist/runtime/fetch-stream.mjs +81 -0
- package/dist/runtime/fetch.d.mts +59 -0
- package/dist/runtime/fetch.mjs +18 -0
- package/dist/runtime/handler.d.mts +3 -0
- package/dist/runtime/handler.mjs +85 -0
- package/dist/runtime/isr.d.mts +26 -0
- package/dist/runtime/isr.mjs +43 -0
- package/dist/runtime/kv.d.mts +48 -0
- package/dist/runtime/kv.mjs +106 -0
- package/dist/runtime/log.d.mts +24 -0
- package/dist/runtime/log.mjs +31 -0
- package/dist/runtime/migration-handler-pg.d.mts +6 -0
- package/dist/runtime/migration-handler-pg.mjs +85 -0
- package/dist/runtime/migration-handler.d.mts +19 -0
- package/dist/runtime/migration-handler.mjs +92 -0
- package/dist/runtime/queues.d.mts +7 -0
- package/dist/runtime/queues.mjs +8 -0
- package/dist/runtime/remote/binding-handler.d.mts +15 -0
- package/dist/runtime/remote/binding-handler.mjs +208 -0
- package/dist/runtime/remote/index.d.mts +8 -0
- package/dist/runtime/remote/index.mjs +461 -0
- package/dist/runtime/response.d.mts +14 -0
- package/dist/runtime/response.mjs +30 -0
- package/dist/runtime/sandbox.d.mts +17 -0
- package/dist/runtime/sandbox.mjs +19 -0
- package/dist/runtime/schema-d1.d.mts +1 -0
- package/dist/runtime/schema-d1.mjs +2 -0
- package/dist/runtime/schema-pg.d.mts +1 -0
- package/dist/runtime/schema-pg.mjs +2 -0
- package/dist/runtime/seed.d.mts +30 -0
- package/dist/runtime/seed.mjs +6 -0
- package/dist/runtime/storage.d.mts +7 -0
- package/dist/runtime/storage.mjs +14 -0
- package/dist/runtime/validator.d.mts +2 -0
- package/dist/runtime/validator.mjs +72 -0
- package/dist/runtime/ws-server.d.mts +26 -0
- package/dist/runtime/ws-server.mjs +296 -0
- package/dist/runtime/ws.d.mts +123 -0
- package/dist/runtime/ws.mjs +103 -0
- package/dist/scan-Ba4hFwlH.mjs +324 -0
- package/dist/scan-C6HMEIdW.mjs +318 -0
- package/dist/secret-CeRSukgM.mjs +109 -0
- package/dist/skills-ipldjlKE.mjs +62 -0
- package/dist/standard-schema-9CRjx-uR.d.mts +42 -0
- package/dist/subcommand-prompt-BKjuNAPb.mjs +349 -0
- package/dist/sveltekit.d.mts +20 -0
- package/dist/sveltekit.mjs +61 -0
- package/dist/types-mHOEwpW4.d.mts +57 -0
- package/dist/validate-CaMavMxu.mjs +146 -0
- package/dist/yarn-pnp-BFqMV_bl.mjs +196 -0
- package/getting-started-prompt.txt +26 -0
- package/package.json +322 -30
- package/schema.json +364 -0
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/SKILL.md +75 -0
- package/skills/void/command/void.md +7 -0
- package/skills/void/docs/guide/ai.md +235 -0
- package/skills/void/docs/guide/app-types.md +103 -0
- package/skills/void/docs/guide/auth.md +257 -0
- package/skills/void/docs/guide/database/d1.md +106 -0
- package/skills/void/docs/guide/database/postgresql.md +106 -0
- package/skills/void/docs/guide/database.md +418 -0
- package/skills/void/docs/guide/deployment.md +98 -0
- package/skills/void/docs/guide/edge/headers.md +79 -0
- package/skills/void/docs/guide/edge/prerendering.md +83 -0
- package/skills/void/docs/guide/edge/redirects.md +116 -0
- package/skills/void/docs/guide/edge/revalidation.md +131 -0
- package/skills/void/docs/guide/edge/rewrites.md +354 -0
- package/skills/void/docs/guide/edge/static-assets.md +72 -0
- package/skills/void/docs/guide/env-vars.md +298 -0
- package/skills/void/docs/guide/index.md +80 -0
- package/skills/void/docs/guide/jobs.md +91 -0
- package/skills/void/docs/guide/kv.md +107 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +419 -0
- package/skills/void/docs/guide/pages-routing/head.md +130 -0
- package/skills/void/docs/guide/pages-routing/islands.md +405 -0
- package/skills/void/docs/guide/pages-routing/layouts.md +362 -0
- package/skills/void/docs/guide/pages-routing/loaders.md +267 -0
- package/skills/void/docs/guide/pages-routing/markdown.md +625 -0
- package/skills/void/docs/guide/pages-routing/overview.md +236 -0
- package/skills/void/docs/guide/pages-routing/view-transitions.md +140 -0
- package/skills/void/docs/guide/queues.md +140 -0
- package/skills/void/docs/guide/quickstart.md +233 -0
- package/skills/void/docs/guide/remote-dev.md +67 -0
- package/skills/void/docs/guide/sandboxes.md +82 -0
- package/skills/void/docs/guide/server-routing.md +246 -0
- package/skills/void/docs/guide/ssg.md +74 -0
- package/skills/void/docs/guide/ssr.md +105 -0
- package/skills/void/docs/guide/storage.md +67 -0
- package/skills/void/docs/guide/type-safety.md +179 -0
- package/skills/void/docs/guide/typed-fetch.md +113 -0
- package/skills/void/docs/guide/websockets.md +190 -0
- package/skills/void/docs/index.md +48 -0
- package/skills/void/docs/integrations/agents.md +84 -0
- package/skills/void/docs/integrations/cloudflare.md +284 -0
- package/skills/void/docs/integrations/frameworks/analog.md +182 -0
- package/skills/void/docs/integrations/frameworks/astro.md +197 -0
- package/skills/void/docs/integrations/frameworks/nuxt.md +164 -0
- package/skills/void/docs/integrations/frameworks/overview.md +136 -0
- package/skills/void/docs/integrations/frameworks/react-router.md +137 -0
- package/skills/void/docs/integrations/frameworks/sveltekit.md +191 -0
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +140 -0
- package/skills/void/docs/integrations/hono.md +97 -0
- package/skills/void/docs/integrations/nodejs-bun-deno.md +210 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +408 -0
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +5 -0
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +103 -0
- package/skills/void/docs/node_modules/oxc-minify/README.md +78 -0
- package/skills/void/docs/node_modules/reka-ui/README.md +80 -0
- package/skills/void/docs/node_modules/vitepress/README.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +49 -0
- package/skills/void/docs/node_modules/vitepress/template/index.md +28 -0
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +85 -0
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +101 -0
- package/skills/void/docs/node_modules/void/AGENTS.md +204 -0
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +15 -0
- package/skills/void/docs/node_modules/void/README.md +89 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +375 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +174 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +37 -0
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +189 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +143 -0
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +1272 -0
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +19 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +22 -0
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +69 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +152 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +24 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +565 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +124 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +600 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +386 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +101 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +15 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +58 -0
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +32 -0
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +99 -0
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +79 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +44 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +65 -0
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +390 -0
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +48 -0
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +85 -0
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +452 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/{LICENSE → skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md} +21 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +364 -0
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +325 -0
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +398 -0
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +73 -0
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +95 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +135 -0
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +21 -0
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +25 -0
- package/skills/void/docs/node_modules/void/node_modules/tsdown/README.md +55 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/LICENSE.md +2230 -0
- package/skills/void/docs/node_modules/void/node_modules/vite/README.md +20 -0
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +63 -0
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +191 -0
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +175 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +75 -0
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +7 -0
- package/skills/void/docs/reference/api.md +917 -0
- package/skills/void/docs/reference/cli.md +561 -0
- package/skills/void/docs/reference/config.md +408 -0
- package/skills/void/docs/reference/resource-inference.md +149 -0
- package/skills/void/docs/reference/structure.md +176 -0
- package/.npmignore +0 -29
- package/.travis.yml +0 -9
- package/favicon.ico +0 -0
- package/index.js +0 -14
- package/lib/Job.js +0 -150
- package/lib/Void.js +0 -99
- package/lib/scan.js +0 -19
- package/test/credentials.js +0 -20
- package/test/job.js +0 -64
- package/test/static/dir1/test6.html +0 -0
- package/test/static/dir2/test7.html +0 -0
- package/test/static/dir2/test8.html +0 -0
- package/test/static/dir2/test9.html +0 -0
- package/test/static/test1.html +0 -0
- package/test/static/test2.html +0 -0
- package/test/static/test3.html +0 -0
- package/test/void.js +0 -31
- /package/{test/static/dir1/test4.html → skills/void/docs/integrations/auth-providers.md} +0 -0
- /package/{test/static/dir1/test5.html → skills/void/docs/integrations/payment-processors.md} +0 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# `@clack/prompts`
|
|
2
|
+
|
|
3
|
+
Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
`@clack/prompts` is an opinionated, pre-styled wrapper around [`@clack/core`](https://www.npmjs.com/package/@clack/core).
|
|
10
|
+
|
|
11
|
+
- 🤏 80% smaller than other options
|
|
12
|
+
- 💎 Beautiful, minimal UI
|
|
13
|
+
- ✅ Simple API
|
|
14
|
+
- 🧱 Comes with `text`, `password`, `confirm`, `date`, `select`, `autocomplete`, `selectKey`, `multiselect`, `path`, and `spinner` components
|
|
15
|
+
|
|
16
|
+
## Basics
|
|
17
|
+
|
|
18
|
+
### Setup
|
|
19
|
+
|
|
20
|
+
The `intro` and `outro` functions will print a message to begin or end a prompt session, respectively.
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { intro, outro } from '@clack/prompts';
|
|
24
|
+
|
|
25
|
+
intro(`create-my-app`);
|
|
26
|
+
// Do stuff
|
|
27
|
+
outro(`You're all set!`);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Cancellation
|
|
31
|
+
|
|
32
|
+
The `isCancel` function is a guard that detects when a user cancels a question with `CTRL + C`. You should handle this situation for each prompt, optionally providing a nice cancellation message with the `cancel` utility.
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { isCancel, cancel, text } from '@clack/prompts';
|
|
36
|
+
|
|
37
|
+
const value = await text({
|
|
38
|
+
message: 'What is the meaning of life?',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (isCancel(value)) {
|
|
42
|
+
cancel('Operation cancelled.');
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Components
|
|
48
|
+
|
|
49
|
+
### Text
|
|
50
|
+
|
|
51
|
+
The text component accepts a single line of text.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { text } from '@clack/prompts';
|
|
55
|
+
|
|
56
|
+
const meaning = await text({
|
|
57
|
+
message: 'What is the meaning of life?',
|
|
58
|
+
placeholder: 'Not sure',
|
|
59
|
+
initialValue: '42',
|
|
60
|
+
validate(value) {
|
|
61
|
+
if (value.length === 0) return `Value is required!`;
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Password
|
|
67
|
+
|
|
68
|
+
The password component behaves like `text`, but masks the input as the user types.
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
import { password } from '@clack/prompts';
|
|
72
|
+
|
|
73
|
+
const secret = await password({
|
|
74
|
+
message: 'Set a password.',
|
|
75
|
+
mask: '*',
|
|
76
|
+
validate(value) {
|
|
77
|
+
if (!value || value.length < 8) return 'Password must be at least 8 characters.';
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Confirm
|
|
83
|
+
|
|
84
|
+
The confirm component accepts a yes or no answer. The result is a boolean value of `true` or `false`.
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
import { confirm } from '@clack/prompts';
|
|
88
|
+
|
|
89
|
+
const shouldContinue = await confirm({
|
|
90
|
+
message: 'Do you want to continue?',
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Date
|
|
95
|
+
|
|
96
|
+
The date component accepts a calendar date and returns a `Date` value.
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
import { date } from '@clack/prompts';
|
|
100
|
+
|
|
101
|
+
const dueDate = await date({
|
|
102
|
+
message: 'Pick a due date.',
|
|
103
|
+
format: 'YMD',
|
|
104
|
+
minDate: new Date(Date.UTC(2026, 0, 1)),
|
|
105
|
+
maxDate: new Date(Date.UTC(2026, 11, 31)),
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Select
|
|
110
|
+
|
|
111
|
+
The select component allows a user to choose one value from a list of options. The result is the `value` prop of a given option.
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
import { select } from '@clack/prompts';
|
|
115
|
+
|
|
116
|
+
const projectType = await select({
|
|
117
|
+
message: 'Pick a project type.',
|
|
118
|
+
options: [
|
|
119
|
+
{ value: 'ts', label: 'TypeScript' },
|
|
120
|
+
{ value: 'js', label: 'JavaScript', disabled: true },
|
|
121
|
+
{ value: 'coffee', label: 'CoffeeScript', hint: 'oh no' },
|
|
122
|
+
],
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Autocomplete
|
|
127
|
+
|
|
128
|
+
The autocomplete component lets a user filter a list by typing, then choose one option from the matching results. By default, matching uses each option's `label`, `hint`, and `value`. The result is the selected option's `value`.
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
import { autocomplete } from '@clack/prompts';
|
|
132
|
+
|
|
133
|
+
const framework = await autocomplete({
|
|
134
|
+
message: 'Pick a framework.',
|
|
135
|
+
placeholder: 'Type to search...',
|
|
136
|
+
options: [
|
|
137
|
+
{ value: 'next', label: 'Next.js' },
|
|
138
|
+
{ value: 'nuxt', label: 'Nuxt' },
|
|
139
|
+
{ value: 'sveltekit', label: 'SvelteKit' },
|
|
140
|
+
{ value: 'remix', label: 'Remix' },
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Select Key
|
|
146
|
+
|
|
147
|
+
The `selectKey` component lets a user choose an option by pressing its single-character string `value` key directly.
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
import { selectKey } from '@clack/prompts';
|
|
151
|
+
|
|
152
|
+
const action = await selectKey({
|
|
153
|
+
message: 'Pick an action.',
|
|
154
|
+
options: [
|
|
155
|
+
{ value: 'd', label: 'Deploy' },
|
|
156
|
+
{ value: 't', label: 'Run tests' },
|
|
157
|
+
{ value: 'q', label: 'Quit' },
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Multi-Select
|
|
163
|
+
|
|
164
|
+
The `multiselect` component allows a user to choose many values from a list of options. The result is an array with all selected `value` props.
|
|
165
|
+
|
|
166
|
+
```js
|
|
167
|
+
import { multiselect } from '@clack/prompts';
|
|
168
|
+
|
|
169
|
+
const additionalTools = await multiselect({
|
|
170
|
+
message: 'Select additional tools.',
|
|
171
|
+
options: [
|
|
172
|
+
{ value: 'eslint', label: 'ESLint', hint: 'recommended' },
|
|
173
|
+
{ value: 'prettier', label: 'Prettier', disabled: true },
|
|
174
|
+
{ value: 'gh-action', label: 'GitHub Action' },
|
|
175
|
+
],
|
|
176
|
+
required: false,
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
It is also possible to select multiple items arranged into hierarchy by using `groupMultiselect`:
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
import { groupMultiselect } from '@clack/prompts';
|
|
184
|
+
|
|
185
|
+
const basket = await groupMultiselect({
|
|
186
|
+
message: 'Select your favorite fruits and vegetables:',
|
|
187
|
+
options: {
|
|
188
|
+
fruits: [
|
|
189
|
+
{ value: 'apple', label: 'apple' },
|
|
190
|
+
{ value: 'banana', label: 'banana' },
|
|
191
|
+
{ value: 'cherry', label: 'cherry' },
|
|
192
|
+
],
|
|
193
|
+
vegetables: [
|
|
194
|
+
{ value: 'carrot', label: 'carrot' },
|
|
195
|
+
{ value: 'spinach', label: 'spinach' },
|
|
196
|
+
{ value: 'potato', label: 'potato' },
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Multi-Line Text
|
|
203
|
+
|
|
204
|
+
The multi-line text component accepts multiple lines of text input. By default, pressing `Enter` twice submits the input.
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
import { multiline } from '@clack/prompts';
|
|
208
|
+
|
|
209
|
+
const bio = await multiline({
|
|
210
|
+
message: 'Tell us about yourself.',
|
|
211
|
+
placeholder: 'Start typing...',
|
|
212
|
+
validate(value) {
|
|
213
|
+
if (value.length === 0) return `value is required`;
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Set `showSubmit` to display an explicit submit button instead of double `Enter` submission:
|
|
219
|
+
|
|
220
|
+
```js
|
|
221
|
+
const bio = await multiline({
|
|
222
|
+
message: 'Tell us about yourself.',
|
|
223
|
+
showSubmit: true,
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Path
|
|
228
|
+
|
|
229
|
+
The path component offers filesystem path suggestions and returns the selected path as a string. When `directory: true` is set, only directories can be selected.
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
import { path } from '@clack/prompts';
|
|
233
|
+
|
|
234
|
+
const targetDir = await path({
|
|
235
|
+
message: 'Select an existing directory.',
|
|
236
|
+
directory: true,
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Spinner
|
|
241
|
+
|
|
242
|
+
The spinner component surfaces a pending action, such as a long-running download or dependency installation.
|
|
243
|
+
|
|
244
|
+
```js
|
|
245
|
+
import { spinner } from '@clack/prompts';
|
|
246
|
+
|
|
247
|
+
const s = spinner();
|
|
248
|
+
s.start('Installing via npm');
|
|
249
|
+
// Do installation here
|
|
250
|
+
s.stop('Installed via npm');
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Progress
|
|
254
|
+
|
|
255
|
+
The progress component extends the spinner component to add a progress bar to visualize the progression of an action.
|
|
256
|
+
|
|
257
|
+
```js
|
|
258
|
+
import { progress } from '@clack/prompts';
|
|
259
|
+
|
|
260
|
+
const p = progress({ max: 10 });
|
|
261
|
+
p.start('Downloading archive');
|
|
262
|
+
// Do download here
|
|
263
|
+
p.advance(3, 'Downloading (30%)');
|
|
264
|
+
// ...
|
|
265
|
+
p.advance(5, 'Downloading (80%)');
|
|
266
|
+
// ...
|
|
267
|
+
p.stop('Archive downloaded');
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Utilities
|
|
271
|
+
|
|
272
|
+
### Grouping
|
|
273
|
+
|
|
274
|
+
Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
|
|
275
|
+
|
|
276
|
+
```js
|
|
277
|
+
import * as p from '@clack/prompts';
|
|
278
|
+
|
|
279
|
+
const group = await p.group(
|
|
280
|
+
{
|
|
281
|
+
name: () => p.text({ message: 'What is your name?' }),
|
|
282
|
+
age: () => p.text({ message: 'What is your age?' }),
|
|
283
|
+
color: ({ results }) =>
|
|
284
|
+
p.multiselect({
|
|
285
|
+
message: `What is your favorite color ${results.name}?`,
|
|
286
|
+
options: [
|
|
287
|
+
{ value: 'red', label: 'Red' },
|
|
288
|
+
{ value: 'green', label: 'Green' },
|
|
289
|
+
{ value: 'blue', label: 'Blue' },
|
|
290
|
+
],
|
|
291
|
+
}),
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
// On Cancel callback that wraps the group
|
|
295
|
+
// So if the user cancels one of the prompts in the group this function will be called
|
|
296
|
+
onCancel: ({ results }) => {
|
|
297
|
+
p.cancel('Operation cancelled.');
|
|
298
|
+
process.exit(0);
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
console.log(group.name, group.age, group.color);
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Tasks
|
|
307
|
+
|
|
308
|
+
Execute multiple tasks in spinners.
|
|
309
|
+
|
|
310
|
+
```js
|
|
311
|
+
import { tasks } from '@clack/prompts';
|
|
312
|
+
|
|
313
|
+
await tasks([
|
|
314
|
+
{
|
|
315
|
+
title: 'Installing via npm',
|
|
316
|
+
task: async (message) => {
|
|
317
|
+
// Do installation here
|
|
318
|
+
return 'Installed via npm';
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
]);
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Logs
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
import { log } from '@clack/prompts';
|
|
328
|
+
|
|
329
|
+
log.info('Info!');
|
|
330
|
+
log.success('Success!');
|
|
331
|
+
log.step('Step!');
|
|
332
|
+
log.warn('Warn!');
|
|
333
|
+
log.error('Error!');
|
|
334
|
+
log.message('Hello, World', { symbol: color.cyan('~') });
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
### Stream
|
|
339
|
+
|
|
340
|
+
When interacting with dynamic LLMs or other streaming message providers, use the `stream` APIs to log messages from an iterable, even an async one.
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
import { stream } from '@clack/prompts';
|
|
344
|
+
|
|
345
|
+
stream.info((function *() { yield 'Info!'; })());
|
|
346
|
+
stream.success((function *() { yield 'Success!'; })());
|
|
347
|
+
stream.step((function *() { yield 'Step!'; })());
|
|
348
|
+
stream.warn((function *() { yield 'Warn!'; })());
|
|
349
|
+
stream.error((function *() { yield 'Error!'; })());
|
|
350
|
+
stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') });
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+

|
|
354
|
+
|
|
355
|
+
### Task Log
|
|
356
|
+
|
|
357
|
+
When executing a sub-process or a similar sub-task, `taskLog` can be used to render the output continuously and clear it at the end if it was successful.
|
|
358
|
+
|
|
359
|
+
```js
|
|
360
|
+
import { taskLog } from '@clack/prompts';
|
|
361
|
+
|
|
362
|
+
const log = taskLog({
|
|
363
|
+
title: 'Running npm install'
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
for await (const line of npmInstall()) {
|
|
367
|
+
log.message(line);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (success) {
|
|
371
|
+
log.success('Done!');
|
|
372
|
+
} else {
|
|
373
|
+
log.error('Failed!');
|
|
374
|
+
}
|
|
375
|
+
```
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<img width="1362" height="450" alt="Image" src="https://github.com/user-attachments/assets/6f770ae3-0a14-4d2b-9aed-a304ee5446c5" />
|
|
2
|
+
|
|
3
|
+
# Cloudflare Sandbox SDK
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@cloudflare/sandbox)
|
|
6
|
+
[](https://www.npmjs.com/package/@cloudflare/sandbox)
|
|
7
|
+
|
|
8
|
+
**Build secure, isolated code execution environments on Cloudflare.**
|
|
9
|
+
|
|
10
|
+
The Sandbox SDK lets you run untrusted code safely in isolated containers. Execute commands, manage files, run background processes, and expose services — all from your Workers applications.
|
|
11
|
+
|
|
12
|
+
Perfect for AI code execution, interactive development environments, data analysis platforms, CI/CD systems, and any application that needs secure code execution at the edge.
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
1. Install [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (version 16.17.0 or later)
|
|
19
|
+
2. Ensure Docker is running locally ([see setup guide](https://developers.cloudflare.com/sandbox/get-started/#ensure-docker-is-running-locally))
|
|
20
|
+
3. For deploying to production, sign up for a [Cloudflare account](https://dash.cloudflare.com/sign-up/workers-and-pages)
|
|
21
|
+
|
|
22
|
+
### 1. Create a new project
|
|
23
|
+
|
|
24
|
+
Create a new Sandbox SDK project using the minimal template:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm create cloudflare@latest -- my-sandbox --template=cloudflare/sandbox-sdk/examples/minimal
|
|
28
|
+
cd my-sandbox
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Test locally
|
|
32
|
+
|
|
33
|
+
Start the development server:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> **Note:** First run builds the Docker container (2-3 minutes). Subsequent runs are much faster.
|
|
40
|
+
|
|
41
|
+
Test the endpoints:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Execute Python code
|
|
45
|
+
curl http://localhost:8787/run
|
|
46
|
+
|
|
47
|
+
# File operations
|
|
48
|
+
curl http://localhost:8787/file
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 3. Deploy to production
|
|
52
|
+
|
|
53
|
+
Deploy your Worker and container:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx wrangler deploy
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> **Wait for provisioning:** After first deployment, wait 2-3 minutes before making requests.
|
|
60
|
+
|
|
61
|
+
**📖 [View the complete getting started guide](https://developers.cloudflare.com/sandbox/get-started/)** for detailed instructions and explanations.
|
|
62
|
+
|
|
63
|
+
## Quick API Example
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { getSandbox, proxyToSandbox, type Sandbox } from '@cloudflare/sandbox';
|
|
67
|
+
|
|
68
|
+
export { Sandbox } from '@cloudflare/sandbox';
|
|
69
|
+
|
|
70
|
+
type Env = {
|
|
71
|
+
Sandbox: DurableObjectNamespace<Sandbox>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
async fetch(request: Request, env: Env): Promise<Response> {
|
|
76
|
+
// Required for preview URLs
|
|
77
|
+
const proxyResponse = await proxyToSandbox(request, env);
|
|
78
|
+
if (proxyResponse) return proxyResponse;
|
|
79
|
+
|
|
80
|
+
const url = new URL(request.url);
|
|
81
|
+
const sandbox = getSandbox(env.Sandbox, 'my-sandbox');
|
|
82
|
+
|
|
83
|
+
// Execute Python code
|
|
84
|
+
if (url.pathname === '/run') {
|
|
85
|
+
const result = await sandbox.exec('python3 -c "print(2 + 2)"');
|
|
86
|
+
return Response.json({ output: result.stdout, success: result.success });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Work with files
|
|
90
|
+
if (url.pathname === '/file') {
|
|
91
|
+
await sandbox.writeFile('/workspace/hello.txt', 'Hello, Sandbox!');
|
|
92
|
+
const file = await sandbox.readFile('/workspace/hello.txt');
|
|
93
|
+
return Response.json({ content: file.content });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return new Response('Try /run or /file');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
**📖 [Full Documentation](https://developers.cloudflare.com/sandbox/)**
|
|
104
|
+
|
|
105
|
+
- [Get Started Guide](https://developers.cloudflare.com/sandbox/get-started/) - Step-by-step tutorial
|
|
106
|
+
- [API Reference](https://developers.cloudflare.com/sandbox/api/) - Complete API docs
|
|
107
|
+
- [Guides](https://developers.cloudflare.com/sandbox/guides/) - Execute commands, manage files, expose services
|
|
108
|
+
- [Examples](https://developers.cloudflare.com/sandbox/tutorials/) - AI agents, data analysis, CI/CD pipelines
|
|
109
|
+
|
|
110
|
+
## Key Features
|
|
111
|
+
|
|
112
|
+
- **Secure Isolation** - Each sandbox runs in its own container
|
|
113
|
+
- **Edge-Native** - Runs on Cloudflare's global network
|
|
114
|
+
- **Code Interpreter** - Execute Python and JavaScript with rich outputs
|
|
115
|
+
- **File System Access** - Read, write, and manage files
|
|
116
|
+
- **Command Execution** - Run any command with streaming support
|
|
117
|
+
- **Preview URLs** - Expose services with public URLs
|
|
118
|
+
- **Git Integration** - Clone repositories directly
|
|
119
|
+
|
|
120
|
+
## Contributing
|
|
121
|
+
|
|
122
|
+
We welcome contributions from the community! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on:
|
|
123
|
+
|
|
124
|
+
- Setting up your development environment
|
|
125
|
+
- Creating pull requests
|
|
126
|
+
- Code style and testing requirements
|
|
127
|
+
|
|
128
|
+
## Development
|
|
129
|
+
|
|
130
|
+
This repository contains the SDK source code. Quick start:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Clone the repo
|
|
134
|
+
git clone https://github.com/cloudflare/sandbox-sdk
|
|
135
|
+
cd sandbox-sdk
|
|
136
|
+
|
|
137
|
+
# Install dependencies
|
|
138
|
+
npm install
|
|
139
|
+
|
|
140
|
+
# Run tests
|
|
141
|
+
npm test
|
|
142
|
+
|
|
143
|
+
# Build the project
|
|
144
|
+
npm run build
|
|
145
|
+
|
|
146
|
+
# Type checking and linting
|
|
147
|
+
npm run check
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Examples
|
|
151
|
+
|
|
152
|
+
See the [examples directory](./examples) for complete working examples:
|
|
153
|
+
|
|
154
|
+
- [Minimal](./examples/minimal) - Start here: exec commands, read/write files
|
|
155
|
+
- [Code Interpreter](./examples/code-interpreter) - Give [gpt-oss](https://developers.cloudflare.com/workers-ai/models/gpt-oss-120b/) on Workers AI a Python REPL
|
|
156
|
+
- [Claude Code](./examples/claude-code) - Run [Claude Code](https://claude.ai/code) headless on any repo
|
|
157
|
+
- [OpenAI Agents](./examples/openai-agents) - `Shell` and `Editor` tools for [OpenAI Agents SDK](https://openai.github.io/openai-agents-js/)
|
|
158
|
+
- [OpenCode](./examples/opencode) - [OpenCode](https://github.com/sst/opencode) web UI or [SDK](https://opencode.ai/docs/sdk/) in a sandbox
|
|
159
|
+
- [TypeScript Validator](./examples/typescript-validator) - Build with npm in sandbox, execute in [isolates](https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/)
|
|
160
|
+
|
|
161
|
+
## Status
|
|
162
|
+
|
|
163
|
+
**Beta** - The SDK is in active development. APIs may change before v1.0.
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
[Apache License 2.0](LICENSE)
|
|
168
|
+
|
|
169
|
+
## Links
|
|
170
|
+
|
|
171
|
+
- [Documentation](https://developers.cloudflare.com/sandbox/)
|
|
172
|
+
- [GitHub Issues](https://github.com/cloudflare/sandbox-sdk/issues)
|
|
173
|
+
- [Developer Discord](https://discord.cloudflare.com)
|
|
174
|
+
- [Cloudflare Developers](https://twitter.com/CloudflareDev)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `@cloudflare/vite-plugin`
|
|
2
|
+
|
|
3
|
+
The Cloudflare Vite plugin enables a full-featured integration between [Vite](https://vite.dev/) and the [Workers runtime](https://developers.cloudflare.com/workers/runtime-apis/).
|
|
4
|
+
Your Worker code runs inside [workerd](https://github.com/cloudflare/workerd), matching the production behavior as closely as possible and providing confidence as you develop and deploy your applications.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
// vite.config.ts
|
|
8
|
+
|
|
9
|
+
import { defineConfig } from "vite";
|
|
10
|
+
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
11
|
+
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
plugins: [cloudflare()],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Documentation
|
|
18
|
+
|
|
19
|
+
Full documentation can be found [here](https://developers.cloudflare.com/workers/vite-plugin/).
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- Uses the Vite [Environment API](https://vite.dev/guide/api-environment) to integrate Vite with the Workers runtime
|
|
24
|
+
- Provides direct access to [Workers runtime APIs](https://developers.cloudflare.com/workers/runtime-apis/) and [bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/)
|
|
25
|
+
- Builds your front-end assets for deployment to Cloudflare, enabling you to build static sites, SPAs, and full-stack applications
|
|
26
|
+
- Official support for [TanStack Start](https://tanstack.com/start/) and [React Router v7](https://reactrouter.com/) with server-side rendering
|
|
27
|
+
- Leverages Vite's hot module replacement for consistently fast updates
|
|
28
|
+
- Supports `vite preview` for previewing your build output in the Workers runtime prior to deployment
|
|
29
|
+
|
|
30
|
+
## Use cases
|
|
31
|
+
|
|
32
|
+
- [TanStack Start](https://tanstack.com/start/)
|
|
33
|
+
- [React Router v7](https://reactrouter.com/)
|
|
34
|
+
- Support for more full-stack frameworks is coming soon
|
|
35
|
+
- Static sites, such as single-page applications, with or without an integrated backend API
|
|
36
|
+
- Standalone Workers
|
|
37
|
+
- Multi-Worker applications
|