### Running the Store Example Source: https://github.com/pylonsync/pylon/blob/main/examples/store/README.md Commands to install dependencies and run the backend and UI for the store example. ```bash cd examples/store bun install pylon dev # backend :4321 # second terminal cd examples/store/web bun install bun run dev # UI :5179 ``` -------------------------------- ### Install Dependencies and Start UI Server Source: https://github.com/pylonsync/pylon/blob/main/examples/bench/README.md In a separate terminal, navigate to the web directory, install dependencies, and start the UI server. This serves the benchmark dashboard. ```bash cd web bun install bun run dev # serves the UI on :5176 ``` -------------------------------- ### Install and Run Arena Example Source: https://github.com/pylonsync/pylon/blob/main/examples/arena/README.md Steps to install dependencies and run the Pylon server and the Vite UI for the Arena example. Ensure you have bun installed. ```bash cd examples/arena bun install bun run dev # starts the Pylon server on :4321 # in a second terminal cd web bun install bun run dev # serves the UI on :5174 ``` -------------------------------- ### Install Dependencies and Start Pylon Server Source: https://github.com/pylonsync/pylon/blob/main/examples/bench/README.md Navigate to the bench directory, install dependencies, and start the Pylon server. This sets up the backend for the load test. ```bash cd examples/bench bun install bun run dev # starts Pylon server on :4321 ``` -------------------------------- ### Install and Run Trade Example Source: https://github.com/pylonsync/pylon/blob/main/examples/trade/README.md Steps to install dependencies and run the Pylon server and the Vite UI for the trade example. Ensure you navigate to the correct directories for each command. ```bash cd examples/trade bun install bun run dev # starts Pylon server on :4321 # in a second terminal cd web bun install bun run dev # serves the UI on :5175 ``` -------------------------------- ### k6 HTTP Load Testing Setup and Execution Source: https://github.com/pylonsync/pylon/blob/main/benchmarks/README.md Install k6 and run benchmark scripts for testing HTTP-level load. Includes examples for default execution and custom URLs. ```bash brew install k6 k6 run benchmarks/k6/catalog.js # Or with a custom URL: k6 run -e BASE_URL=https://your-deploy.fly.dev benchmarks/k6/catalog.js ``` -------------------------------- ### Clone and Run Pylon SSR Example Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/ssr/overview.mdx Clone the Pylon repository, navigate to the SSR example directory, install dependencies, and start the development server. Access the application at http://localhost:4321/. ```bash git clone https://github.com/pylonsync/pylon cd pylon/examples/ssr-hello bun install pylon dev ``` -------------------------------- ### Quick Start: Running Pylon Benchmarks Source: https://github.com/pylonsync/pylon/blob/main/benchmarks/README.md Instructions to set up and run Pylon in different example applications and then execute various benchmarks from the repository root. ```bash # 1. Bring up Pylon under whichever app exercises the workload you care about. cd examples/store && pylon dev # search-heavy cd examples/bench && pylon dev # mutation-heavy cd examples/arena && pylon dev # WS-fanout-heavy # 2. From the repo root, run a benchmark: bun benchmarks/ws-fanout/run.ts --subscribers 5000 --writers 1 k6 run benchmarks/k6/catalog.js cargo bench -p pylon-runtime --bench bench ``` -------------------------------- ### Run World3D Example Source: https://github.com/pylonsync/pylon/blob/main/examples/world3d/README.md Instructions to run the World3D example. This involves starting the Pylon server in one terminal and the Vite UI client in another. ```bash cd examples/world3d bun install bun run dev # Pylon server on :4321 # second terminal cd web bun install bun run dev # UI on :5177 ``` -------------------------------- ### Run Auction House Example Source: https://github.com/pylonsync/pylon/blob/main/examples/auction-house/README.md Navigate to the example directory and start the development server to run the Auction House application. ```sh cd examples/auction-house pylon dev ``` -------------------------------- ### Install and Run Forge Example Source: https://github.com/pylonsync/pylon/blob/main/examples/forge/README.md Instructions to set up and run the Forge collaborative 3D scene editor. Requires two terminals for the Pylon server and the UI. ```bash cd examples/forge bun install bun run dev # Pylon server on :4321 # second terminal cd web bun install bun run dev # UI on :5178 ``` -------------------------------- ### Run Pylon Chat Example Source: https://github.com/pylonsync/pylon/blob/main/examples/chat/README.md Navigate to the chat example directory and start the Pylon development server. This command also auto-spawns the Vite dev server for the React frontend. ```sh cd examples/chat bun dev ``` -------------------------------- ### Pylon Swift SDK Quickstart Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/swift.mdx Initialize PylonClient for HTTP requests and SyncEngine for real-time synchronization. Includes setup for optimistic mutations and subscribing to store changes. ```swift import PylonClient import PylonSync // 1. HTTP client — handles auth, entity CRUD, function calls let client = PylonClient(baseURL: URL(string: "https://your-app.com")!) try await client.startMagicCode(email: "alice@example.com") let session = try await client.verifyMagicCode(email: "alice@example.com", code: "123456") // session.token is persisted to UserDefaults automatically // 2. Sync engine — pulls + pushes + WebSocket/SSE reconnect with backoff let cfg = SyncEngineConfig( baseURL: URL(string: "https://your-app.com")!, transport: .websocket // or .sse / .poll ) let persistence = try SQLitePersistence( path: NSHomeDirectory() + "/Documents/pylon.db" ) let engine = await SyncEngine(config: cfg, client: client, persistence: persistence) await engine.start() // 3. Optimistic mutations — local store updates immediately, syncs in background _ = await engine.insert("Todo", ["title": "ship it", "done": false]) // 4. React to local-store changes let store = await engine.store _ = store.subscribe { let todos = store.list("Todo") print("now have \(todos.count) todos") } ``` -------------------------------- ### Run pylon Dev Server Source: https://github.com/pylonsync/pylon/blob/main/CONTRIBUTING.md Start the development server for the todo app example using the pylon-cli. ```sh cargo run -p pylon-cli -- dev examples/todo-app/app.pylon ``` -------------------------------- ### Run Pylon Server and Web UI Source: https://github.com/pylonsync/pylon/blob/main/examples/linear/README.md Instructions to run the Pylon server and the associated web UI. Ensure dependencies are installed before starting the development servers. ```bash cd examples/linear bun install # Terminal 1: Pylon server bun run dev # → http://localhost:4321 # Terminal 2: web UI cd web bun install bun dev # → http://localhost:5173 ``` -------------------------------- ### Install Pylon Client Source: https://github.com/pylonsync/pylon/blob/main/packages/client/README.md Install the @pylonsync/client package using pnpm. ```bash pnpm add @pylonsync/client ``` -------------------------------- ### Initialize and Start Pylon Sync Engine Source: https://github.com/pylonsync/pylon/blob/main/apps/web/public/pylon-skill.md Set up the Pylon synchronization engine with configuration, client, and persistence, then start its operation. ```swift await SyncEngine(config: cfg, client: client, persistence: SQLitePersistence(...)) ``` ```swift await engine.start() ``` -------------------------------- ### Start Pylon Dev Server Source: https://github.com/pylonsync/pylon/blob/main/examples/swift-todo/README.md Starts the local Pylon development server. Ensure you are in the todo-app directory. ```bash cd examples/todo-app pylon dev # → http://localhost:4321 ``` -------------------------------- ### Install Tailwind CLI and Tailwind CSS Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/ssr/styling.mdx Install the necessary Tailwind packages using Bun. ```bash bun add @tailwindcss/cli tailwindcss ``` -------------------------------- ### Install @pylonsync/sdk with Bun Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/typescript.mdx Install the SDK using the Bun package manager. ```bash bun add @pylonsync/sdk ``` -------------------------------- ### Install @pylonsync/webhooks Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/plugins/webhooks.mdx Install the webhooks plugin using bun. ```bash bun add @pylonsync/webhooks ``` -------------------------------- ### Install @pylonsync/stripe Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/plugins/stripe.mdx Install the stripe plugin for Pylon using Bun. ```bash bun add @pylonsync/stripe ``` -------------------------------- ### Install React SDK Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/react.mdx Install the @pylonsync/react package using your preferred package manager. ```bash bun add @pylonsync/react # or: npm i @pylonsync/react ``` -------------------------------- ### Install Pylon Next.js SDK Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/next.mdx Install the @pylonsync/next package using bun or npm. The @pylonsync/sdk and @pylonsync/react packages are installed transitively. ```sh bun add @pylonsync/next # or: npm i @pylonsync/next ``` -------------------------------- ### Start Pylon Development Server Source: https://github.com/pylonsync/pylon/blob/main/apps/web/public/pylon-skill.md Starts the Pylon development server with auto-migration. Use DATABASE_URL to target PostgreSQL. ```bash cd web && bun run dev ``` -------------------------------- ### Install @pylonsync/sdk with pnpm Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/typescript.mdx Install the SDK using the pnpm package manager. ```bash pnpm add @pylonsync/sdk ``` -------------------------------- ### Install @pylonsync/sync Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/sync.mdx Install the sync engine package using Bun. This is typically done when using the engine standalone without React. ```bash bun add @pylonsync/sync ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/pylonsync/pylon/blob/main/packages/create-pylon/templates/_root/README.md Commands to install project dependencies using Bun, pnpm, yarn, or npm. ```sh # Install bun install # or pnpm install / yarn / npm install ``` -------------------------------- ### Install @pylonsync/feature-flags Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/plugins/feature-flags.mdx Install the feature flags library using bun. ```bash bun add @pylonsync/feature-flags ``` -------------------------------- ### Install @pylonsync/sdk with npm Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/typescript.mdx Install the SDK using the npm package manager. ```bash npm install @pylonsync/sdk ``` -------------------------------- ### Install Pylon SDK and Functions Dependencies Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/quickstart.mdx Installs the necessary Pylon SDK and functions packages into the 'apps/api' directory if they were not included during initialization. ```bash cd apps/api && bun add @pylonsync/sdk @pylonsync/functions ``` -------------------------------- ### Install Dependencies Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/react-native.mdx Install the necessary Pylon SDK packages and their React Native dependencies using Bun. ```bash bun add @pylonsync/sdk @pylonsync/react @pylonsync/react-native bun add @react-native-async-storage/async-storage expo-sqlite ``` -------------------------------- ### Basic CLI Help Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/cli.mdx Get a list of all available pylon commands or detailed help for a specific command. ```bash pylon --help # full command list pylon --help # per-command flags ``` -------------------------------- ### Add Pylon Web SDK with Bun Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/installation.mdx Install the Pylon SDK and React bindings for web development using Bun. ```bash bun add @pylonsync/sdk @pylonsync/react ``` -------------------------------- ### Install SAML Dependencies on Debian/Ubuntu Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/auth/sso.mdx Install libxmlsec1-dev and libxml2-dev using apt-get for SAML functionality on Debian/Ubuntu systems. ```bash # Debian / Ubuntu apt-get install libxmlsec1-dev libxml2-dev ``` -------------------------------- ### Add Pylon Web SDK with npm Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/installation.mdx Install the Pylon SDK and React bindings for web development using npm. ```bash npm install @pylonsync/sdk @pylonsync/react ``` -------------------------------- ### Construct and Start Sync Engine Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/sync.mdx Create a new sync engine instance with a server URL and configuration options. The engine must be started to load data and connect to the server. ```typescript import { createSyncEngine } from "@pylonsync/sync"; const engine = createSyncEngine("https://your-app.com", { transport: "websocket", // or "sse" or "poll" appName: "default", persist: true, // enables IndexedDB persistence }); await engine.start(); ``` -------------------------------- ### Install direnv and cachix with Nix Source: https://github.com/pylonsync/pylon/blob/main/vendor/samael/README.md Installs the direnv and cachix tools using Nix. Ensure ~/.nix-profile/bin is in your PATH before running. ```bash # Add ~/.nix-profile/bin to your path first nix profile install nixpkgs#direnv nix profile install nixpkgs#cachix ``` -------------------------------- ### Construct and Start Sync Engine Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/sync.mdx Initializes and starts the sync engine. It loads cached data, hydrates the mutation queue, resolves the session, pulls changes, and connects to the real-time transport. ```APIDOC ## Construct an engine ```typescript import { createSyncEngine } from "@pylonsync/sync"; const engine = createSyncEngine("https://your-app.com", { transport: "websocket", // or "sse" or "poll" appName: "default", persist: true, // enables IndexedDB persistence }); await engine.start(); ``` ### Description The `createSyncEngine` function initializes the sync engine with a given server URL and configuration options. The `start()` method then performs several crucial steps to bring the engine online, including loading persisted data, preparing for offline mutations, authenticating the session, fetching initial changes, and establishing a real-time connection. ``` -------------------------------- ### Install Bun Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/installation.mdx Install Bun, a fast JavaScript runtime, bundler, transpiler, and package manager, which Pylon uses for TypeScript functions and client code generation. ```bash curl -fsSL https://bun.sh/install | bash ``` -------------------------------- ### Install and Sign In to Pylon CLI Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/cli.mdx Install the Pylon CLI and authenticate your session. Supports interactive login or using a one-time code for agent handoff. ```bash curl -fsSL https://pylonsync.com/install.sh | bash pylon login # opens cloud.pylonsync.com/dashboard/account/cli-tokens, prompts you to paste a token pylon login --code XXXX-XXXX # agent-handoff path: redeems a one-time code minted by # the dashboard's "Hand off to your coding agent" card. # See /operations/agent-handoff. pylon logout # delete ~/.config/pylon/credentials.json ``` -------------------------------- ### Add Pylon Web SDK with pnpm Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/installation.mdx Install the Pylon SDK and React bindings for web development using pnpm. ```bash pnpm add @pylonsync/sdk @pylonsync/react ``` -------------------------------- ### Install Pylon CLI Source: https://github.com/pylonsync/pylon/blob/main/README.md Installs the Pylon command-line interface using a curl script. This is the primary method for getting started. ```sh curl -fsSL https://pylonsync.com/install.sh | bash ``` -------------------------------- ### Run Development Server Source: https://github.com/pylonsync/pylon/blob/main/packages/create-pylon/templates/_root/README.md Command to start the development server, which runs the Pylon API and all scaffolded frontend applications. ```sh # Run everything (the API + every frontend you picked) bun run dev ``` -------------------------------- ### TypeScript Quickstart: Configure Client and Fetch List Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/overview.mdx Demonstrates basic client configuration, user sign-in, and fetching a list of entities in TypeScript. ```typescript import { configureClient } from "@pylonsync/react"; configureClient({ baseUrl: "https://your-app.com" }); // Sign in await startMagicLink("alice@example.com"); const session = await verifyMagicLink("alice@example.com", code); // Use entities const todos = await fetchList("Todo"); // Or via sync engine for live updates + optimistic writes import { createSyncEngine } from "@pylonsync/sync"; const engine = createSyncEngine("https://your-app.com"); await engine.start(); await engine.insert("Todo", { title: "ship it", done: false }); ``` -------------------------------- ### Swift Quickstart: Configure Client and Insert Todo Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/clients/overview.mdx Illustrates client configuration, user authentication, and inserting a new todo item using the Swift SDK. ```swift import PylonClient import PylonSync let client = PylonClient(baseURL: URL(string: "https://your-app.com")!) try await client.startMagicCode(email: "alice@example.com") _ = try await client.verifyMagicCode(email: "alice@example.com", code: code) let cfg = SyncEngineConfig(baseURL: URL(string: "https://your-app.com")!) let engine = await SyncEngine(config: cfg, client: client) await engine.start() _ = await engine.insert("Todo", ["title": "ship it", "done": false]) ``` -------------------------------- ### List Users via SCIM GET Request Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/auth/scim.mdx Example of sending a GET request to list all users via the SCIM 2.0 API. Requires the Authorization header. ```bash curl https://your-app/scim/v2/Users \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Initialize Pylon App and Deploy Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/sst.mdx Copy the reference configuration, set necessary secrets, and deploy the application to a specific stage. Ensure you have the SST CLI installed and configured. ```bash cp deploy/sst/sst.config.ts your-app/sst.config.ts cd your-app sst secret set PylonAdminToken sst deploy --stage production ``` -------------------------------- ### Multiple Links in Navigation Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/ssr/link.mdx Use multiple Link components within a navigation element to provide access to different sections of your application. This example demonstrates a typical navigation bar setup. ```tsx import { Link } from "@pylonsync/react"; export default function Nav() { return ( ); } ``` -------------------------------- ### Production Plugin Configuration with Audit Log Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/plugins/integrations.mdx Example of integrating the audit_log plugin into a production setup alongside other essential plugins like file storage, email, Stripe, and webhooks. Excludes sensitive fields from audit logs. ```json { "plugins": [ { "name": "file_storage", "config": { "backend": "s3", "bucket": "uploads", ... } }, { "name": "email", "config": { "provider": "stack0" } }, { "name": "audit_log", "config": { "entities": ["User", "Subscription", "ApiKey"], "exclude_fields": ["passwordHash", "totpSecret"] } }, { "name": "stripe", "config": { "webhook_secret_env": "STRIPE_WEBHOOK_SECRET", "sync_to_entity": { "Customer": "User", "Subscription": "Subscription" } } }, { "name": "webhooks", "config": { "hooks": [...] } } ] } ``` -------------------------------- ### Install SST CLI Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/sst.mdx Installs the SST CLI using a curl command. Ensure you have bash and curl installed. ```bash curl -fsSL https://ion.sst.dev/install | bash ``` -------------------------------- ### Enable and Start Pylon Service Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/deploy.mdx Command to enable the Pylon systemd service to start on boot and immediately start the service. ```sh systemctl enable --now pylon ``` -------------------------------- ### Register and Login with Pylon SDKs Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/auth/password.mdx Examples demonstrating how to configure the Pylon client and perform user registration and login operations using TypeScript and Swift SDKs. ```typescript import { configureClient } from "@pylonsync/react"; configureClient({ baseUrl: "https://your-app" }); // Register const reg = await fetch("/api/auth/password/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email, password, displayName: name }), }).then(r => r.json()); // Login const login = await fetch("/api/auth/password/login", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email, password }), }).then(r => r.json()); ``` ```swift import PylonClient let client = PylonClient(baseURL: URL(string: "https://your-app")!) let session = try await client.signInWithPassword( email: "alice@example.com", password: "correct-horse-battery-staple" ) // token is persisted automatically ``` -------------------------------- ### Build and Run Pylon ERP CLI Source: https://github.com/pylonsync/pylon/blob/main/examples/erp/README.md Build the Pylon CLI in release mode and then run the development server and web UI from the examples/erp directory. ```bash # From the repo root: cargo build --release -p pylon-cli # Terminal 1: dev server cd examples/erp ../../target/release/pylon dev # Terminal 2: web UI cd examples/erp/web bun install bun dev # → http://localhost:5174 ``` -------------------------------- ### Verify Pylon CLI Installation Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/quickstart.mdx Checks the installed version of the Pylon CLI. ```bash pylon --version ``` -------------------------------- ### Create and Run a New Pylon Project Source: https://github.com/pylonsync/pylon/blob/main/README.md Initializes a new Pylon project and starts the development server with live reload capabilities. Access the inspector at http://localhost:4321/studio. ```sh pylon init my-app cd my-app pylon dev ``` -------------------------------- ### Pylon Sync Service Provider Setup and Usage Source: https://github.com/pylonsync/pylon/blob/main/vendor/samael/README.md This snippet demonstrates setting up a SAML Service Provider using the Pylon Sync library. It includes fetching IdP metadata, building the SP configuration with keys and contact information, and exposing metadata and ACS endpoints using Warp. ```rust use samael::metadata::{ContactPerson, ContactType, EntityDescriptor}; use samael::service_provider::ServiceProviderBuilder; use std::collections::HashMap; use std::fs; use warp::Filter; #[tokio::main] async fn main() -> Result<(), Box> { openssl_probe::init_ssl_cert_env_vars(); let resp = reqwest::get("https://samltest.id/saml/idp") .await?; let idp_metadata: EntityDescriptor = samael::metadata::de::from_str(&resp.text().await?)?; let pub_key = openssl::x509::X509::from_pem(&fs::read("./publickey.cer")?)?; let private_key = openssl::rsa::Rsa::private_key_from_pem(&fs::read("./privatekey.pem")?)?; let sp = ServiceProviderBuilder::default() .entity_id("".to_string()) .key(private_key) .certificate(pub_key) .allow_idp_initiated(true) .contact_person(ContactPerson { sur_name: Some("Bob".to_string()), contact_type: Some(ContactType::Technical.value().to_string()), ..ContactPerson::default() }) .idp_metadata(idp_metadata) .acs_url("http://localhost:8080/saml/acs".to_string()) .slo_url("http://localhost:8080/saml/slo".to_string()) .build()?; let metadata = sp.metadata()?.to_string()?; let metadata_route = warp::get() .and(warp::path("metadata")) .map(move || metadata.clone()); let acs_route = warp::post() .and(warp::path("acs")) .and(warp::body::form()) .map(move |s: HashMap| { if let Some(encoded_resp) = s.get("SAMLResponse") { let t = sp .parse_base64_response(encoded_resp, Some(&["a_possible_request_id"])) .unwrap(); return format!("{:?}", t); } format!("") }); let saml_routes = warp::path("saml").and(acs_route.or(metadata_route)); warp::serve(saml_routes).run(([127, 0, 0, 1], 8080)).await; Ok(()) } ``` -------------------------------- ### Install SAML Dependencies on macOS Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/auth/sso.mdx Install libxmlsec1 and libxml2 using Homebrew for SAML functionality on macOS. ```bash # macOS brew install libxmlsec1 libxml2 ``` -------------------------------- ### WebSocket Fanout Benchmark Execution Source: https://github.com/pylonsync/pylon/blob/main/benchmarks/README.md Install dependencies and run the WebSocket subscriber harness benchmark. Allows configuration of subscribers, writers, and duration. ```bash bun install bun benchmarks/ws-fanout/run.ts --subscribers 1000 --writers 1 --duration 30 ``` -------------------------------- ### Deploying to Multiple Environments Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/sst.mdx Demonstrates deploying the Pylon application to different stages, including staging, production, and per-Pull Request preview environments. ```bash sst deploy --stage staging # → staging.your-app.com sst deploy --stage production # → api.your-app.com sst deploy --stage pr-42 # → pr-42.preview.your-app.com (per-PR previews) ``` -------------------------------- ### Run Pylon Dev Server Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/sst.mdx Starts the Pylon development server, connecting to the local PostgreSQL database using the provided DATABASE_URL. ```bash DATABASE_URL=postgres://pylon:pylon@localhost:5432/pylon pylon dev ``` -------------------------------- ### Start Local Docker Compose Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/operations/sst.mdx Command to start the Docker services defined in the docker-compose.dev.yml file in detached mode. ```bash docker compose -f docker-compose.dev.yml up -d ``` -------------------------------- ### Install Pylon via Cargo Source: https://github.com/pylonsync/pylon/blob/main/README.md Installs the Pylon CLI by compiling it directly from source using the Cargo package manager. ```sh cargo install pylon-cli ``` -------------------------------- ### Knowledge Base / Docs Site Plugin Configuration Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/plugins/search-ai.mdx Example configuration for a knowledge base or docs site, integrating search, vector search, ai_proxy for LLM Q&A, and mcp for direct LLM integration. ```jsonc [ { "name": "search" }, // configured per-entity { "name": "vector_search", "config": { "entity": "Doc", "field": "embedding", "dimensions": 1536 } }, { "name": "ai_proxy", "config": { "providers": { "openai": { "api_key_env": "OPENAI_API_KEY" } } } }, { "name": "mcp", "config": { "entities": ["Doc"], "functions": ["semanticSearch"] } } ] ``` -------------------------------- ### Install Pylon via Homebrew Source: https://github.com/pylonsync/pylon/blob/main/README.md Installs the Pylon CLI using the Homebrew package manager on macOS and Linux systems. ```sh brew install pylonsync/tap/pylon ``` -------------------------------- ### Run Pylon Development Server Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/quickstart.mdx Starts the Pylon development server from the 'apps/api' directory. The server auto-discovers the schema, watches for changes, migrates the database, and serves the API. ```bash cd apps/api pylon dev ``` -------------------------------- ### Verify Pylon CLI Installation Source: https://github.com/pylonsync/pylon/blob/main/apps/docs/installation.mdx Check the installed Pylon CLI version and run a diagnostic check to ensure all dependencies are met. ```bash pylon --version pylon doctor ``` -------------------------------- ### Initialize Pylon React Client Source: https://github.com/pylonsync/pylon/blob/main/apps/web/public/pylon-skill.md Shows how to initialize the Pylon React client in your application's entry point. Requires base URL and app name configuration. ```tsx // In your app's root component or mount file import { init, configureClient } from "@pylonsync/react"; const BASE_URL = import.meta.env.VITE_PYLON_URL ?? "http://localhost:4321"; init({ baseUrl: BASE_URL, appName: "my-app" }); configureClient({ baseUrl: BASE_URL, appName: "my-app" }); ```