### Start SourceCraft CLI Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md Run this command to initiate the SourceCraft CLI. It performs an update check and starts the interactive setup process on the first run. ```bash src ``` -------------------------------- ### Example: Get a Specific Go Package Version Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/go-get.md An example of using `go get` to fetch a specific version of a Go package from a Sourcegraph repository. ```bash go get sourcecraft.dev/project-golang-test/golang-lib@v1.0.0 ``` -------------------------------- ### SourceCraft CLI Welcome Message Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md The initial output displayed when starting the SourceCraft CLI for the first time, indicating the beginning of the setup process. ```bash Welcome to SourceCraft CLI! Let's get you set up. ``` -------------------------------- ### List Repositories in an Organization (Node.js) Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization/ListOrganizationRepositories.md Example using Node.js to list repositories for an organization. Ensure you have the 'axios' library installed. ```javascript const axios = require('axios'); const orgName = 'example-org'; const page = 1; const perPage = 10; const accessToken = 'YOUR_ACCESS_TOKEN'; axios.get(`https://sourcecraft.example.com/api/v1/orgs/${orgName}/repos`, { params: { page: page, per_page: perPage }, headers: { 'Authorization': `Bearer ${accessToken}` } }) .then(response => { console.log('Repositories:', response.data); }) .catch(error => { console.error('Error fetching repositories:', error); }); ``` -------------------------------- ### SourceCraft CLI Setup Completion Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md Output indicating successful configuration of authentication, git credential helper, and OpenCode installation. Confirms the CLI is ready for use. ```bash ✓ Authentication configured successfully! ✓ Git credential helper configured! Installing opencode... ✓ Found latest version: 1.3.13 Version 1.3.13 already installed ✓ Opencode installed successfully! ✓ Onboarding complete! You're ready to use SourceCraft CLI. ``` -------------------------------- ### Install and Check Java and Maven Versions Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/ci-cd.md Commands to install Maven and verify Java and Maven installations. Ensure these are run in your CI/CD environment. ```bash sudo apt install maven -y ``` ```bash java --version ``` ```bash mvn --version ``` -------------------------------- ### Webhook Configuration Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/concepts/webhooks.md A concrete example of a `.sourcecraft/webhooks.yaml` file demonstrating the configuration of multiple webhooks and their triggers. ```yaml webhooks: hooks: # list of webhooks - slug: wh_n8n # unique within the repository name: "n8n real" # random name description: "Triggers on main branch pushes" # random description url: "https://example.com/webhook/src-push" # webhook server URL auth_header: X-Src-Auth-Header # optional header for providing a signature key ssl_verification: true # SSL certificate validation for the webhook server when using HTTPS is enabled active: true # webhook is active - slug: wh_n8n_test name: "n8n test" description: "Triggers on main branch pushes" url: "https://example.com/webhook-test/src-push" auth_header: X-Src-Auth-Header ssl_verification: true active: false on: # webhook triggers push: # push to the repository - hooks: ["wh_n8n_test", "wh_n8n"] repository.push: # event in aggregate.event format - hooks: ["wh_n8n_test"] '*': # all events - hooks: ["wh_n8n"] ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/tutorials/sites.md Install project dependencies using npm ci and then build the project for local testing. Ensure Node.js version 18 or higher is installed. ```bash cd npm ci npm run build ``` -------------------------------- ### Install Git on macOS Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/tutorials/quickstart-git.md Installs Homebrew and then Git on macOS. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash brew update && \ brew install git ``` -------------------------------- ### Install AI Coding Assistant (OpenCode) Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md Interactive prompt to install OpenCode, an AI-powered coding assistant integrated with SourceCraft. Installation is recommended for enhanced coding capabilities. ```bash Install AI coding assistant (opencode)? A powerful AI-powered coding assistant integrated with SourceCraft. > Yes (Recommended) No ``` -------------------------------- ### MigrationSource Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization/ListOrganizationRepositories.md An example of the MigrationSource object structure, detailing its URL and domain. ```json { "url": "example", "domain": "example" } ``` -------------------------------- ### Issue Completed At Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Issues/ListRepositoryIssues.md Example of a date-time string for the completion timestamp. ```string 2025-01-01T00:00:00Z ``` -------------------------------- ### Artifact Dates Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/CICD/GetCubeArtifacts.md This example illustrates the date-time format for artifact registration, obtaining, and updating. ```json { "registered_at": "2025-01-01T00:00:00Z", "obtained_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-01T00:00:00Z" } ``` -------------------------------- ### InitSettings Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository/CreateRepositoryByID.md An example of the `init_settings` object, which allows configuration of initial repository settings such as the default branch, README creation, gitignore presets, and license. ```json { "default_branch": "example", "create_readme": true, "gitignore_presets": [ "example" ], "license_slug": "example", "src_yaml_template_slug": "example" } ``` -------------------------------- ### Example MCP Integration Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/work-with-mcp.md This snippet demonstrates a basic integration with an MCP server. Ensure the necessary libraries and configurations are in place before use. ```go package main import ( "fmt" "github.com/sourcecraftai/sourcecraft-go/pkg/mcp" ) func main() { // Initialize MCP client client, err := mcp.NewClient("ws://localhost:8080/mcp") if err != nil { panic(err) } defer client.Close() // Send a message response, err := client.Send("Hello, MCP!") if err != nil { panic(err) } fmt.Println("Received response:", response) } ``` -------------------------------- ### Full Merge Checks Response Body Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-PullRequest/GetMergeChecksByID.md This is a comprehensive example of the JSON response body for the Get Merge Checks by ID API. It includes all possible check types: code review, conflicts, CI workflows, and configuration validations. ```json { "code_review": { "status": "in_progress", "disabled": true, "total_approves": 0, "need_approves": 0, "rules": [ { "approves": 0, "need_approves": 0, "completed": true, "reviewers": [ {} ] } ] }, "conflicts": { "status": null, "created_at": "2025-01-01T00:00:00Z", "conflicts": [ { "conflict_type": "example", "path": "example", "message": "example" } ], "error": "example" }, "ci_workflows": [ { "status": "created", "disabled": true, "created_at": "2025-01-01T00:00:00Z", "run_id": "example", "run_slug": "example", "workflow_id": "example", "workflow_slug": "example" } ], "config_validations": [ { "status": null, "created_at": "2025-01-01T00:00:00Z", "file_path": "example", "error_message": "example" } ], "status": null } ``` -------------------------------- ### Basic Web Server Setup in C++ Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_includes/code-assistant/instruction-autocompletion.md This C++ snippet sets up the basic structure for a simple web server, including socket creation. Ensure necessary headers are included. ```cpp // simple web-server to work with sockets #include #include #include #include #include using namespace std; int main() { } ``` ```cpp ... int main() { //create socket int sockfd = socket(AF_INET, SOCK_STREAM, 0); } ``` -------------------------------- ### Get Run Details Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/CICD/RunWorkflowsByID.md Retrieves detailed information about a specific workflow run, including its status, start and end times, and associated artifacts. ```APIDOC ## GET /runs/{run_id} ### Description Retrieves detailed information about a specific workflow run, including its status, start and end times, and associated artifacts. ### Method GET ### Endpoint /runs/{run_id} ### Parameters #### Path Parameters - **run_id** (string) - Required - The unique identifier of the run to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the run. - **workflow_id** (string) - The ID of the workflow that was run. - **status** (string) - The current status of the run (e.g., "processing", "success", "failed"). - **created_at** (string) - The timestamp when the run was created. - **started_at** (string) - The timestamp when the run started. - **finished_at** (string) - The timestamp when the run finished. - **updated_at** (string) - The timestamp when the run was last updated. - **artifacts** (array) - A list of artifacts generated by the run. - **id** (string) - The unique identifier of the artifact. - **local_path** (string) - The local path of the artifact within the CI environment. - **status** (string) - The status of the artifact (e.g., "registered", "success"). - **dates** (object) - Timestamps related to the artifact. - **registered_at** (string) - The timestamp when the artifact was registered. - **obtained_at** (string) - The timestamp when the artifact was obtained. - **updated_at** (string) - The timestamp when the artifact was last updated. - **download_url** (string) - A temporary URL to download the artifact. #### Response Example { "id": "run-12345", "workflow_id": "your-workflow-id", "status": "success", "created_at": "2025-01-01T00:00:00Z", "started_at": "2025-01-01T00:00:00Z", "finished_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-01T00:00:00Z", "artifacts": [ { "id": "artifact-abc", "local_path": "path/to/artifact.log", "status": "success", "dates": { "registered_at": "2025-01-01T00:00:00Z", "obtained_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-01T00:00:00Z" }, "download_url": "http://example.com/download/artifact-abc" } ] } ``` -------------------------------- ### Restart Interactive Setup Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md Use the `src init` command to re-initiate the interactive setup process for the SourceCraft CLI if needed. ```bash src init ``` -------------------------------- ### Create Skill Directory and File Source: https://github.com/sourcecraft/documentation.git/blob/main/en/code-assistant/operations/agent/skills.md Demonstrates how to create a directory for a new skill and an empty SKILL.md file within it. ```bash # Example: skill for PDF processing mkdir -p ~/.codeassistant/skills/pdf-processing touch ~/.codeassistant/skills/pdf-processing/SKILL.md ``` -------------------------------- ### Create and Navigate to Project Directory Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/go-get.md Use these commands to create a new directory for your Go project and change into it. ```bash mkdir cd ``` -------------------------------- ### Workflow Configuration: Public Workflow Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/ci-cd-ref/workflows.md Example configuration for a public workflow, allowing broader access within an organization. This setup is for the configuration part. ```yaml workflows: my-public-workflow: shared: true tasks: - name: my-task cubes: - name: A script: - echo "This is a public workflow." ``` -------------------------------- ### Get User Issues Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/api-start.md This example demonstrates how to retrieve a list of user issues using the Sourcecraft REST API with a personal access token for authentication. ```APIDOC ## GET /me/issues ### Description Retrieves a list of issues associated with the authenticated user. ### Method GET ### Endpoint /me/issues ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash export PAT= curl \ --request GET \ --header "Authorization: Bearer $PAT" \ --url "https://api.sourcecraft.tech/me/issues" | jq ``` ### Response #### Success Response (200) - **issues** (array) - A list of issue objects. #### Response Example ```json [ { "id": "issue-id-1", "title": "Example Issue 1", "status": "open" }, { "id": "issue-id-2", "title": "Example Issue 2", "status": "closed" } ] ``` ``` -------------------------------- ### Setup Git Credential Helper Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-auth-setup-git.md Run this command to configure the git credential helper for SourceCraft. Use flags to customize environment, output, and repository selection. ```bash src auth setup-git [flags] ``` -------------------------------- ### Clone Self-Hosted Worker Repository Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_tutorials/dev/self-hosted-worker-sourcecraft.md Clone the example self-hosted worker repository to start your deployment. This repository contains scripts and configuration files for setting up the worker. ```bash git clone https://git@git.sourcecraft.dev/examples/self-hosted-worker.git cd self-hosted-worker ``` -------------------------------- ### List comments on a specific pull request Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-pr-list-comments.md To list comments for a particular pull request, provide its ID as an argument. For example, to get comments for PR 42. ```bash src pr list-comments 42 ``` -------------------------------- ### Launch OpenCode with SourceCraft Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-code.md Use this command to start OpenCode with the default SourceCraft configuration. ```bash src code ``` -------------------------------- ### Configuration Validation Check Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-PullRequest/GetMergeChecksByID.md This example illustrates the structure for configuration validation checks. It shows the status, creation time, file path, and any error messages encountered during validation. ```json [ { "status": "in_progress", "created_at": "2025-01-01T00:00:00Z", "file_path": "example", "error_message": "example" } ] ``` -------------------------------- ### Create Milestone Request Body Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-Milestones/CreateMilestone.md Example of the JSON payload required to create a new milestone. Includes fields like name, description, start date, and deadline. ```json { "id": "example", "name": "example", "slug": "example", "description": "example", "start_date": "2025-01-01T00:00:00Z", "deadline": "2025-01-01T00:00:00Z", "status": "open", "author": { "id": "example", "slug": "example" }, "updated_by": null, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-01T00:00:00Z" } ``` -------------------------------- ### Invitation Creation Operation Result Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/security/invite.md Example JSON response for a get invitation creation operation status request. It shows the status of the operation and details of created or failed invitations. ```json { "operation_id": "cq9gajzloslj********", "status_url": "operations/create-invites/id:cq9gajzloslj********", "status": "success", "created_at": "2026-01-23T07:42:03.062925Z", "modified_at": "2026-01-23T07:42:09.612256Z", "response": { "invites": [ { "id": "bpf65vedallc********", "email": "", "alias": "", "invite_link": "", "status": "pending", "subject": { "type": "invitee", "id": "ajeth710l8gi********" }, "created_at": "1970-01-01T00:00:00Z", "expires_at": "1970-01-01T00:00:00Z" }, { "id": "bpf4q13jhnod********", "email": "", "alias": "", "invite_link": "", "invitee": { "id": "01971bf5-6751-7eea-a07f-2e29********", "slug": "" }, "status": "pending", "subject": { "type": "invitee", "id": "ajehmssc34ob********" }, "created_at": "1970-01-01T00:00:00Z", "expires_at": "1970-01-01T00:00:00Z" }, { "id": "bpfrvnq2qd81********", "email": "", "alias": "", "invite_link": "https://sourcecraft.dev/me/accept-invite/9emq5q98ym4cJU********", "status": "pending", "subject": { "type": "invitee", "id": "ajebuh02o909********" }, "created_at": "2026-02-05T07:34:20.736642Z", "expires_at": "2026-02-06T07:34:20.673905Z" } ], "errors": [ { "invitee": { "email": "", "slug": "", "alias": "" }, "error_code": "InviteeHasAlreadyJoined", "message": "Invited user is already a member" } ] } } ``` -------------------------------- ### Example SSH Clone on Port 443 Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_includes/sourcecraft/clone-repo-ssh.md An example demonstrating how to clone the 'sourcecraft/sourcecraft.git' repository using SSH on port 443. ```bash git clone ssh://ssh.sourcecraft.dev:443/sourcecraft/sourcecraft.git ``` -------------------------------- ### Async VM Deletion Workflow Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_tutorials/dev/self-hosted-worker-sourcecraft.md This YAML snippet defines a CI/CD workflow that includes a task to asynchronously delete the VM after a primary task completes. Ensure the 'create-vm' workflow is executed beforehand, and note that workflows must be started manually. ```yaml test-task-and-delete-vm-async: runs_on: self-hosted tasks: - test-task - name: delete uses: delete-vm-async needs: [test-task] ``` -------------------------------- ### Self-Hosted Worker Deployment Tutorial Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/tutorials/self-hosted-worker-sourcecraft.md This snippet includes the content of the self-hosted worker deployment tutorial, covering the necessary steps and configurations. ```markdown --- title: Deploying a self-hosted {{ src-full-name }} worker on a {{ compute-name }} VM description: In this tutorial, you will deploy a self-hosted {{ src-full-name }} worker on a {{ compute-name }} VM. --- {% include [self-hosted-worker-sourcecraft](../../_tutorials/dev/self-hosted-worker-sourcecraft.md) %} ``` -------------------------------- ### Install Latest OpenCode Version Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-code-install.md Run this command to download and install the latest stable version of OpenCode. The binary will be placed in ~/.config/sourcecraft/bin/. ```bash src code install ``` -------------------------------- ### Install Sourcecraft CLI on macOS/Linux Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/cli-quickstart.md Installs the Sourcecraft CLI using a curl script. After installation, restart your terminal to apply changes. ```bash curl -fsSL https://{{ s3-dotnet-sdk-host }}/sourcecraft-cli/install.sh | sh ``` ```bash exec -l $SHELL ``` -------------------------------- ### Automatic Workflow Startup for Python Runtime Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_tutorials/serverless/ci-cd-sourcecraft-functions.md This example demonstrates how to automatically trigger a workflow for a specific runtime environment. For other runtimes, manual startup or editing the `on` section in `.sourcecraft/ci.yaml` is required. ```yaml on: push: - workflows: [deploy-python-function] filter: branches: ["master", "main"] ``` -------------------------------- ### Build Documentation Source: https://github.com/sourcecraft/documentation.git/blob/main/README.md Use this command to build the Markdown documentation sources into HTML static files. ```bash npm run build ``` -------------------------------- ### Issue Visibility Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Issues/ListRepositoryIssues.md Example of an issue visibility value. ```string public ``` -------------------------------- ### Issue Priority Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Issues/ListRepositoryIssues.md Example of an issue priority value. ```string trivial ``` -------------------------------- ### Example AGENTS.md content Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/concepts/agentsmd.md A sample configuration file demonstrating project overview, technology stack, coding standards, and operational constraints for an AI agent. ```markdown Telegram bot for personal reminders and todo tasks. The bot saves user messages and sends notifications at the specified date and time. ## Technology stack * Python 3.12 * python-dotenv * Aiogram 3.x (Telegram Bot API) * SQLite + aiosqlite (task and reminder storage) * AsyncIOScheduler (task scheduler) ## Code style * Each handler is a separate file located in `bot/handlers/` * Do not write functions longer than 40 lines * Add tests for all new functions * Add comments for complex logic * Do not use `time.sleep()`, only `await asyncio.sleep()` ## Do not ever * Propose migration to other databases * Propose migration to other APIs ## PR commands * Build project: `/build` * Run tests: `/test` * Check code style: `/lint` ``` -------------------------------- ### Dependency Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/CICD/GetWorkflow.md Example JSON object representing a dependency. ```json { "name": "example" } ``` -------------------------------- ### Visual Studio Code Build Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/code-assistant/qa.md This example shows a typical build string for Visual Studio Code, useful for identifying the version and build details when troubleshooting. ```text Version: 1.92.2 (system setup) Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Date: 2024-08-14T17:29:30.058Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045 ``` -------------------------------- ### OccupiedWorkplaceUserInfo Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/CodeAssistWorkplaces/ListOccupiedCodeAssistWorkplaces.md An example of the OccupiedWorkplaceUserInfo structure, which includes a UserProfile. ```json { "user": { "id": "example", "display_name": "example", "username": "example", "bio": "example", "location": { "country": "example", "city": "example" }, "timezone": { "iana_timezone": "example" }, "workplace": { "company": "example", "position": "example" }, "links": [ { "link": "example", "type": "default" } ], "status": { "message": "example", "emoji": "example" }, "avatar": { "url": "example" }, "background_image": null, "visibility": "private" } } ``` -------------------------------- ### Example CI/CD Process with GitHub Actions Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/operations/gh-actions.md This example demonstrates a complete `.sourcecraft/ci.yaml` configuration that uses the 'action' cube to trigger a GitHub Actions workflow. It includes optional parameters for specifying the event, branch, and workflow file. ```yaml ci: - cube: action with: event: "push" branch: "main" workflow_file: ".github/workflows/main.yml" ``` -------------------------------- ### List Repositories in an Organization (Python) Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization/ListOrganizationRepositories.md Python example demonstrating how to list repositories for an organization using the 'requests' library. ```python import requests org_name = 'example-org' page = 1 per_page = 10 access_token = 'YOUR_ACCESS_TOKEN' url = f"https://sourcecraft.example.com/api/v1/orgs/{org_name}/repos" headers = { 'Authorization': f'Bearer {access_token}' } params = { 'page': page, 'per_page': per_page } response = requests.get(url, headers=headers, params=params) if response.status_code == 200: print("Repositories:", response.json()) else: print(f"Error fetching repositories: {response.status_code} - {response.text}") ``` -------------------------------- ### CodeReviewCheck Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-PullRequest/GetMergeChecks.md An example of the CodeReviewCheck object, illustrating its status and associated rules. ```json [ { "approves": 0, "need_approves": 0, "completed": true, "reviewers": [ { "id": "example", "slug": "example" } ] } ] ``` -------------------------------- ### Example: Clone SourceCraft Documentation Repository Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_includes/sourcecraft/clone-repo-workflow.md This is an example of cloning the SourceCraft documentation repository using the HTTPS protocol. ```bash git clone https://git@git.sourcecraft.dev/sourcecraft/documentation.git ``` -------------------------------- ### ReviewRule Object Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-PullRequest/GetMergeChecks.md A complete example of the ReviewRule object, showing all its properties. ```json { "approves": 0, "need_approves": 0, "completed": true, "reviewers": [ { "id": "example", "slug": "example" } ] } ``` -------------------------------- ### Configuration with Environment Variables Source: https://github.com/sourcecraft/documentation.git/blob/main/en/sourcecraft/ci-cd-ref/env.md Illustrates how to use environment variables within a CI/CD configuration file. This example shows a common pattern for injecting dynamic values into your build or deployment process. ```yaml version: "3.0" jobs: build: docker: image: golang:1.18 steps: - name: "Build" run: "go build -o app" - name: "Test" run: "go test" config: vars: # Define a variable that will be available in the pipeline. MY_VARIABLE: "some_value" # Use the variable in a job. jobs: build: docker: image: alpine:latest steps: - name: "Print Variable" run: "echo $MY_VARIABLE" ``` -------------------------------- ### Tag Object Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository/ListTagsByID.md Example of a Tag object, representing a tag in a repository. ```json { "name": "example", "commit": { "hash": "example", "message": "example", "author": { "name": "example", "email": "example", "date": "2025-01-01T00:00:00Z" }, "committer": null, "tree_hash": "example", "parent_hashes": [ "example" ], "merge_tag": "example", "file_changes": { "added": [ "example" ], "modified": [ "example" ], "removed": [ "example" ] }, "author_user": { "id": "example", "slug": "example" }, "committer_user": null, "signature_verification": { "verified": true, "reason": "SIGNATURE_VERIFICATION_REASON_VALID", "verified_at": "2025-01-01T00:00:00Z" } }, "target": "example", "message": "example", "signature_verification": null, "author": null, "author_user": null } ``` -------------------------------- ### Handle Unknown Host Warning Source: https://github.com/sourcecraft/documentation.git/blob/main/en/_qa/sourcecraft/sourcecraft-security.md When connecting to a new host for the first time, you may encounter an unknown host warning. Type 'yes' and press Enter to accept the host key and add it to your `known_hosts` file. ```text The authenticity of host '[ssh.sourcecraft.dev]:443 ([]:443)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbp********. This host key is known by the following other names/addresses: ~/.ssh/known_hosts:32: sourcecraft.dev Are you sure you want to continue connecting (yes/no/[fingerprint])? ``` -------------------------------- ### Example SubjectRole Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization-or-Roles/AddOrganizationRolesByID.md An example of a SubjectRole object, specifying a role and the subject to whom it applies. ```json { "role": "viewer", "subject": { "type": "user", "id": "example" } } ``` -------------------------------- ### UserProfile Bio Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/CodeAssistWorkplaces/ListOccupiedCodeAssistWorkplaces.md Example of the bio field within the UserProfile entity. ```string example ``` -------------------------------- ### Install Context7 MCP Server on Windows Source: https://github.com/sourcecraft/documentation.git/blob/main/en/code-assistant/operations/agent/mcp/recommended-mcp-servers.md Configure the Context7 MCP server globally on Windows systems. This method uses 'cmd' to execute the installation command, specifying the type as 'stdio'. ```json { "mcpServers": { "context7": { "type": "stdio", "command": "cmd", "args": ["/c", "npx", "-y", "@upstash/context7-mcp@latest"] } } } ``` -------------------------------- ### Enable Zsh Completion (Initial Setup) Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-completion.md Before loading Zsh completions, ensure shell completion is enabled by adding `autoload -U compinit; compinit` to your `~/.zshrc` file. ```zsh echo "autoload -U compinit; compinit" >> ~/.zshrc ``` -------------------------------- ### AutoAssignResponse.ReviewerDelta Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository-or-PullRequest-or-Reviewers/AutoAssign.md A detailed example of the 'AutoAssignResponse.ReviewerDelta' object, specifying the action and the user involved. ```json { "action": "add", "user": { "id": "example", "slug": "example" } } ``` -------------------------------- ### SignatureVerification Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Repository/ListBranches.md An example of a SignatureVerification object, showing verification status, reason, and timestamp. ```json { "verified": true, "reason": "SIGNATURE_VERIFICATION_REASON_VALID", "verified_at": "2025-01-01T00:00:00Z" } ``` -------------------------------- ### Example MCP Interaction Source: https://github.com/sourcecraft/documentation.git/blob/main/en/code-assistant/operations/agent/mcp/work-with-mcp.md This snippet demonstrates a typical interaction with an MCP server for repository tasks. Ensure the MCP server is configured and accessible. ```shell git clone git@github.com:example/repo.git cd repo git commit -m "Initial commit" git push ``` -------------------------------- ### Launch OpenCode with Auto-Install Source: https://github.com/sourcecraft/documentation.git/blob/main/en/cli-ref/src-code.md This command launches OpenCode and automatically installs it if it's not already present. It's particularly useful in autoinstall environments. ```bash src code --cde ``` -------------------------------- ### InviteError Example Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization-or-Invites/CreateOrganizationInvitesByID.md This JSON structure represents an example of an error encountered for a specific invite. ```json [ { "invitee": { "email": "example", "slug": "example", "alias": "example" }, "error_code": "example", "message": "example" } ] ``` -------------------------------- ### Example OrgSubjectRole in Response Source: https://github.com/sourcecraft/documentation.git/blob/main/en/api-ref/Organization-or-Roles/ListOrganizationRolesByID.md This is an example of an organization-level role assignment within the response body. ```json [ { "role": "org_owner", "subject": { "type": "user", "id": "example" } } ] ```