### Development setup commands Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/CONTRIBUTING.md Clone the repository, install dependencies, build, and run tests. Use these commands to set up the development environment. ```bash git clone https://github.com/2ndbrainlabs-ai/synapse-cli-ts.git cd synapse-cli npm install npm run build npm test ``` -------------------------------- ### Copy-paste quickstarts for multiple providers Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Quickstart commands for Anthropic, Groq, OpenAI, xAI (Grok), OpenRouter, and Ollama. Each sets the required environment variable, optionally selects the model, and runs a local build. Ollama requires no key. ```bash # Anthropic (default — nothing to configure) export ANTHROPIC_API_KEY=sk-ant-… synapse build --local # Groq export GROQ_API_KEY=gsk_… synapse model set groq synapse build --local # OpenAI export OPENAI_API_KEY=sk-… synapse model set openai synapse build --local # xAI (Grok) export XAI_API_KEY=xai-… synapse model set grok synapse build --local # OpenRouter export OPENROUTER_API_KEY=sk-or-… synapse model set openrouter synapse build --local # Ollama — no key needed ollama pull qwen3-coder:30b synapse model set ollama synapse build --local ``` -------------------------------- ### Setup environment and build for local-mode testing Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/docs/LOCAL_MODE_VERIFICATION.md Sets the Anthropic API key (must be a real key, not a test key), builds the project, and creates a shell alias for the built CLI. Run these commands before starting the verification checks. ```bash export ANTHROPIC_API_KEY=sk-ant-… # a real key, not test-… npm run build alias synapse=/absolute/path/to/dist/index.js ``` -------------------------------- ### Clone, install, and run development commands Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Sets up the repository for local development. Use `npm run dev -- ` to run against source, `npm run build` to produce dist/, `npm test` for the vitest suite, and `npm run typecheck` for type checking. ```bash git clone https://github.com/2ndbrainlabs-ai/synapse-cli-ts.git cd synapse-cli-ts npm install npm run dev -- # run against source npm run build # produce dist/ npm test # vitest suite npm run typecheck ``` -------------------------------- ### Initialize and build a project with Synapse CLI Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md One-time setup: `synapse init` prompts for your API key. `synapse build` scans the code and asks whether to use Auto or Custom mode; the prompt can be skipped with `--auto` or `--custom`. Copy the printed JSON snippet into your MCP client config. ```bash cd my-project synapse init # one-time: paste your API key synapse build # scans the code, then asks: Auto or Custom? ``` -------------------------------- ### Install Synapse CLI globally with npm Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Installs the Synapse CLI as a global npm package. Requires Node.js 18+; verify the installation with `synapse --version`. ```bash npm install -g @2ndbrainlabs-ai/synapse-cli ``` -------------------------------- ### Example LLM configuration block in .synapse/config.json Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Shows a custom provider configuration with model assignments, headers, and tool_choice disabled. The block is schema-validated strictly; unknown keys are rejected with a warning and fallback to the next source. ```jsonc { "llm": { "provider": "custom", "base_url": "http://gpu.internal:8000/v1", "models": { "triage": "qwen3-4b", "generate": "qwen3-coder-30b", "verify": "qwen3-coder-30b", "fallback_generate": "qwen3-4b" }, "headers": { "X-Route": "a100" }, "tool_choice": false, "api_key_prefix": "sk-in", "api_key_encrypted": "gAAAAAB…" } } ``` -------------------------------- ### Google Vertex AI setup with Application Default Credentials Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Configure Vertex AI using Google Application Default Credentials. The account needs roles/aiplatform.user. Claude models use Vertex's Anthropic API; other models use the OpenAI-compatible endpoint. Location defaults to global. ```bash gcloud auth application-default login synapse model set vertex --project my-gcp-project # Claude, global location synapse model set vertex --project my-gcp-project --model gemini-2.5-pro synapse build --local ``` -------------------------------- ### Amazon Bedrock setup with AWS SSO Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Configure Bedrock using AWS credentials from the standard chain. Requires Node 20+. Defaults to Claude Sonnet 4.5 (generate) and Haiku 4.5 (triage) via cross-region inference profiles. Enable model access in the Bedrock console first. ```bash aws sso login --profile work synapse model set bedrock --region us-east-1 --profile work synapse build --local ``` -------------------------------- ### Provide API key via --llm-api-key flag for a single run Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Use this flag to supply an API key for one build without storing it anywhere. The provider is specified with --provider. ```bash synapse build --local --llm-api-key sk-… --provider openai ``` -------------------------------- ### Manage local provider with synapse model Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Shows commands to inspect, list, set, and reset the provider used for local builds. Provider selection applies only to local mode; hosted builds always use the Synapse service. ```bash synapse model # what a local build would use right now synapse model list # every provider, its default model, key status synapse model set groq # switch (keeps that provider's defaults) synapse model reset # back to Anthropic ``` -------------------------------- ### One-off Vertex build without saving Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Run a single build with Vertex without storing any configuration. Specify project and region via flags. ```bash synapse build --local --provider vertex --llm-project my-proj --llm-region us-east5 ``` -------------------------------- ### Run local build with Anthropic API key Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Sets the ANTHROPIC_API_KEY environment variable and runs a local build with the --local flag. This skips the hosted Synapse service and uses your own inference provider. --local is per-invocation and does not require synapse init. ```bash export ANTHROPIC_API_KEY=sk-ant-… cd my-project synapse build --local # generates locally on your own key ``` -------------------------------- ### Run hosted and local builds for regression corpus Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/docs/LOCAL_MODE_VERIFICATION.md For each of the 5 test repos, run the hosted build and the local build, saving each output. Then diff the tool names and schemas; both files must pass Python AST parsing. Small prose differences in descriptions are acceptable. ```bash synapse build # hosted, save output as hosted_mcp_server.py synapse build --local # local, save as local_mcp_server.py ``` -------------------------------- ### Force a specific version with Release-As footer Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/docs/RELEASING.md Add a `Release-As` footer to a commit on `main` (e.g., in the squash commit body of a PR) to force the next release PR to propose that version. ```text chore: release 0.2.0 Release-As: 0.2.0 ``` -------------------------------- ### Run synapse build in Custom mode with a query Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Uses Custom mode to compose internal functions into one MCP tool, describing the desired tool with `--query`. Custom mode currently reads Python only. ```bash synapse build --custom --query "Expose user auth and profile lookup as one MCP tool" ``` -------------------------------- ### Select endpoints for Auto mode in scripts and CI Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md In non-interactive environments (CI, pipes, `--yes`), use these flags to select endpoints; each flag implies `--auto`. Without a terminal and without either flag, the build stops with an error instead of exposing nothing. ```bash synapse build --auto --all-endpoints # every detected endpoint ``` ```bash synapse build --auto --endpoints "GET /patients,POST /patients" # by method and path ``` ```bash synapse build --auto --endpoints "/patients,get_patient_by_id" # by path or tool name ``` -------------------------------- ### Pin models per stage with synapse model set Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Shows how to pin different models for the generate and triage stages, or set a single model for all stages with --model. Model ids are not validated against a built-in list; any id your provider accepts works. ```bash synapse model set groq --generate "openai/gpt-oss-120b" --triage "llama-3.1-8b-instant" synapse model set openai --model gpt-5 # one --model pins every stage ``` -------------------------------- ### Store API key encrypted with --save-key Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Explicitly opt in to storing the key encrypted for the given provider. Nothing is written unless this flag is used. ```bash synapse model set groq --save-key gsk_… ``` -------------------------------- ### Run CLI from source with npm run dev Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/CONTRIBUTING.md Run the CLI against source instead of the compiled bundle. Use `npm run dev -- ` to execute a command. ```bash npm run dev -- ``` -------------------------------- ### Pass CI locally before pushing Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/CONTRIBUTING.md Run lint, typecheck, and tests to ensure the code passes CI locally before pushing changes. ```bash npm run lint npm run typecheck npm test ``` -------------------------------- ### Set a custom inference endpoint with synapse model set custom Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Configures a custom OpenAI-compatible endpoint (e.g., vLLM, TGI, LM Studio, llama.cpp, SGLang, internal gateway, or GPU cluster). The `--header` flag is repeatable. A key is optional; if supplied via `SYNAPSE_LLM_API_KEY`, `--llm-api-key`, or `--save-key`, it is sent as `Authorization: Bearer `. ```bash synapse model set custom \ --base-url http://gpu.internal:8000/v1 \ --model qwen3-coder-30b \ --header "X-Route: a100" # repeatable ``` -------------------------------- ### Synapse model output showing resolved API key source Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/README.md Output from `synapse model` that reports the resolved key and its origin. `keySource` can be `flag`, `env `, `stored`, or `(not set)`. If a required key is missing, Synapse names the variable to set and links the provider's key page. ```text Provider Groq (project) API key gsk_t*************** (env GROQ_API_KEY) ``` -------------------------------- ### Override commit messages with BEGIN_COMMIT_OVERRIDE block Source: https://github.com/2ndbrainlabs-ai/synapse-cli-ts/blob/main/docs/RELEASING.md Add an override block to the body of a squash-merged PR to rewrite how a merged commit is recorded. Overrides are read only from squash-merged PRs; they have no effect for merge commits or rebase merges. ```text BEGIN_COMMIT_OVERRIDE fix(cli): correct message for one entry feat(api): another entry from the same PR END_COMMIT_OVERRIDE ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.