### Start Web Server Source: https://github.com/runmedev/runme/blob/main/examples/web/README.md Start a Python HTTP server on port 9000 to serve the files. Access the example by navigating to http://localhost:9000 in your browser. ```bash python -m http.server 9000 ``` -------------------------------- ### Install runme with Go Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/simple.md Install runme using 'go install' if you have Go developer tools installed. ```sh $ go install github.com/runmedev/runme@latest ``` -------------------------------- ### Install Runme with Go Source: https://github.com/runmedev/runme/blob/main/README.md Install Runme using the 'go install' command for users with Go developer tools set up. ```sh $ go install github.com/runmedev/runme/v3@main ``` -------------------------------- ### Install Global Package with Yarn Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/doublecode.md Example of installing a global package using Yarn. This snippet requires Yarn to be installed and configured in your environment. ```shell yarn global add webdriverio ``` -------------------------------- ### Install Deno with Installer Script Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Installs Deno using a curl script, compatible with macOS and Linux. This is an alternative to Homebrew. ```sh # macOS or Linux curl -fsSL https://deno.land/x/install/install.sh | sh ``` -------------------------------- ### Install genqlient for GraphQL Client Generation Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Installs the genqlient tool, required for `go generate` to work with GraphQL clients. ```sh go install github.com/Khan/genqlient ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/runmedev/runme/blob/main/examples/web/index.html Install development dependencies using 'brew'. Ensure you have Homebrew installed. ```shell brew install dev dependencies ``` -------------------------------- ### Install deployctl Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Installs the `deployctl` command-line tool for Deno deployments. Requires read, write, environment, network, and run permissions. ```sh deno install \ --allow-read --allow-write \ --allow-env --allow-net --allow-run \ --no-check \ -r -f https://deno.land/x/deploy/deployctl.ts ``` -------------------------------- ### Start Runme Agent Server Source: https://github.com/runmedev/runme/blob/main/pkg/agent/README.md Start the Runme Agent server. Access the application at https://localhost:8443. ```bash runme agent serve ``` -------------------------------- ### Start gRPC Server Source: https://context7.com/runmedev/runme/llms.txt Launch the Runme gRPC server with default settings, typically listening on localhost:7863. ```bash runme server ``` -------------------------------- ### Start Development Server Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Starts the development server for the Runme.dev project. This command will watch for file changes and restart the server as needed. ```sh deno task start ``` -------------------------------- ### Install Deno on macOS Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Installs Deno using Homebrew on macOS. Ensure Homebrew is installed first. ```sh # macOS brew bundle --no-lock ``` -------------------------------- ### Start gRPC Server in Development Mode Source: https://context7.com/runmedev/runme/llms.txt Enable development-specific features for the Runme gRPC server. ```bash runme server --dev ``` -------------------------------- ### Install System Dependencies with Brew Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/setup.md Use this command to install necessary system dependencies via Homebrew Bundle. Ensure Homebrew is installed and configured. ```sh $ brew bundle --no-lock ``` -------------------------------- ### Install Development CLI Tools Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Installs essential CLI tools for development, including linters and formatters. This command should be run after cloning the repository. ```shell make install/dev ``` -------------------------------- ### Example .env.example File Source: https://github.com/runmedev/runme/blob/main/internal/owl/README.md Defines environment variables with optional comments indicating their type or expected format. Use this file to specify your environment's structure. ```ini JWT_SECRET=Secret to sign authed JWT tokens # Secret! ANON_KEY=Secret to sign anonymous JWT tokens # Secret! SERVICE_ROLE_KEY=JWT to assume the service role # JWT POSTGRES_PASSWORD=Password for the postgres user # Password! DASHBOARD_USERNAME=Username for the dashboard # Plain! DASHBOARD_PASSWORD=Password for the dashboard # Password! SOME_OTHER_VAR=Needs a matching value # Regex(/^[a-z...a. -]+\.) ``` -------------------------------- ### Run CLI Binary Example Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Demonstrates how to run the compiled runme CLI binary and check its version. Ensure the binary is built before running this command. ```shell ./runme --version ``` -------------------------------- ### Start gRPC Server on Custom Address Source: https://context7.com/runmedev/runme/llms.txt Start the Runme gRPC server and specify a custom network address and port. ```bash runme server --address localhost:9999 ``` -------------------------------- ### Install Runme with NPM Source: https://github.com/runmedev/runme/blob/main/README.md Install Runme globally using NPM for users who prefer NPM for package management. ```sh $ npm install -g runme ``` -------------------------------- ### Install Dev Dependencies Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Installs development dependencies using Homebrew Bundle. Assumes you are in the './api' directory. ```sh brew bundle ``` -------------------------------- ### Example Output Source: https://github.com/runmedev/runme/blob/main/pkg/agent/docs/test_data/testdoc.md This represents a typical output from a command or program. It is shown here for reference. ```text hello, world! ``` -------------------------------- ### Hello World in Go Source: https://github.com/runmedev/runme/blob/main/examples/README.md A simple Go program that prints a greeting. This example shows how to execute Go code snippets. ```go package main import ( "fmt" ) func main() { fmt.Println("Hello from Go, runme!") } ``` -------------------------------- ### Install Runme with Homebrew Source: https://github.com/runmedev/runme/blob/main/README.md Install the latest stable release of Runme on MacOS using Homebrew. ```sh $ brew install runme ``` -------------------------------- ### Install Deno Deploy CLI Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/symbols.md Installs the Deno Deploy CLI with broad permissions. Use this command to manage your Deno Deploy applications. ```sh $ deno install \ --allow-read --allow-write \ --allow-env --allow-net --allow-run \ --no-check \ -r -f https://deno.land/x/deploy/deployctl.ts ``` -------------------------------- ### Run Server in Development Mode Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Start the Runme server in development mode with a predictable address and TLS credentials location. This is useful for local development and debugging. ```sh go run . server --dev --address 127.0.0.1:9999 --tls /tmp/runme/tls 2>&1 ``` -------------------------------- ### Start gRPC Server with UNIX Socket Source: https://context7.com/runmedev/runme/llms.txt Start the Runme gRPC server using a UNIX domain socket for communication. ```bash runme server --address unix:/tmp/runme.sock ``` -------------------------------- ### Deploy Project to Production Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/linesless.md Use this command to deploy your project's main file to production. Ensure you have deployctl installed and configured. ```sh deployctl deploy --project=runme main.ts ``` -------------------------------- ### Run the API Source: https://github.com/runmedev/runme/blob/main/examples/web/index.html Execute the main API script. This command starts the API server, typically listening on port 8080. ```shell echo "Running" go run ./cmd/api/main.go ``` -------------------------------- ### Install macOS Development Dependencies Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Installs required system modules on macOS using Homebrew. Ensure Homebrew is installed and configured. ```shell brew bundle --no-lock ``` -------------------------------- ### Install Goreleaser for Release Management Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Installs the goreleaser tool, which is necessary for managing project releases. ```sh make install/goreleaser ``` -------------------------------- ### Start API with Docker Compose Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Starts the API services using Docker Compose in detached mode. Assumes you are in the './api' directory. ```sh $ docker compose up -d ``` -------------------------------- ### Run Docker Compose Source: https://github.com/runmedev/runme/blob/main/examples/web/index.html Start services defined in the Docker Compose file. This command is used for setting up the development environment. ```shell docker compose up -d ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/runmedev/runme/blob/main/AGENTS.md To utilize the project's pre-commit hooks, you need to install the necessary Python package. This ensures code quality checks are performed before committing. ```bash python3 -m pip install pre-commit ``` -------------------------------- ### Generate Protocol Buffers Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Generate protocol buffers using `make proto/generate`. This command requires the `buf` CLI to be installed. ```sh make proto/generate ``` -------------------------------- ### Run Common Development Commands Source: https://github.com/runmedev/runme/blob/main/CLAUDE.md Use these `runme` commands for key development tasks like building, setting up tools, linting, and testing. Ensure you have the Runme CLI installed. ```bash runme run build # Build CLI binary to ./runme ``` ```bash runme run setup # Install dev tools (gofumpt, revive, etc.) ``` ```bash runme run lint # Run full linting suite ``` ```bash runme run test # Run all tests (unsets env vars, clears cache, builds first) ``` ```bash runme run test-docker # Run tests in Docker (for integration tests with Python/Node) ``` ```bash runme run server-dev # Run server in dev mode on 127.0.0.1:9999 ``` -------------------------------- ### Run API Server Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Runs the API server using Go. Assumes you are in the './api' directory. This command will start listening on port 8080. ```sh $ echo "Running" $ go run ./cmd/api/main.go 2022/05/10 12:18:18 starting to listen on: :8080 ``` -------------------------------- ### Start gRPC Server in Insecure Mode Source: https://context7.com/runmedev/runme/llms.txt Launch the Runme gRPC server without TLS encryption. ```bash runme server --insecure ``` -------------------------------- ### Start gRPC Server with TLS Directory Source: https://context7.com/runmedev/runme/llms.txt Configure the Runme gRPC server to use TLS certificates located in the specified directory. ```bash runme server --tls /path/to/tls ``` -------------------------------- ### Run Basic Echo Command Source: https://github.com/runmedev/runme/blob/main/project/testdata/dir-project/readme.md Executes a simple echo command. This is a basic example of a shell command. ```sh echo "hello" ``` -------------------------------- ### Get help for Runme commands Source: https://github.com/runmedev/runme/blob/main/README.md Access help information for Runme commands, parameters, and configurations using the 'runme help' command. ```sh $ runme help ``` -------------------------------- ### Basic Shell Command Source: https://github.com/runmedev/runme/blob/main/examples/README.md A simple shell command to print a greeting. This is a basic example without any specific annotations. ```shell $ echo "Hello, runme!" ``` -------------------------------- ### Configure Runme Code Block with Attributes Source: https://context7.com/runmedev/runme/llms.txt Example of setting attributes for a Runme code block, including name, language, and interactive mode. ```markdown ```sh { name=build } make build ``` ``` -------------------------------- ### Serialize and Deserialize Markdown with Parser Service Source: https://context7.com/runmedev/runme/llms.txt Utilize the Parser Service to convert markdown to a notebook format and vice-versa. This example shows deserializing markdown into cells and then serializing the notebook back into markdown. ```go package main import ( "context" "fmt" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" parserv1 "github.com/runmedev/runme/v3/api/gen/proto/go/runme/parser/v1" ) func main() { conn, err := grpc.Dial("localhost:7863", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } defer conn.Close() client := parserv1.NewParserServiceClient(conn) ctx := context.Background() markdown := []byte(`# My Document ## Build Build the project: ` + ``` -------------------------------- ### INI Configuration Snippet Source: https://github.com/runmedev/runme/blob/main/examples/README.md An example of an INI file format, often used for configuration. Runme can display snippets even if they are not directly executable code, provided a language hint is given. ```ini [database] username = admin password = admin ``` -------------------------------- ### Run Jaeger Locally Source: https://github.com/runmedev/runme/blob/main/pkg/agent/README.md Start a Jaeger tracing instance using Docker. This provides endpoints for OTLP ingestion and UI access. ```docker docker run --rm --name jaeger \ -p 16686:16686 \ -p 4317:4317 \ -p 4318:4318 \ -p 5778:5778 \ -p 9411:9411 \ jaegertracing/jaeger:2.6.0 ``` -------------------------------- ### Manage Sessions with Runme API v2 in Go Source: https://context7.com/runmedev/runme/llms.txt Demonstrates creating, getting, listing, updating, and deleting sessions using the Runme Service v2 API. Ensure the Runme server is accessible at localhost:7863. ```go package main import ( "context" "fmt" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" runnerv2 "github.com/runmedev/runme/v3/api/gen/proto/go/runme/runner/v2" ) func main() { // Connect to Runme server conn, err := grpc.Dial("localhost:7863", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } defer conn.Close() client := runnerv2.NewRunnerServiceClient(conn) ctx := context.Background() // Create a new session with environment variables createResp, err := client.CreateSession(ctx, &runnerv2.CreateSessionRequest{ Metadata: map[string]string{"client": "example"}, Env: []string{"MY_VAR=value", "DEBUG=true"}, Project: &runnerv2.Project{ Root: "/path/to/project", EnvLoadOrder: []string{'.env', '.env.local'}, }, }) if err != nil { panic(err) } sessionID := createResp.Session.Id fmt.Printf("Created session: %s\n", sessionID) // Get session details getResp, err := client.GetSession(ctx, &runnerv2.GetSessionRequest{ Id: sessionID, }) if err != nil { panic(err) } fmt.Printf("Session env: %v\n", getResp.Session.Env) // List all sessions listResp, err := client.ListSessions(ctx, &runnerv2.ListSessionsRequest{}){ if err != nil { panic(err) } fmt.Printf("Total sessions: %d\n", len(listResp.Sessions)) // Update session _, err = client.UpdateSession(ctx, &runnerv2.UpdateSessionRequest{ Id: sessionID, Env: []string{"NEW_VAR=new_value"}, }) if err != nil { panic(err) } // Delete session when done _, err = client.DeleteSession(ctx, &runnerv2.DeleteSessionRequest{ Id: sessionID, }) if err != nil { panic(err) } } ``` -------------------------------- ### Load Project Tasks with Options Source: https://context7.com/runmedev/runme/llms.txt Use `project.NewDirProject` to create a project instance. Configure options like respecting .gitignore, specifying environment file read order, ignoring specific directories, finding the repository root upwards, and enabling direnv. ```go package main import ( "context" "fmt" "github.com/runmedev/runme/v3/project" ) func main() { // Create a directory-based project with default options proj, err := project.NewDirProject( "./", project.WithRespectGitignore(true), project.WithEnvFilesReadOrder([]string{`.env`, `.env.local`}), project.WithIgnoreFilePatterns("node_modules", ".venv", "vendor"), project.WithFindRepoUpward(), project.WithEnvDirEnv(true), // Enable direnv ) if err != nil { panic(err) } // Load environment variables from .env files envs, err := proj.LoadEnv() if err != nil { panic(err) } fmt.Printf("Loaded %d environment variables\n", len(envs)) // Load env as map with source tracking envWithSource, err := proj.LoadEnvWithSource() if err != nil { panic(err) } for source, vars := range envWithSource { fmt.Printf("From %s: %d vars\n", source, len(vars)) } // Stream project loading events ctx := context.Background() eventc := make(chan project.LoadEvent) go proj.Load(ctx, eventc, false) // false = parse code blocks var tasks []project.Task for event := range eventc { switch event.Type { case project.LoadEventFoundFile: data := project.ExtractDataFromLoadEvent[project.LoadEventFoundFileData](event) fmt.Printf("Found file: %s\n", data.Path) case project.LoadEventFoundTask: data := project.ExtractDataFromLoadEvent[project.LoadEventFoundTaskData](event) tasks = append(tasks, data.Task) fmt.Printf("Found task: %s in %s\n", data.Task.CodeBlock.Name(), data.Task.DocumentPath) case project.LoadEventError: data := project.ExtractDataFromLoadEvent[project.LoadEventErrorData](event) fmt.Printf("Error: %v\n", data.Err) } } fmt.Printf("Total tasks found: %d\n", len(tasks)) } ``` -------------------------------- ### Resolve Program Variables with Runner Service Source: https://context7.com/runmedev/runme/llms.txt Use the ResolveProgram RPC to analyze scripts and resolve environment variables. This example demonstrates setting environment variables and resolving them within a shell script. ```go package main import ( "context" "fmt" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" runnerv2 "github.com/runmedev/runme/v3/api/gen/proto/go/runme/runner/v2" ) func main() { conn, err := grpc.Dial("localhost:7863", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { panic(err) } defer conn.Close() client := runnerv2.NewRunnerServiceClient(conn) ctx := context.Background() // Resolve environment variables in a script resp, err := client.ResolveProgram(ctx, &runnerv2.ResolveProgramRequest{ Source: &runnerv2.ResolveProgramRequest_Script{ Script: ` export API_KEY="${API_KEY:-default_key}" export DB_URL="${DB_URL}" echo "Using $API_KEY" `, }, Mode: runnerv2.ResolveProgramRequest_MODE_PROMPT_ALL, LanguageId: "sh", Env: []string{"API_KEY=my_secret_key"}, SessionStrategy: runnerv2.SessionStrategy_SESSION_STRATEGY_MOST_RECENT, }) if err != nil { panic(err) } fmt.Printf("Resolved script:\n%s\n", resp.Script) for _, v := range resp.Vars { status := "unknown" switch v.Status { case runnerv2.ResolveProgramResponse_STATUS_RESOLVED: status = "resolved" case runnerv2.ResolveProgramResponse_STATUS_UNRESOLVED_WITH_MESSAGE: status = "unresolved (message)" case runnerv2.ResolveProgramResponse_STATUS_UNRESOLVED_WITH_PLACEHOLDER: status = "unresolved (placeholder)" case runnerv2.ResolveProgramResponse_STATUS_UNRESOLVED_WITH_SECRET: status = "unresolved (secret)" } fmt.Printf(" %s: %s -> %s (%s)\n", v.Name, v.OriginalValue, v.ResolvedValue, status) } } ``` -------------------------------- ### Open Project in Browser Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Opens the local development server in the default web browser. Assumes the server is running on http://localhost:8000. ```sh open http://localhost:8000/ ``` -------------------------------- ### List ProjectService Operations Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md Use grpcurl to list all available operations for the runme.project.v1.ProjectService. Ensure TLS certificates and keys are correctly set. ```sh $ grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem $RUNME_SERVER_ADDR list runme.project.v1.ProjectService ``` -------------------------------- ### Runme Code Block Attributes Example Source: https://github.com/runmedev/runme/blob/main/CLAUDE.md Example of a Runme markdown code block with custom attributes like `name` and `interactive`. These attributes control how Runme executes the code. ```markdown ```sh { name=block-name, interactive=false } ``` -------------------------------- ### Load Tasks from a Single File Source: https://context7.com/runmedev/runme/llms.txt Use `project.NewFileProject` to create a project instance for a single file. Configure environment file read order. This is useful for processing tasks within a specific document. ```go package main import ( "context" "fmt" "github.com/runmedev/runme/v3/project" ) func main() { // Create a file-based project for single file proj, err := project.NewFileProject( "./README.md", project.WithEnvFilesReadOrder([]string{`.env`}), ) if err != nil { panic(err) } fmt.Printf("Project root: %s\n", proj.Root()) // Load tasks from the single file ctx := context.Background() eventc := make(chan project.LoadEvent) go proj.Load(ctx, eventc, false) for event := range eventc { if event.Type == project.LoadEventFoundTask { data := project.ExtractDataFromLoadEvent[project.LoadEventFoundTaskData](event) task := data.Task fmt.Printf("Task: %s\n", task.CodeBlock.Name()) fmt.Printf(" Path: %s\n", task.DocumentPath) fmt.Printf(" RelPath: %s\n", task.RelDocumentPath) } } } ``` -------------------------------- ### POST /editor-configs/ Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Inserts editor configurations. All endpoints also implement a GET method to retrieve all collected results. ```APIDOC ## POST /editor-configs/ ### Description Inserts editor configurations. All endpoints also implement a GET method to retrieve all collected results. ### Method POST ### Endpoint /editor-configs/ ### Parameters #### Request Body - **data** (string) - Required - A JSON string representing the editor configuration. ### Request Example ```json { "data": "{\"files.autoSave\": \"afterDelay\"}" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created editor configuration. #### Response Example ```json { "id": "4c7d6fb5-eb53-44f7-8883-80f276af65a1" } ``` ``` -------------------------------- ### Execute Simple Shell Command Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/doublecode.md Demonstrates a basic shell command execution. Use this for simple, single-line commands. ```shell echo "Hello World" ``` -------------------------------- ### Update Homebrew Source: https://github.com/runmedev/runme/blob/main/README.md Update your Homebrew package manager before installing Runme. Ensure your Homebrew is up-to-date to avoid compatibility issues. ```sh $ brew update ``` -------------------------------- ### Build WASM Binary Source: https://github.com/runmedev/runme/blob/main/examples/web/README.md Run this command from the project root to build the Runme WASM binary and copy necessary files to the current directory. ```bash make wasm ``` -------------------------------- ### POST /tasks/ Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Inserts task execution metadata. All endpoints also implement a GET method to retrieve all collected results. ```APIDOC ## POST /tasks/ ### Description Inserts task execution metadata. This endpoint supports POST requests to add new task records. ### Method POST ### Endpoint /tasks/ ### Parameters #### Request Body - **duration** (string) - Required - The duration of the task execution. - **exit_code** (integer) - Required - The exit code of the task. - **name** (string) - Required - The name of the task. - **runbook_name** (string) - Required - The name of the runbook associated with the task. - **runbook_run_id** (string) - Required - The ID of the runbook execution. - **start_time** (string) - Required - The start time of the task in ISO 8601 format. - **command** (string) - Optional - The command executed. - **args** (string) - Optional - The arguments of the command. - **feedback** (string) - Optional - User feedback for the task. - **extra** (string) - Optional - Additional JSON string data. ### Request Example ```json { "duration": "10s", "exit_code": 0, "name": "Run task", "runbook_name": "RB 1", "runbook_run_id": "6e975f1b-0c0f-4765-b24a-2aa87b901c06", "start_time": "2022-05-05T04:12:43Z", "command": "/bin/sh", "args": "echo hello", "feedback": "this is cool!", "extra": "{\"hello\": \"world\"}" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created task. #### Response Example ```json { "id": "6e975f1b-0c0f-4765-b24a-2aa87b901c06" } ``` ``` -------------------------------- ### Build CLI Binary Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Builds the runme CLI binary for the current platform. The executable will be placed in the root directory. Use the -o flag to specify a different output path. ```shell make build ``` -------------------------------- ### Echo Hello World in Bash Source: https://github.com/runmedev/runme/blob/main/pkg/agent/docs/test_data/testdoc.md A simple bash command to print 'Hello, World!' to the console. Useful for basic script testing. ```bash echo "Hello, World!" ``` -------------------------------- ### Build Runme Web Static Assets Source: https://github.com/runmedev/runme/blob/main/pkg/agent/README.md Clone the Runme web repository and build the static assets using the provided runme command. ```sh git clone http://github.com/runmedev/web runme-web cd runme-web runme run setup clean build ``` -------------------------------- ### Run Full Linting Suite Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Executes the entire project's linting suite using pre-commit hooks. This command checks all files in the repository for compliance with coding standards. ```shell pre-commit run --files */** ``` -------------------------------- ### POST /feedback/ Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/happy.md Inserts feedback, optionally associating it with a task ID. All endpoints also implement a GET method to retrieve all collected results. ```APIDOC ## POST /feedback/ ### Description Inserts feedback, optionally associating it with a task ID. All endpoints also implement a GET method to retrieve all collected results. ### Method POST ### Endpoint /feedback/ ### Parameters #### Request Body - **message** (string) - Required - The content of the feedback. - **task_id** (string) - Optional - The ID of the task this feedback is related to. ### Request Example ```json { "message": "My feedback!", "task_id": "6e975f1b-0c0f-4765-b24a-2aa87b901c06" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created feedback entry. #### Response Example ```json { "id": "a02b6b5f-46c4-40ff-8160-ff7d55b8ca6f" } ``` ``` -------------------------------- ### Load Directory Project with ProjectService Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md Load a project from a directory using the ProjectService. Specify the directory path in the request payload and ensure TLS is configured. ```sh $ grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem \ -d "{\"directory\":{\"path\":\".\"}}" $RUNME_SERVER_ADDR runme.project.v1.ProjectService/Load ``` -------------------------------- ### Configure Deno Deployment Environment Source: https://github.com/runmedev/runme/blob/main/internal/renderer/testdata/intro.md Sets environment variables for Deno deployment, including project name and access token. Replace placeholders with actual values. ```sh echo "Set up your deno environment" export DENO_PROJECT_NAME="" export DENO_ACCESS_TOKEN="" ``` -------------------------------- ### Resolve Program Variables Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md Resolve variables within a program definition by sending a JSON payload to the RunnerService. This example uses grpcurl with input redirection from a file and jq for output formatting. ```sh $ cat resolve-program.json | jq . $ echo "👆 request and 👇 response" $ grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem \ -d @ $RUNME_SERVER_ADDR runme.runner.v1.RunnerService/ResolveProgram < resolve-program.json | jq . ``` -------------------------------- ### Load File Project with ProjectService Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md Load a project from a file using the ProjectService. Provide the file path in the request payload and ensure TLS is configured. ```sh $ grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem \ -d "{\"file\":{\"path\":\"./examples/README.md\"}}" $RUNME_SERVER_ADDR runme.project.v1.ProjectService/Load ``` -------------------------------- ### Initialize Runme WASM and Deserialize Notebook Source: https://github.com/runmedev/runme/blob/main/examples/web/index.html Initializes the Go WebAssembly runtime and deserializes a notebook from a Base64 encoded string. This is typically the first step in running a Runme notebook. ```javascript const markdown = b64DecodeUnicode( "IyBUb3J0dWdhIEFQSQoKVGhlIEFQSSBidWlsdCBmb3IgW1RvcnR1Z2EgUHJvdG90eXBlXShodHRwczovL3d3dy5ub3Rpb24uc28vc3RhdGVmdWxocS9Ub3J0dWdhLVByb3RvdHlwZS1jNDA2ZGQ1ZmExYWQ0NTJkYmExNTU2MGE2Y2VhZDVmOSkuCgo+ICoqV2FybmluZyEqKiBBbGwgY29kZSBzbmlwcGV0cyBiZWxvdyBhc3N1bWUgeW91J3JlIGluIHRoZSAqKmAuL2FwaWAqKiBkaXJlY3RvcnkuCgojIyBTdGFydAoKRmlyc3QsIGluc3RhbGwgZGV2IGRlcGVuZGVuY2llczoKCmBgYHNoIHsgbmFtZT1pbnN0YWxsIH0KYnJldyBidW5kbGUKYGBgCgpOZXh0IHJ1biBkZXBlbmRlbmNpZXM6CgpgYGBzaCB7IG5hbWU9ZG9ja2Vy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Im1lc3NhZ2UiOiAiTXkgZmVlZGJhY2shIiwgInRhc2tfaWQiOiAiNmU5NzVmMWItMGMwZi00NzY1LWIyNGEtMmFhODdiOTAxYzA2In0nCnsiaWQiOiJhMDJiNmI1Zi00NmM0LTQwZmYtODE2MC1mZjdkNTViOGNhNmYifQpgYGAKCkZlZWRiYWNrIGNhbiBiZSBwYXRjaGVkOgoKYGBgc2ggeyBuYW1lPXBhdGNoLWZlZWRiYWNrIH0KJCBjdXJsIC1YIFBBVENIIC1IICJDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24iIGxvY2FsaG9zdDo4MDgwL2ZlZWRiYWNrL2EwMmI2YjVmLTQ2YzQtNDBmZi04MTYwLWZmN2Q1NWI4Y2E2Zi8gLWQgJ3sibWVzc2FnZSI6ICJNb2RpZmllZCEifScKeyJpZCI6ImEwMmI2YjVmLTQ2YzQtNDBmZi04MTYwLWZmN2Q1NWI4Y2E2ZiJ9CmBgYAoKIyMjIEVkaXRvciBjb25maWdzCgpJbnNlcnRpbmcgZWRpdG9yIGNvbmZpZ3M6CgpgYGBzaCB7IG5hbWU9cG9zdC1lZGl0b3ItY29uZmlnIH0KJCBjdXJsIC1YUE9TVCAtSCAiQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9qc29uIiBsb2NhbGhvc3Q6ODA4MC9lZGl0b3ItY29uZmlncy8gLWQgJ3siZGF0YSI6ICJ7XCJmaWxlcy5hdXRvU2F2ZVwiOiBcImFmdGVyRGVsYXlcIn0ifScKeyJpZCI6IjRjN2Q2ZmI1LWViNTMtNDRmNy04ODgzLTgwZjI3NmFmNjVhMSJ9CmBgYAo=" ); const go = new Go(); WebAssembly.instantiateStreaming(fetch("runme.wasm"), go.importObject).then(async (obj) => { go.run(obj.instance); let notebook; try { notebook = await Runme.deserialize(mark ``` -------------------------------- ### List Runner Services Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md List all available runner services, specifying the version. This command requires TLS configuration. ```sh export VERSION="v1" # there's also v2 $ grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem $RUNME_SERVER_ADDR list runme.runner.$VERSION.RunnerService ``` -------------------------------- ### Run Linters and Formatters Source: https://github.com/runmedev/runme/blob/main/CONTRIBUTING.md Runs the main linter (revive) and the code formatter (`gofumpt`) for the project. These commands ensure code quality and consistency. ```shell make lint make fmt ``` -------------------------------- ### Basic Go Main Function Source: https://github.com/runmedev/runme/blob/main/pkg/agent/docs/test_data/testdoc.md A standard Go program entry point. This snippet shows the basic structure of a Go application. ```go package main func main() { ... } ``` -------------------------------- ### Hello World in JavaScript Source: https://github.com/runmedev/runme/blob/main/examples/README.md A basic JavaScript snippet that prints 'Hello World!' to the console. This demonstrates executing JavaScript code. ```javascript console.log("Hello World!"); ``` -------------------------------- ### List All Named Code Blocks Source: https://context7.com/runmedev/runme/llms.txt Display all parsed code blocks with their names, descriptions, and initial commands from markdown files in the current directory. ```bash runme list ``` -------------------------------- ### ProjectService - Load Directory Source: https://github.com/runmedev/runme/blob/main/examples/grpc-samples/services.md Loads a project from a specified directory. ```APIDOC ## POST /runme.project.v1.ProjectService/Load (Directory) ### Description Loads a project from a specified directory. ### Method POST ### Endpoint runme.project.v1.ProjectService/Load ### Parameters #### Query Parameters - **server_addr** (string) - Required - The address of the Runme server. - **tls_dir** (string) - Required - The directory containing TLS certificates. #### Request Body - **directory** (object) - Required - Information about the directory to load. - **path** (string) - Required - The path to the directory. ### Request Example ```sh export RUNME_SERVER_ADDR="127.0.0.1:9999" export RUNME_TLS_DIR="/tmp/runme/tls" grpcurl \ -cacert $RUNME_TLS_DIR/cert.pem \ -cert $RUNME_TLS_DIR/cert.pem \ -key $RUNME_TLS_DIR/key.pem \ -d "{\"directory\":{\"path\":\".\"}}" $RUNME_SERVER_ADDR runme.project.v1.ProjectService/Load ``` ### Response #### Success Response (200) - **project** (object) - The loaded project details. ```