### Install Trycompai UI Source: https://github.com/trycompai/comp/blob/main/packages/ui/README.md Install the UI library using npm, yarn, or bun. ```bash # Using npm npm install @trycompai/ui # Using yarn yarn add @trycompai/ui # Using bun bun add @trycompai/ui ``` -------------------------------- ### Start Development Server with Turbo Source: https://github.com/trycompai/comp/blob/main/README.md Command to start the development server using the Turbo CLI. Ensure Turbo is installed globally. ```sh turbo dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/trycompai/comp/blob/main/apps/api/README.md Installs all necessary packages for the project. Run this command in the project's root directory. ```bash $ npm install ``` -------------------------------- ### Install and Use Comp AI Packages Source: https://github.com/trycompai/comp/blob/main/README.md Install a published package using npm and import components into your project. ```bash # Install a published package npm install @trycompai/ui ``` ```javascript # Use in your project import { Button } from '@trycompai/ui/button' import { client } from '@trycompai/kv' ``` -------------------------------- ### Install @trycompai/db and Prisma Client Source: https://github.com/trycompai/comp/blob/main/packages/db/INTEGRATION_GUIDE.md Install the @trycompai/db package along with @prisma/client and prisma as a dev dependency. Bun is the recommended package manager. ```bash # Using bun (recommended) bun add @trycompai/db @prisma/client bun add -D prisma # Using npm npm install @trycompai/db @prisma/client npm install -D prisma # Using yarn yarn add @trycompai/db @prisma/client yarn add -D prisma ``` -------------------------------- ### Complete GitHub OAuth 2.0 Example Source: https://github.com/trycompai/comp/blob/main/packages/docs/integrations/authentication.mdx This snippet shows a full configuration for OAuth 2.0 authentication with GitHub, including authorization and token URLs, scopes, and setup instructions. It highlights specific GitHub token behavior and consent screen parameters. ```typescript auth: { type: 'oauth2', config: { authorizeUrl: 'https://github.com/login/oauth/authorize', tokenUrl: 'https://github.com/login/oauth/access_token', scopes: ['repo', 'read:org', 'read:user'], pkce: false, clientAuthMethod: 'body', supportsRefreshToken: false, // GitHub tokens don't expire authorizationParams: { allow_signup: 'false', // Don't show sign-up on consent }, setupInstructions: `## Create GitHub OAuth App 1. Go to https://github.com/settings/developers 2. Click "New OAuth App" 3. Enter: - Application name: Your app name - Homepage URL: https://yourapp.com - Callback URL: [shown below] 4. Click "Register application" 5. Copy Client ID and generate Client Secret 6. Paste both below`, createAppUrl: 'https://github.com/settings/apps/new', }, } ``` -------------------------------- ### Install @trycompai/db Source: https://github.com/trycompai/comp/blob/main/packages/db/README.md Install the database package using Bun. This command adds the package to your project dependencies. ```bash bun add @trycompai/db ``` -------------------------------- ### Start PostgreSQL Database with Docker Source: https://github.com/trycompai/comp/blob/main/README.md Navigate to the database package directory and run the Docker up command to start the PostgreSQL instance. ```sh cd packages/db bun docker:up ``` -------------------------------- ### Install Mintlify with yarn Source: https://github.com/trycompai/comp/blob/main/packages/docs/development.mdx Install the Mintlify CLI globally using yarn. Ensure Node.js version 19 or higher is installed. ```bash yarn global add mintlify ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/trycompai/comp/blob/main/CONTRIBUTING.md Install all necessary project dependencies using the bun package manager. ```sh bun i ``` -------------------------------- ### Package Installers for All Platforms Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/BUILD.md Builds installers for both macOS and Windows platforms. ```bash bun run package:all ``` -------------------------------- ### Copy Environment Example Files Source: https://github.com/trycompai/comp/blob/main/README.md Copies example environment files to their respective locations for local configuration. This is a common first step for setting up new projects. ```sh cp apps/app/.env.example apps/app/.env cp apps/portal/.env.example apps/portal/.env cp packages/db/.env.example packages/db/.env ``` -------------------------------- ### Start Local Development Server Source: https://github.com/trycompai/comp/blob/main/packages/docs/README.md Run the Mintlify development server from the root of your documentation directory. Ensure docs.json is present. ```bash mintlify dev ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/trycompai/comp/blob/main/apps/app/e2e/README.md Run this command to install the necessary Playwright browsers, or to install a specific browser like Chromium if it's missing. ```bash bun run test:e2e:install ``` ```bash bunx playwright install chromium ``` -------------------------------- ### Install Mintlify CLI Source: https://github.com/trycompai/comp/blob/main/packages/docs/README.md Install the Mintlify CLI globally to preview documentation changes locally. This command is run using npm. ```bash npm i -g mintlify ``` -------------------------------- ### Start API in Development Source: https://github.com/trycompai/comp/blob/main/apps/api/CLAUDE.md Use this command to start the API in development mode. It filters the command to only apply to the @trycompai/api package. ```bash npx turbo run dev --filter=@trycompai/api ``` -------------------------------- ### Prepare Environment Files Source: https://github.com/trycompai/comp/blob/main/packages/docs/self-hosting/docker.mdx Copies example environment files for the database, app, and portal. These files should then be edited with production-specific values. ```bash cp packages/db/.env.example packages/db/.env cp apps/app/.env.example apps/app/.env cp apps/portal/.env.example apps/portal/.env # Edit each file with your production values ``` -------------------------------- ### Package Windows Installer Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/BUILD.md Builds an NSIS .exe installer for Windows. ```bash bun run package:win ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/trycompai/comp/blob/main/apps/app/e2e/README.md Run this command once to set up the necessary Playwright browsers for testing. ```bash # Install Playwright browsers (one-time setup) bun run test:e2e:install ``` -------------------------------- ### Start Development Server (App) Source: https://github.com/trycompai/comp/blob/main/docs/superpowers/plans/2026-05-21-nist-sp800-53-controls-grouping.md Start the development server for the app, filtering for 'dev:no-trigger' to exclude specific triggers. ```bash cd /Users/mariano/code/comp/.worktrees/nist-sp800-53-readiness bun run --filter '@trycompai/app' dev:no-trigger ``` -------------------------------- ### Start MCP Server via npm Source: https://github.com/trycompai/comp/blob/main/apps/mcp-server/README.md Command to start the MCP server using npm. Use `--help` to see all available server arguments. ```bash npx @trycompai/mcp-server start --apikey ``` ```bash npx @trycompai/mcp-server --help ``` -------------------------------- ### Package macOS Installer Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/BUILD.md Builds a universal .dmg installer for macOS (Apple Silicon + Intel). ```bash bun run package:mac ``` -------------------------------- ### Run Development Server Source: https://github.com/trycompai/comp/blob/main/apps/app/README.md Commands to start the Next.js development server using different package managers. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` ```bash bun dev ``` -------------------------------- ### Start Database Container and Migrate Source: https://github.com/trycompai/comp/blob/main/README.md Starts the PostgreSQL database using Docker and applies database migrations. This ensures the database is ready for the application. ```sh cd packages/db bun run docker:up # Spin up docker container bun run db:migrate # Run migrations ``` -------------------------------- ### Start Development Server (API) Source: https://github.com/trycompai/comp/blob/main/docs/superpowers/plans/2026-05-21-nist-sp800-53-controls-grouping.md Start the development server for the API, filtering for 'dev:no-trigger' to exclude specific triggers. ```bash bun run --filter '@trycompai/api' dev:no-trigger ``` -------------------------------- ### Install Dependencies (Device Agent Package) Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/BUILD.md Installs project dependencies using Bun specifically for the device-agent package. ```bash cd packages/device-agent bun install ``` -------------------------------- ### Database Setup Script in package.json Source: https://github.com/trycompai/comp/blob/main/packages/db/INTEGRATION_GUIDE.md Define scripts in your package.json for common database operations like setup, generation, migration, and studio access. ```json { "scripts": { "db:setup": "cp node_modules/@trycompai/db/dist/schema.prisma prisma/schema.prisma && echo '\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"./generated\"\n}' >> prisma/schema.prisma && prisma generate", "db:generate": "prisma generate", "db:migrate": "prisma migrate dev", "db:studio": "prisma studio" } } ``` -------------------------------- ### Install MCP Server for Cursor Source: https://github.com/trycompai/comp/blob/main/apps/mcp-server/README.md Manual installation configuration for the MCP server in Cursor. Paste this JSON into the MCP Server Configuration in Cursor Settings. ```json { "command": "npx", "args": [ "@trycompai/mcp-server", "start", "--apikey", "" ] } ``` -------------------------------- ### OpenAPI Configuration Examples Source: https://github.com/trycompai/comp/blob/main/packages/docs/essentials/settings.mdx Configure OpenAPI file paths for documentation generation. Supports absolute URLs, relative paths, and multiple files. ```json "openapi": "https://example.com/openapi.json" ``` ```json "openapi": "/openapi.json" ``` ```json "openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"] ``` -------------------------------- ### Codex CLI Installation Source: https://github.com/trycompai/comp/blob/main/packages/docs/mcp-server.mdx Install the CompAI MCP server in Codex CLI with this command. The server is registered immediately. ```bash codex mcp add comp-ai -- npx -y @trycompai/mcp-server start --apikey comp_your_api_key_here ``` -------------------------------- ### Start Trigger.dev Development Server Source: https://github.com/trycompai/comp/blob/main/CONTRIBUTING.md Navigate to the app directory and start the Trigger.dev development server. This command also handles login if not already authenticated. ```sh bunx trigger.dev@latest login bunx trigger.dev@latest dev ``` -------------------------------- ### Run Development Servers Source: https://github.com/trycompai/comp/blob/main/docs/plans/2026-04-22-sale-45-screenshot-automation-improvements.md Start the API and app development servers using Turbo. This is necessary for reproducing automation errors locally. ```bash npx turbo run dev --filter=@trycompai/api & npx turbo run dev --filter=@trycompai/app & ``` -------------------------------- ### Install mcp-publisher CLI Source: https://github.com/trycompai/comp/blob/main/apps/mcp-server/README.md Download and install the `mcp-publisher` CLI tool for manual MCP Registry publishing. This command automatically detects your OS and architecture. ```bash curl -sL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher && sudo mv mcp-publisher /usr/local/bin/ ``` -------------------------------- ### Environment Variable Setup Source: https://github.com/trycompai/comp/blob/main/packages/db/INTEGRATION_GUIDE.md Configure the DATABASE_URL in your .env file to connect to your PostgreSQL database. This is essential for the client to function. ```env DATABASE_URL="postgresql://username:password@localhost:5432/database" ``` -------------------------------- ### Install Linux Agent Source: https://github.com/trycompai/comp/blob/main/packages/docs/device-agent.mdx Install the Comp AI Device Agent on Linux using dpkg. Ensure you have the correct .deb package for your architecture. ```bash sudo dpkg -i CompAI-Device-Agent-amd64.deb ``` -------------------------------- ### Start CompAI Services Source: https://github.com/trycompai/comp/blob/main/packages/docs/self-hosting/docker.mdx Starts the CompAI application and portal services in detached mode (-d) using docker-compose. ```bash docker compose up -d app portal ``` -------------------------------- ### Install Turbo CLI Globally Source: https://github.com/trycompai/comp/blob/main/README.md Use Bun to install the Turbo CLI globally on your system. This is a prerequisite for using the 'turbo dev' command. ```sh bun add -g turbo ``` -------------------------------- ### Run Development Server Source: https://github.com/trycompai/comp/blob/main/CONTRIBUTING.md Start the main development server for the project. This command also watches for code changes. ```sh bun run dev ``` -------------------------------- ### Main Process Lifecycle Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Describes the sequence of events when the Electron application starts. ```text 1. App starts, requests single-instance lock 2. Hides dock icon on macOS (tray-only app) 3. Creates system tray with icon and context menu 4. Syncs auto-launch (start at login) setting with the OS (see [Auto-launch](#auto-launch) below) 5. If already authenticated (stored session), starts the scheduler immediately 6. If not authenticated, opens the sign-in BrowserWindow automatically 7. Listens for IPC messages from the renderer (status window) 8. Handles auto-updates via `electron-updater` (when packaged) ``` -------------------------------- ### Claude Desktop Manual JSON Configuration Source: https://github.com/trycompai/comp/blob/main/packages/docs/mcp-server.mdx Merge this JSON into your `claude_desktop_config.json` for manual setup. Ensure you replace `comp_your_api_key_here` with your actual API key. ```json { "mcpServers": { "comp-ai": { "command": "npx", "args": [ "-y", "@trycompai/mcp-server", "start", "--apikey", "comp_your_api_key_here" ] } } } ``` -------------------------------- ### Setup Prisma Schema and Generate Client Source: https://github.com/trycompai/comp/blob/main/packages/db/INTEGRATION_GUIDE.md Copy the schema file from the @trycompai/db package, add the Prisma client generator block, and then generate the Prisma client. ```bash # Copy the schema file cp node_modules/@trycompai/db/dist/schema.prisma prisma/schema.prisma # Add the generator block to your schema echo " generator client { provider = \"prisma-client-js\" output = \"./generated\" }" >> prisma/schema.prisma # Generate the Prisma client npx prisma generate ``` -------------------------------- ### Run API Development Server Source: https://github.com/trycompai/comp/blob/main/CONTRIBUTING.md Start the development server specifically for the API package. This is necessary for regenerating the OpenAPI JSON spec after changes. ```sh bun run --filter "@trycompai/api" dev ``` -------------------------------- ### Set Up Test Database and Run Migrations Source: https://github.com/trycompai/comp/blob/main/apps/app/e2e/README.md Commands to create a dedicated test database and apply migrations. Ensure the `DATABASE_URL` environment variable is correctly set for the test database. ```bash # Create test database createdb comp_e2e_test # Run migrations on test database DATABASE_URL=postgresql://postgres:postgres@localhost:5432/comp_e2e_test bun db:push ``` -------------------------------- ### Custom Auth Configuration Example Source: https://github.com/trycompai/comp/blob/main/packages/docs/integrations/authentication.mdx Configure custom authentication for complex scenarios like AWS IAM Role, specifying credential fields and setup instructions. ```typescript auth: { type: 'custom', config: { description: 'AWS IAM Role for cross-account access', credentialFields: [ { id: 'roleArn', label: 'IAM Role ARN', type: 'text', required: true, placeholder: 'arn:aws:iam::123456789012:role/MyRole', helpText: 'The ARN of the IAM role to assume', }, { id: 'externalId', label: 'External ID', type: 'password', required: true, helpText: 'Unique identifier for security', }, { id: 'region', label: 'AWS Region', type: 'combobox', required: true, placeholder: 'Select or type...', helpText: 'Primary region for API calls', options: [ { value: 'us-east-1', label: 'US East (N. Virginia)' }, { value: 'eu-west-1', label: 'Europe (Ireland)' }, ], }, ], setupInstructions: `## Setup Guide 1. Create IAM role in AWS 2. Copy the Role ARN 3. Generate External ID 4. Enter credentials below`, }, }, ``` -------------------------------- ### Add Theming CSS Variables Source: https://github.com/trycompai/comp/blob/main/packages/ui/README.md Include the necessary CSS variables for theming in your global CSS file. This example shows variables for light mode and the start of dark mode variables. ```css @layer base { :root { --background: 0 0% 100%; --foreground: 240 10% 3.9%; --card: 0 0% 100%; --card-foreground: 240 10% 3.9%; --popover: 0 0% 100%; --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-foreground: 0 0% 98%; --secondary: 240 4.8% 95.9%; --secondary-foreground: 240 5.9% 10%; --muted: 240 4.8% 95.9%; --muted-foreground: 240 3.8% 46.1%; --accent: 240 4.8% 95.9%; --accent-foreground: 240 5.9% 10%; --destructive: 0 84.2% 60.2%; --destructive-foreground: 0 0% 98%; --border: 240 5.9% 90%; --input: 240 5.9% 90%; --ring: 240 10% 3.9%; --radius: 0.5rem; } .dark { --background: 240 10% 3.9%; --foreground: 0 0% 98%; /* ... add dark mode variables */ } } ``` -------------------------------- ### Start NestJS Application Source: https://github.com/trycompai/comp/blob/main/apps/api/README.md Commands to start the NestJS application in different modes. Use 'start:dev' for development with watch mode. ```bash # development $ npm run start # watch mode $ npm run start:dev # production mode $ npm run start:prod ``` -------------------------------- ### Build and Run Comp with Docker Compose Source: https://github.com/trycompai/comp/blob/main/SELF_HOSTING.md Steps to set up environment files, export build arguments, build Docker images, migrate and seed the database, and finally start the application and portal services. ```bash # 1. Create env files from examples cp packages/db/.env.example packages/db/.env cp apps/app/.env.example apps/app/.env cp apps/portal/.env.example apps/portal/.env # Edit each with your production values # 2. Export build args export BETTER_AUTH_URL="https://app.yourdomain.com" export BETTER_AUTH_URL_PORTAL="https://portal.yourdomain.com" # 3. Build docker compose build --no-cache # 4. Migrate & seed docker compose run --rm migrator docker compose run --rm seeder # 5. Start docker compose up -d app portal ``` -------------------------------- ### NestJS API: Get Devices Endpoint Logic Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Describes the hybrid data fetching strategy for the GET /v1/devices and GET /v1/devices/member/:memberId endpoints. It merges data from FleetDM and the Device table, prioritizing agent devices. ```typescript 1. Fetches from FleetDM API (if `fleetDmLabelId` exists) -- gracefully returns `[]` on failure 2. Fetches from `Device` table via Prisma 3. Merges with deduplication (agent devices take priority) 4. Each result includes `source: 'fleet' | 'device_agent'` in the DTO ``` -------------------------------- ### Local Development and Build Commands Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Commands for setting up the device agent locally, installing dependencies, running in development mode, building for production, and packaging for different operating systems. ```bash cd packages/device-agent bun install bun run dev # Start in dev mode with hot reload bun run build # Build for production bun run package:mac # Package macOS DMG bun run package:win # Package Windows installer bun run package:linux # Package Linux AppImage + .deb ``` -------------------------------- ### Auto-launch Configuration Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Details how the agent registers for automatic startup on different platforms. ```text The agent registers itself to start automatically at login using Electron's `app.setLoginItemSettings()` API. This is **enabled by default** so the agent is always running and able to send compliance updates. | Platform | Mechanism | User Visibility | | -------- | ------------------------------------------------------------- | --------------------------------------- | | macOS | Login Items via Launch Services | System Settings > General > Login Items | | Windows | Registry `HKCU\Software\Microsoft\Windows\CurrentVersion\Run` | Task Manager > Startup tab | | Linux | `.desktop` file in `~/.config/autostart/` | Desktop environment startup settings | - The preference is persisted in the encrypted store (`openAtLogin`, default `true`) - On every launch, `initAutoLaunch()` re-syncs the OS setting with the stored preference (handles app path changes after auto-updates) - Users can toggle it via the "Start at Login" checkbox in the tray context menu - On macOS, the app starts hidden (`openAsHidden: true`) to avoid flashing a window ``` -------------------------------- ### Claude Code CLI Installation Source: https://github.com/trycompai/comp/blob/main/packages/docs/mcp-server.mdx Install the CompAI MCP server in Claude Code using this command. The server will be registered immediately. ```bash claude mcp add CompAI -- npx -y @trycompai/mcp-server start --apikey comp_your_api_key_here ``` -------------------------------- ### Build and Test Comp AI Packages Source: https://github.com/trycompai/comp/blob/main/README.md Commands to build all packages, build a specific package, or test packages locally using bun. ```bash # Build all packages bun run build ``` ```bash # Build specific package bun run -F @trycompai/ui build ``` ```bash # Test packages locally bun run release:packages --dry-run ``` -------------------------------- ### Minimal Database Configuration Source: https://github.com/trycompai/comp/blob/main/packages/docs/self-hosting/env-reference.mdx Configure the DATABASE_URL for your database connection. Ensure the connection string includes the necessary credentials and SSL mode. ```bash DATABASE_URL="postgresql://user:pass@host:5432/comp?sslmode=require" ``` -------------------------------- ### HTTP GET Request with CheckContext Source: https://github.com/trycompai/comp/blob/main/packages/docs/integrations/checks.mdx Performs an HTTP GET request to a specified endpoint using the CheckContext's fetch method. Use this to retrieve data from external services. ```typescript // GET request const data = await ctx.fetch('/endpoint'); ``` -------------------------------- ### Using useMediaQuery Hook Source: https://github.com/trycompai/comp/blob/main/packages/ui/README.md Import and utilize the `useMediaQuery` hook from the Trycompai UI library to implement responsive behavior in your components based on screen size. ```tsx import { useMediaQuery } from '@trycompai/ui/hooks'; export function ResponsiveComponent() { const isMobile = useMediaQuery('(max-width: 768px)'); return isMobile ? : ; } ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/trycompai/comp/blob/main/apps/portal/README.md Commands to start the Next.js development server using different package managers. Open http://localhost:3000 to view the application. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Debug E2E Tests Interactively Source: https://github.com/trycompai/comp/blob/main/apps/app/e2e/README.md Start an interactive debugging session for E2E tests. ```bash # Debug tests interactively bun run test:e2e:debug ``` -------------------------------- ### Badge Component with Variants Source: https://github.com/trycompai/comp/blob/main/apps/app/agents.md Example of using the Badge component with different visual variants. ```tsx // Badge variants: default, secondary, destructive, outline Active ``` -------------------------------- ### Verify ClamAV Service Status Source: https://github.com/trycompai/comp/blob/main/packages/docs/device-agent.mdx Check if the ClamAV antivirus daemon is installed and running on the system. ```bash systemctl status clamav-daemon ``` -------------------------------- ### Build the Project Source: https://github.com/trycompai/comp/blob/main/CONTRIBUTING.md Generate a production build of the project. Ensure a successful build before pushing code. ```bash bun run build ``` -------------------------------- ### GET /api/device-agent/my-organizations Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Retrieves a list of all organizations that the authenticated user belongs to, including their role within each organization. ```APIDOC ## GET /api/device-agent/my-organizations ### Description Returns all organizations the user belongs to. ### Method GET ### Endpoint /api/device-agent/my-organizations ### Response #### Success Response (200) - **organizations** (Array) - An array of organization objects. - **organizationId** (string) - The ID of the organization. - **organizationName** (string) - The name of the organization. - **organizationSlug** (string) - The slug of the organization. - **role** (string) - The user's role in the organization. ### Response Example { "organizations": [ { "organizationId": "org_123", "organizationName": "Example Corp", "organizationSlug": "example-corp", "role": "admin" } ] } ``` -------------------------------- ### Footer Socials Example Source: https://github.com/trycompai/comp/blob/main/packages/docs/essentials/settings.mdx Defines an object for social media accounts, mapping platform names to their URLs. ```json { "x": "https://x.com/mintlify", "website": "https://mintlify.com" } ``` -------------------------------- ### GET /api/device-agent/status Source: https://github.com/trycompai/comp/blob/main/packages/device-agent/SPEC.md Retrieves the status of device(s) and their compliance checks for the authenticated user. Can filter by a specific device or organization. ```APIDOC ## GET /api/device-agent/status ### Description Returns device(s) and their checks for the authenticated user. Can filter by a specific device or organization. ### Method GET ### Endpoint /api/device-agent/status ### Query Parameters - **deviceId** (string) - Optional - The ID of the specific device to retrieve. - **organizationId** (string) - Optional - The ID of the organization to filter devices by. ### Response #### Success Response (200) - **devices** (Array) - An array of Device objects if filtering by organization or no filter is applied. - **device** (Device) - A single Device object if a specific `deviceId` is provided. *Note: The structure of the `Device` object is not detailed in the source.* ``` -------------------------------- ### Run Postinstall Script Source: https://github.com/trycompai/comp/blob/main/packages/db/INTEGRATION_GUIDE.md Executes the postinstall script for the Prisma package, often used to resolve schema issues. ```bash bunx @trycompai/db postinstall ``` -------------------------------- ### Useful Database Management Commands Source: https://github.com/trycompai/comp/blob/main/README.md A collection of Bun commands for managing the database, including opening Prisma Studio, running migrations, and stopping/cleaning Docker containers. ```sh # Open Prisma Studio to view/edit data bun db:studio # Run database migrations bun db:migrate # Stop the database container bun docker:down # Remove the database container and volume bun docker:clean ``` -------------------------------- ### Get Organization Details Source: https://github.com/trycompai/comp/blob/main/packages/docs/api-reference/overview.mdx Retrieves details about the Comp AI organization. This is a foundational endpoint for many automation workflows. ```APIDOC ## GET /v1/organization ### Description Retrieves details about the Comp AI organization. ### Method GET ### Endpoint /v1/organization ### Request Example ```bash curl --request GET \ --url "https://api.trycomp.ai/v1/organization" \ --header "X-API-Key: $COMP_AI_API_KEY" ``` ### Response #### Success Response (200) - **field1** (type) - Description ```