| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Thank you for your interest in contributing to Sim! Our goal is to provide developers with a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. We welcome contributions in all forms—from bug fixes and design improvements to brand-new features.
Project Overview: Sim is a Turborepo monorepo with two deployable apps and a set of shared packages:
- apps/sim/ — the main Next.js application (App Router, ReactFlow, Zustand, Shadcn, Tailwind CSS).
- apps/realtime/ — a small Bun + Socket.IO server that powers the collaborative canvas. Shares DB and Better Auth secrets with apps/sim via @sim/* packages.
- apps/docs/ — Fumadocs-based documentation site.
- packages/ — shared workspace packages (@sim/db, @sim/auth, @sim/audit, @sim/workflow-types, @sim/workflow-persistence, @sim/platform-authz, @sim/realtime-protocol, @sim/security, @sim/logger, @sim/utils, @sim/testing, @sim/tsconfig).
Strict one-way dependency flow: apps/* → packages/*. Packages never import from apps. Please ensure your contributions follow this and our best practices for clarity, maintainability, and consistency.
We strive to keep our workflow as simple as possible. To contribute:
Fork the Repository Click the Fork button on GitHub to create your own copy of the project.
Clone Your Fork
git clone https://github.com/<your-username>/sim.git
cd simCreate a Feature Branch Create a new branch with a descriptive name:
git checkout -b feat/your-feature-nameUse a clear naming convention to indicate the type of work (e.g., feat/, fix/, docs/).
Make Your Changes Ensure your changes are small, focused, and adhere to our coding guidelines.
Commit Your Changes Write clear, descriptive commit messages that follow the Conventional Commits specification. This allows us to maintain a coherent project history and generate changelogs automatically. For example:
Push Your Branch
git push origin feat/your-feature-nameCreate a Pull Request Open a pull request against the staging branch on GitHub. Please provide a clear description of the changes and reference any relevant issues (e.g., fixes #123).
If you discover a bug or have a feature request, please open an issue in our GitHub repository. When opening an issue, ensure you:
Note: If you're uncertain which label to use, mention it in your issue description and we'll help categorize it.
Before creating a pull request:
Our maintainers will review your pull request and provide feedback. We aim to make the review process as smooth and timely as possible.
We follow the Conventional Commits standard. Your commit messages should have the following format:
<type>[optional scope]: <description>
Examples:
Using clear and consistent commit messages makes it easier for everyone to understand the project history and aids in automating changelog generation.
To set up your local development environment:
The easiest way to run Sim locally is using our NPM package:
npx simstudioAfter running this command, open http://localhost:3000/ in your browser.
# Clone the repository
git clone https://github.com/<your-username>/sim.git
cd sim
# Generate the required secrets. The stack refuses to start without them
# rather than booting with empty values.
cat > .env << EOF
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
CRON_SECRET=$(openssl rand -hex 32)
EOF
# Start Sim
docker compose -f docker-compose.prod.yml up -dAccess the application at http://localhost:3000/
To use local models with Sim:
Install Ollama and pull models:
# Install Ollama (if not already installed)
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a model (e.g., gemma3:4b)
ollama pull gemma3:4bStart Sim with local model support:
# With NVIDIA GPU support
docker compose --profile local-gpu -f docker-compose.ollama.yml up -d
# Without GPU (CPU only)
docker compose --profile local-cpu -f docker-compose.ollama.yml up -d
# If hosting on a server, update the environment variables in the docker-compose.prod.yml file
# to include the server's public IP then start again (OLLAMA_URL to i.e. http://1.1.1.1:11434)
docker compose -f docker-compose.prod.yml up -dDev Containers provide a consistent and easy-to-use development environment:
Prerequisites:
Setup Steps:
Clone the repository:
git clone https://github.com/<your-username>/sim.git
cd simOpen the project in VS Code/Cursor.
When prompted, click "Reopen in Container" (or press F1 and select "Remote-Containers: Reopen in Container").
Wait for the container to build and initialize.
Start Developing:
GitHub Codespaces:
If you prefer not to use Docker or Dev Containers. All commands run from the repository root unless explicitly noted.
Clone and Install:
git clone https://github.com/<your-username>/sim.git
cd sim
bun installBun workspaces handle dependency resolution for all apps and packages from the root bun install.
Set Up Environment Files:
We use per-app .env files (the Turborepo-canonical pattern), not a single root .env. Three files are needed for local dev:
# Main app — large, app-specific (OAuth secrets, LLM keys, Stripe, etc.)
cp apps/sim/.env.example apps/sim/.env
# Realtime server — small, only the values shared with the main app
cp apps/realtime/.env.example apps/realtime/.env
# DB tooling (drizzle-kit, db:migrate)
cp packages/db/.env.example packages/db/.envAt minimum, each .env needs DATABASE_URL. apps/sim/.env and apps/realtime/.env additionally need matching values for BETTER_AUTH_URL, BETTER_AUTH_SECRET, INTERNAL_API_SECRET, and NEXT_PUBLIC_APP_URL. apps/sim/.env also needs ENCRYPTION_KEY and API_ENCRYPTION_KEY. Generate any 32-char secrets with openssl rand -hex 32.
The same BETTER_AUTH_SECRET, INTERNAL_API_SECRET, and DATABASE_URL must appear in both apps/sim/.env and apps/realtime/.env so the two services share auth and DB. After editing apps/sim/.env, you can mirror the shared subset into the realtime env in one shot:
grep -E '^(DATABASE_URL|BETTER_AUTH_URL|BETTER_AUTH_SECRET|INTERNAL_API_SECRET|NEXT_PUBLIC_APP_URL|REDIS_URL)=' apps/sim/.env > apps/realtime/.env
grep -E '^DATABASE_URL=' apps/sim/.env > packages/db/.envRun Database Migrations:
Migrations live in packages/db/migrations/. Run them via the dedicated workspace script:
cd packages/db && bun run db:migrate && cd ../..For ad-hoc schema iteration during development you can also use bun run db:push from packages/db, but db:migrate is the canonical command for both local and CI/CD setups.
Run the Development Servers:
bun run dev:fullThis launches both apps with coloured prefixes:
Or run them separately:
bun run dev # Next.js app only
bun run dev:sockets # realtime server onlyMake Your Changes and Test Locally.
Before opening a PR, run the same checks CI runs:
bun run type-check # TypeScript across every workspace
bun run lint:check # Biome lint across every workspace
bun run test # Setup CLI Bun tests, then Vitest across every workspaceWhen working on email templates, you can preview them using a local email preview server:
Run the Email Preview Server:
cd apps/sim && bun run email:devAccess the Preview:
Templates Location:
Sim is built in a modular fashion where blocks and tools extend the platform's functionality. To maintain consistency and quality, please follow the guidelines below when adding a new block or tool.
Use the skill guides for step-by-step recipes. The repository ships opinionated, end-to-end guides under .agents/skills/ that cover the exact file layout, conventions, registry wiring, and gotchas for each kind of contribution. Read the relevant SKILL.md before you start writing code:
Adding… Read A new integration end-to-end (tools + block + icon + optional triggers + all registrations) .agents/skills/add-integration/SKILL.md Just a block (or aligning an existing block with its tools) .agents/skills/add-block/SKILL.md Just tool configs for a service .agents/skills/add-tools/SKILL.md A webhook trigger for a service .agents/skills/add-trigger/SKILL.md A knowledge-base connector (sync docs from an external source) .agents/skills/add-connector/SKILL.md The shorter overview below is a high-level reference; the SKILL.md files are the authoritative source of truth and stay in sync with the codebase.
Skills have one source and one generated compatibility projection. Edit only the canonical .agents/skills/<name>/SKILL.md. Cursor discovers that directory directly; Claude uses the generated .claude/skills/<name> symlink. After changing a canonical skill, run bun run skills:sync (the pre-commit hook does this automatically when a SKILL.md is staged). CI runs bun run check:skills and fails if a Claude symlink is stale or a deprecated .claude/commands/<name>.md or .cursor/commands/<name>.md projection remains. Canonical frontmatter is name, description, and optional argument-hint.
In addition, you will need to update the registries:
Create a New File: Create a file for your block named after the provider (e.g., pinecone.ts) in the apps/sim/blocks/blocks/ directory.
Create a New Icon: Create a new icon for your block in apps/sim/components/icons.tsx. The icon should follow the same naming convention as the block (e.g., PineconeIcon).
Define the Block Configuration: Your block should export a constant of type BlockConfig. For example:
// apps/sim/blocks/blocks/pinecone.ts
import { PineconeIcon } from '@/components/icons'
import type { BlockConfig } from '@/blocks/types'
import type { PineconeResponse } from '@/tools/pinecone/types'
export const PineconeBlock: BlockConfig<PineconeResponse> = {
type: 'pinecone',
name: 'Pinecone',
description: 'Use Pinecone vector database',
longDescription: 'A more detailed description of what this block does and how to use it.',
category: 'tools',
bgColor: '#123456',
icon: PineconeIcon,
subBlocks: [
{
id: 'operation',
title: 'Operation',
type: 'dropdown',
required: true,
options: [
{ label: 'Generate Embeddings', id: 'generate' },
{ label: 'Search Text', id: 'search_text' },
],
value: () => 'generate',
},
{
id: 'apiKey',
title: 'API Key',
type: 'short-input',
placeholder: 'Your Pinecone API key',
password: true,
required: true,
},
],
tools: {
access: ['pinecone_generate_embeddings', 'pinecone_search_text'],
config: {
tool: (params: Record<string, any>) => {
switch (params.operation) {
case 'generate':
return 'pinecone_generate_embeddings'
case 'search_text':
return 'pinecone_search_text'
default:
throw new Error('Invalid operation selected')
}
},
},
},
inputs: {
operation: { type: 'string', description: 'Operation to perform' },
apiKey: { type: 'string', description: 'Pinecone API key' },
searchQuery: { type: 'string', description: 'Search query text' },
topK: { type: 'string', description: 'Number of results to return' },
},
outputs: {
matches: { type: 'any', description: 'Search results or generated embeddings' },
data: { type: 'any', description: 'Response data from Pinecone' },
usage: { type: 'any', description: 'API usage statistics' },
},
}Register Your Block: Add your block to the blocks registry (apps/sim/blocks/registry.ts):
// apps/sim/blocks/registry.ts
import { PineconeBlock } from '@/blocks/blocks/pinecone'
// Registry of all available blocks
export const registry: Record<string, BlockConfig> = {
// ... existing blocks
pinecone: PineconeBlock,
}The block will be automatically available to the application through the registry.
Test Your Block: Ensure that the block displays correctly in the UI and that its functionality works as expected.
Create a New Directory: Create a directory under apps/sim/tools/ with the same name as the provider (e.g., apps/sim/tools/pinecone).
Create Tool Files: Create separate files for each tool functionality with descriptive names (e.g., fetch.ts, generate_embeddings.ts, search_text.ts) in your tool directory.
Create a Types File: Create a types.ts file in your tool directory to define and export all types related to your tools.
Create an Index File: Create an index.ts file in your tool directory that imports and exports all tools:
// apps/sim/tools/pinecone/index.ts
import { fetchTool } from './fetch'
import { generateEmbeddingsTool } from './generate_embeddings'
import { searchTextTool } from './search_text'
export { fetchTool, generateEmbeddingsTool, searchTextTool }Define the Tool Configuration: Your tool should export a constant with a naming convention of {toolName}Tool. The tool ID should follow the format {provider}_{tool_name}. For example:
// apps/sim/tools/pinecone/fetch.ts
import { ToolConfig, ToolResponse } from '@/tools/types'
import { PineconeParams, PineconeResponse } from '@/tools/pinecone/types'
export const fetchTool: ToolConfig<PineconeParams, PineconeResponse> = {
id: 'pinecone_fetch', // Follow the {provider}_{tool_name} format
name: 'Pinecone Fetch',
description: 'Fetch vectors from Pinecone database',
version: '1.0.0',
// OAuth configuration (if applicable)
provider: 'pinecone', // ID of the OAuth provider
params: {
parameterName: {
type: 'string',
required: true,
visibility: 'user-or-llm', // Controls parameter visibility
description: 'Description of the parameter',
},
optionalParam: {
type: 'string',
required: false,
visibility: 'user-only',
description: 'Optional parameter only user can set',
},
},
request: {
// Request configuration
},
transformResponse: async (response: Response) => {
// Transform response
},
}Register Your Tool: Update the tools registry in apps/sim/tools/index.ts to include your new tool:
// apps/sim/tools/index.ts
import { fetchTool, generateEmbeddingsTool, searchTextTool } from '@/tools/pinecone'
// ... other imports
export const tools: Record<string, ToolConfig> = {
// ... existing tools
pinecone_fetch: fetchTool,
pinecone_generate_embeddings: generateEmbeddingsTool,
pinecone_search_text: searchTextTool,
}Test Your Tool: Ensure that your tool functions correctly by making test requests and verifying the responses.
Generate Documentation: Run the documentation generator (from apps/sim) to create docs for your new tool:
cd apps/sim && bun run generate-docsMaintaining consistent naming across the codebase is critical for auto-generation of tools and documentation. Follow these naming guidelines:
Sim implements a sophisticated parameter visibility system that controls how parameters are exposed to users and LLMs in agent workflows. Each parameter can have one of four visibility levels:
| Visibility | User Sees | LLM Sees | How It Gets Set |
|---|---|---|---|
| user-only | ✅ Yes | ❌ No | User provides in UI |
| user-or-llm | ✅ Yes | ✅ Yes | User provides OR LLM generates |
| llm-only | ❌ No | ✅ Yes | LLM generates only |
| hidden | ❌ No | ❌ No | Application injects at runtime |
params: {
query: {
type: 'string',
required: true,
visibility: 'user-or-llm', // User can provide or LLM can generate
description: 'Search query to execute',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only', // Only user provides this
description: 'API key for authentication',
},
internalId: {
type: 'string',
required: false,
visibility: 'hidden', // System provides this at runtime
description: 'Internal tracking identifier',
},
}This visibility system ensures clean user interfaces while maintaining full flexibility for LLM-driven workflows.
Happy coding!
This project is licensed under the Apache License 2.0. By contributing, you agree that your contributions will be licensed under the Apache License 2.0 as well.
By contributing to this repository, you agree that your contributions are provided under the terms of the Apache License Version 2.0, as included in the LICENSE file of this repository.
In addition, by submitting your contributions, you grant Sim, Inc. ("The Licensor") a perpetual, irrevocable, worldwide, royalty-free, sublicensable right and license to:
You represent and warrant that you have the legal authority to grant these rights and that your contributions are original or you have sufficient rights to submit them under these terms.
If you do not agree with these terms, you must not contribute your work to this repository.
Thank you for taking the time to contribute to Sim. We truly appreciate your efforts and look forward to collaborating with you!
| Back | FazBrowse Home | New Git URL |