### Install and run FastCtx Source: https://github.com/yc-duan/fastctx/blob/main/packages/fastctx/README.md Global installation and execution of the FastCtx CLI tool. ```console npm install --global fastctx fastctx ``` -------------------------------- ### Install FastCtx via Cargo Source: https://github.com/yc-duan/fastctx/blob/main/README.md Build and install the binary directly from the Rust package registry. ```console cargo install fastctx --locked ``` -------------------------------- ### run_background Source: https://github.com/yc-duan/fastctx/blob/main/README.md Starts a background Bash job and returns a job id immediately. ```APIDOC ## run_background ### Description Starts a background Bash job and returns a job id immediately. It is useful for builds, tests, development servers, and other long-running commands. ``` -------------------------------- ### Execute codex-fastctx via npx Source: https://github.com/yc-duan/fastctx/blob/main/packages/codex-fastctx/README.md Run the compatibility shim directly using npx without a permanent installation. ```console npx codex-fastctx ``` -------------------------------- ### Run FastCtx without global installation Source: https://github.com/yc-duan/fastctx/blob/main/README.md Execute the control terminal as a one-off process using npx. ```console npx fastctx ``` -------------------------------- ### Run development workflow commands Source: https://github.com/yc-duan/fastctx/blob/main/CONTRIBUTING.md Execute these commands to format, lint, and test the project during development. ```console cargo fmt cargo clippy --all-targets cargo test ``` -------------------------------- ### run Source: https://github.com/yc-duan/fastctx/blob/main/README.md Executes a Bash command in the foreground and returns the merged stdout, stderr, and exit code. ```APIDOC ## run ### Description Executes a Bash command in the foreground and returns merged stdout, stderr, and the exit code. It uses Git Bash on Windows and the system Bash on macOS and Linux. ### Parameters - **command** (string) - Required - The Bash command to execute. - **timeout_ms** (integer) - Optional - Timeout in milliseconds for the command execution. ``` -------------------------------- ### Read binary file as hex Source: https://github.com/yc-duan/fastctx/blob/main/README.md Set the view parameter to hex to read binary files. ```json { "file_path": "V:/repo/data/cache.bin", "view": "hex" } ``` -------------------------------- ### Execute a foreground Bash command Source: https://github.com/yc-duan/fastctx/blob/main/README.md Use this JSON structure to define a command and timeout for foreground execution. ```json { "command": "cargo test --quiet 2>&1 | tail -n 40", "timeout_ms": 180000 } ``` -------------------------------- ### Configure FastCtx Approval Mode Source: https://github.com/yc-duan/fastctx/blob/main/README.md Set the default_tools_approval_mode in the MCP server configuration to restrict tool execution. ```toml [mcp_servers.fastctx] default_tools_approval_mode = "writes" ``` -------------------------------- ### Read file content with paging Source: https://github.com/yc-duan/fastctx/blob/main/README.md Use the read tool to retrieve specific lines from a file by specifying the file path, offset, and limit. ```json { "file_path": "V:/repo/src/main.rs", "offset": 120, "limit": 40 } ``` -------------------------------- ### Register FastCtx as an MCP server Source: https://github.com/yc-duan/fastctx/blob/main/README.md Manual configuration for registering the FastCtx MCP server in the Codex configuration file. ```toml [mcp_servers.fastctx] command = "C:/absolute/path/to/fastctx.exe" args = ["serve"] startup_timeout_sec = 120 [features.code_mode] direct_only_tool_namespaces = ["mcp__fastctx"] ``` -------------------------------- ### Perform batch file replacement Source: https://github.com/yc-duan/fastctx/blob/main/README.md Execute mechanical batch replacements across files, using dry_run to preview changes before applying them. ```json { "pattern": "old_name\\(", "replacement": "new_name(", "path": "V:/repo/src", "glob": "**/*.rs", "dry_run": true } ``` -------------------------------- ### Search files with grep Source: https://github.com/yc-duan/fastctx/blob/main/README.md Perform regex searches across a directory using the grep tool with configurable output modes and context. ```json { "pattern": "fn \\w+_lock", "path": "V:/repo/src", "output_mode": "content", "context": 1 } ``` -------------------------------- ### read Source: https://github.com/yc-duan/fastctx/blob/main/README.md Reads text, images, PDFs, and raw bytes from a file. Supports paging, encoding selection, and hex views for binary files. ```APIDOC ## read ### Description Reads content from a file. Supports text, images, PDFs, and binary data. ### Parameters - **file_path** (string) - Required - Path to the file. - **offset** (integer) - Optional - Starting line or byte offset. - **limit** (integer) - Optional - Number of lines or bytes to return. - **encoding** (string) - Optional - Explicit character encoding (e.g., gbk). - **view** (string) - Optional - View mode, e.g., 'hex' for binary files. ``` -------------------------------- ### Enable Bash tools in FastCtx Source: https://github.com/yc-duan/fastctx/blob/main/README.md Adds the shell enablement flag to the FastCtx server arguments. ```toml args = ["serve", "--enable-shell"] ``` -------------------------------- ### Find files with glob Source: https://github.com/yc-duan/fastctx/blob/main/README.md Locate files matching a specific pattern within a repository root, with options to sort by modification time. ```json { "pattern": "**/*.toml", "path": "V:/repo", "sort": "modified" } ``` -------------------------------- ### job_output Source: https://github.com/yc-duan/fastctx/blob/main/README.md Reads new output from a background job and reports its status. ```APIDOC ## job_output ### Description Reads new output from a background job, including jobs started in earlier sessions, and reports 'running', 'exited', or 'interrupted'. ### Parameters - **wait_ms** (integer) - Optional - Enables long polling. - **after_seq** (integer) - Optional - Re-anchors the read position for stable paging. ``` -------------------------------- ### grep Source: https://github.com/yc-duan/fastctx/blob/main/README.md Searches file contents using the Rust regex engine. Supports various output modes and filtering options. ```APIDOC ## grep ### Description Searches for patterns within files or a repository tree. ### Parameters - **pattern** (string) - Required - Regex pattern to search. - **path** (string) - Required - Target directory or file path. - **output_mode** (string) - Optional - 'files_with_matches', 'content', 'count', or 'summary'. - **context** (integer) - Optional - Number of lines of context to include. - **head_limit** (integer) - Optional - Limit for paging results. - **offset** (integer) - Optional - Offset for paging results. ``` -------------------------------- ### Execute non-interactive CLI commands Source: https://github.com/yc-duan/fastctx/blob/main/README.md Perform configuration and management tasks without opening the full-screen terminal. ```console fastctx apply --tier standard --yes fastctx status fastctx jobs fastctx jobs kill j-a1b2c3 fastctx unapply --yes ``` -------------------------------- ### Configure Codex code mode namespace Source: https://github.com/yc-duan/fastctx/blob/main/README.md Sets the FastCtx namespace as a direct top-level namespace for Codex code mode. ```toml [features.code_mode] direct_only_tool_namespaces = ["mcp__fastctx"] ``` -------------------------------- ### glob Source: https://github.com/yc-duan/fastctx/blob/main/README.md Finds files based on path patterns relative to a search root. ```APIDOC ## glob ### Description Finds files matching a specific pattern. ### Parameters - **pattern** (string) - Required - Glob pattern. - **path** (string) - Required - Search root directory. - **sort** (string) - Optional - 'path' or 'modified'. - **filter_mode** (string) - Optional - 'project' or 'all'. - **offset** (integer) - Optional - Paging offset. - **limit** (integer) - Optional - Paging limit. ``` -------------------------------- ### job_list Source: https://github.com/yc-duan/fastctx/blob/main/README.md Lists background jobs based on their status. ```APIDOC ## job_list ### Description Lists background jobs. Defaults to status='running'. ### Parameters - **status** (string) - Optional - Filter by status ('running', 'finished', 'all'). - **offset** (integer) - Optional - Continues a page. - **limit** (integer) - Optional - Overrides the saved page size. ``` -------------------------------- ### replace Source: https://github.com/yc-duan/fastctx/blob/main/README.md Performs mechanical batch replacements across files or a repository tree. ```APIDOC ## replace ### Description Applies deterministic batch replacements to files. ### Parameters - **pattern** (string) - Required - Regex pattern to match. - **replacement** (string) - Required - Replacement text. - **path** (string) - Required - Target directory or file. - **glob** (string) - Optional - Glob pattern to filter files. - **dry_run** (boolean) - Optional - If true, previews changes without writing. - **max_replacements** (integer) - Optional - Cap the number of replacements. ``` -------------------------------- ### job_kill Source: https://github.com/yc-duan/fastctx/blob/main/README.md Stops the selected background job and its full process tree. ```APIDOC ## job_kill ### Description Stops the selected background job and its full process tree. If the job has already exited, the call returns the existing exit status. ``` -------------------------------- ### Read file with explicit encoding Source: https://github.com/yc-duan/fastctx/blob/main/README.md Specify the encoding parameter when the automatic detection fails or is ambiguous. ```json { "file_path": "V:/repo/docs/legacy.txt", "encoding": "gbk" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.