### Develop Documentation Site Source: https://github.com/vinilana/dotcontext/blob/main/docs/README.md Navigate to the docs directory, install dependencies, and start the development server for local previewing. ```bash cd docs npm install npm run dev # http://localhost:4321 ``` -------------------------------- ### Dotcontext Hook Install Examples Source: https://github.com/vinilana/dotcontext/blob/main/README.md Examples of installing Dotcontext hooks with different options and for specific hosts. Use --dry-run to preview changes. ```bash npx -y @dotcontext/cli@latest hook install claude-code --dry-run ``` ```bash npx -y @dotcontext/cli@latest hook install codex ``` ```bash npx -y @dotcontext/cli@latest hook install codex --format toml ``` ```bash npx -y @dotcontext/cli@latest hook install pi ``` ```bash npx -y @dotcontext/cli@latest hook install claude-code --global ``` ```bash npx -y @dotcontext/cli@latest hook doctor codex --json ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/vinilana/dotcontext/blob/main/README.md Standard npm commands for setting up the project locally. Run `npm install` to get dependencies, `npm run build` to compile, and `npm test -- --runInBand` to execute tests. ```bash npm install ``` ```bash npm run build ``` ```bash npm test -- --runInBand ``` -------------------------------- ### Prompt AI Tool for Context Initialization Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example prompts to guide an AI tool after setting up Dotcontext via MCP. These commands initiate context, plan tasks, and start the workflow. ```text init the context plan [YOUR TASK] using dotcontext start the workflow ``` ```text init the context plan [SUA TAREFA] using dotcontext start the workflow ``` -------------------------------- ### Install Pi Extension and MCP Adapter using CLI Hook Installer Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-pi.md Use the CLI hook installer to set up Pi instructions and potentially a starter .mcp.json file. This command also installs the Pi extension and the Pi MCP adapter. ```bash npx -y @dotcontext/cli@latest hook install pi pi install npm:@dotcontext/pi pi install npm:pi-mcp-adapter ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md This is the standard configuration written by the MCP installer for AI clients. ```json { "command": "npx", "args": ["-y", "@dotcontext/mcp@latest"], "env": {} } ``` -------------------------------- ### Example: Sync with Preset Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of synchronizing context with a specific preset, such as 'claude'. ```bash npx -y @dotcontext/cli@latest sync --preset claude ``` -------------------------------- ### Initialize a PREVC Workflow Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/quickstart.md Start a PREVC workflow, which includes Plan, Review, Execute, Verify, and Confirm phases. The scale of the task determines which phases are run. This example initializes a workflow for adding a dark theme toggle. ```jsonc // workflow-init { "name": "dark-mode", "description": "Add a user-facing dark theme with persistence" } ``` -------------------------------- ### MCP Server Configuration Example Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md This JSON object represents the standard MCP server entry written by the installer. It includes the command, arguments, and environment variables for running the MCP server. ```json { "command": "npx", "args": ["-y", "@dotcontext/mcp@latest"], "env": {} } ``` -------------------------------- ### Example: Initialize Admin Workflow Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of initializing a new admin workflow with a given feature name. ```bash npx -y @dotcontext/cli@latest admin workflow init "feature-name" ``` -------------------------------- ### Install MCP with Hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-hooks.md Install MCP along with recommended hooks for Claude Code, Codex CLI, or Pi. This command streamlines the setup process. ```bash npx -y @dotcontext/cli@latest mcp:install claude --with-hooks # or npx -y @dotcontext/cli@latest mcp:install codex --with-hooks --hook-format toml # or npx -y @dotcontext/cli@latest mcp:install pi --with-hooks ``` -------------------------------- ### Example: Export Rules with Preset Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of exporting rules with a specific preset, such as 'cursor'. ```bash npx -y @dotcontext/cli@latest export-rules --preset cursor ``` -------------------------------- ### Example: Advance Admin Workflow Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of advancing the state of an admin workflow. ```bash npx -y @dotcontext/cli@latest admin workflow advance ``` -------------------------------- ### Install Dotcontext Hooks Source: https://github.com/vinilana/dotcontext/blob/main/CHANGELOG.md Use these commands to install Dotcontext hooks for various agent hosts. The 'install' command can detect installed hosts, or you can specify a host explicitly. ```bash npx -y @dotcontext/cli@latest hook install ``` ```bash npx -y @dotcontext/cli@latest hook install claude-code ``` ```bash npx -y @dotcontext/cli@latest hook install codex ``` ```bash npx -y @dotcontext/cli@latest hook install pi ``` ```bash npx -y @dotcontext/mcp install pi ``` -------------------------------- ### Install MCP using CLI Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md This command provides an alternative CLI-driven approach to install the MCP installer. ```bash npx -y @dotcontext/cli@latest mcp:install ``` -------------------------------- ### Install specific host hooks with preview Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Installs hooks for a specific host (e.g., claude-code) and previews the changes without applying them. Useful for verifying the installation. ```bash npx -y @dotcontext/cli@latest hook install claude-code --dry-run ``` -------------------------------- ### Clone and Install dotcontext Source: https://github.com/vinilana/dotcontext/blob/main/CONTRIBUTING.md Clone the repository, navigate to the directory, install dependencies, and build the project. Run tests with the `--runInBand` flag for consistent execution. ```bash git clone https://github.com/YOUR_USERNAME/dotcontext.git cd dotcontext npm install npm run build npm test -- --runInBand ``` -------------------------------- ### Install MCP Server with Recommended Hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Install the MCP server and its recommended hooks for supported lifecycle hosts like Codex CLI. ```bash npx -y @dotcontext/cli@latest mcp:install codex --with-hooks ``` -------------------------------- ### Install dotcontext MCP Server Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/quickstart.md Run this command to install the dotcontext MCP server in your AI tool. Ensure your tool is restarted after installation. ```bash npx @dotcontext/mcp install ``` -------------------------------- ### Install MCP Config Interactively Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-the-cli.md Run the MCP install command interactively to detect installed tools and prompt for configuration. This is the default behavior when no tool is specified. ```bash dotcontext mcp:install ``` -------------------------------- ### Preview Hook Installation Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-hooks.md Use the `--dry-run` and `--verbose` flags to preview the changes that would be made during hook installation without writing any files. ```bash npx -y @dotcontext/cli@latest hook install claude-code --dry-run --verbose ``` -------------------------------- ### Install @dotcontext/pi Source: https://github.com/vinilana/dotcontext/blob/main/templates/packages/pi.README.md Installs the @dotcontext/pi package globally using the pi command. ```bash pi install npm:@dotcontext/pi ``` -------------------------------- ### Install MCP with Recommended Hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-the-cli.md Install MCP along with eligible recommended hooks by using the --with-hooks flag. This simplifies setting up complementary functionalities. ```bash dotcontext mcp:install codex --with-hooks ``` -------------------------------- ### Install Claude Code Hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-hooks.md Run this command to install hooks for Claude Code. After installation, restart Claude Code and initiate a new session in a repository with a .context/ directory. ```bash npx -y @dotcontext/cli@latest hook dispatch --source claude-code ``` -------------------------------- ### Install MCP Server Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/mcp-tools.md Installs the MCP server into your AI client. Supports a wide range of AI clients. ```bash npx @dotcontext/mcp install ``` -------------------------------- ### Install MCP Server with TOML Hook Format Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Install the MCP server and hooks, specifying the TOML format for the hook configuration. ```bash npx -y @dotcontext/cli@latest mcp:install codex --with-hooks --hook-format toml ``` -------------------------------- ### Start MCP Server with Custom Repo Path Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/cli-commands.md Starts the MCP server, specifying a custom default repository path for MCP tools. Use when your repository structure differs from the default. ```bash dotcontext mcp --repo-path /path/to/repo ``` -------------------------------- ### Globally Install Dotcontext CLI Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Install the Dotcontext CLI globally to have the 'dotcontext' binary available on your system's PATH. ```bash npm install -g @dotcontext/cli dotcontext ``` -------------------------------- ### Clone and Install Dependencies Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/about/contributing.md Clone the dotcontext repository and install all necessary development dependencies using npm. This prepares your environment for building and testing. ```bash git clone https://github.com/vinilana/dotcontext.git cd dotcontext npm install ``` -------------------------------- ### Run dotcontext CLI on Demand or Globally Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/cli-commands.md Demonstrates how to execute the dotcontext CLI using npx for on-demand execution or after a global npm installation. The on-demand method is useful for running commands without a local installation, while the global installation allows direct binary invocation. ```bash # Run on demand (no install) — opens interactive mode when given no command npx -y @dotcontext/cli@latest # Run a specific command npx -y @dotcontext/cli@latest [options] # Or install globally and call the binary directly npm install -g @dotcontext/cli dotcontext [options] ``` -------------------------------- ### Install MCP Server Only (No Hooks) Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Install only the MCP server, suppressing any prompts or output related to hooks. ```bash npx -y @dotcontext/cli@latest mcp:install codex --no-hooks ``` -------------------------------- ### Start a Cross-Role Collaboration Session Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/cli-commands.md Starts a collaboration session for a specific topic with specified participants. Use the --participants flag to list roles. ```bash dotcontext admin workflow collaborate "code review" --participants implementer reviewer ``` -------------------------------- ### Install MCP Server Locally Source: https://github.com/vinilana/dotcontext/blob/main/README.md Installs the MCP package and configures the Dotcontext MCP server within the current project directory instead of the global home directory. ```bash npx @dotcontext/mcp install cursor --local ``` -------------------------------- ### Install MCP with Codex CLI and Hooks Source: https://github.com/vinilana/dotcontext/blob/main/README.md Installs the MCP for Codex CLI and includes hooks. Use the `--with-hooks` flag to opt-in to hook installation. The `--hook-format toml` option specifies the TOML format for hooks. ```bash npx -y @dotcontext/cli@latest mcp:install codex --with-hooks ``` ```bash npx -y @dotcontext/cli@latest mcp:install codex --with-hooks --hook-format toml ``` -------------------------------- ### Install Dotcontext Pi Extension Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Install the Pi extension and its necessary npm packages. This is for projects using Pi with dotcontext. ```bash npx -y @dotcontext/cli@latest hook install pi pi install npm:@dotcontext/pi ``` -------------------------------- ### Install MCP with hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Install MCP and recommended lifecycle hooks for a client like Codex. Hooks are optional and provide features like session bootstrap and trace logging. ```bash npx -y @dotcontext/cli@latest mcp:install codex --with-hooks ``` -------------------------------- ### Start MCP Server Directly Source: https://github.com/vinilana/dotcontext/blob/main/templates/packages/mcp.README.md Starts the MCP server directly. Use this command to run the MCP server in your current session. ```bash npx -y @dotcontext/mcp@latest ``` -------------------------------- ### Install MCP Configuration with Hooks Source: https://github.com/vinilana/dotcontext/blob/main/README.md Installs MCP configuration and recommended hooks for specific AI tools like Claude Code, Codex CLI, or Pi. ```bash npx -y @dotcontext/cli@latest mcp:install [tool] --with-hooks ``` -------------------------------- ### Install MCP Server Configuration Globally Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/cli-commands.md Installs or updates the MCP server configuration to the global (home) directory. Use this when you want the configuration to apply across all your projects. ```bash dotcontext mcp:install --global ``` -------------------------------- ### Migrate from project-setup Source: https://github.com/vinilana/dotcontext/blob/main/src/mcp/README.md This example shows the migration from the old 'project-setup' tool to the new explicit MCP tool pattern. ```javascript 1. context({ action: "init" }) // Create scaffolding 2. context({ action: "fillSingle", ... }) // Fill each scaffold file that still needs content 3. workflow-init({ name: "my-feature" }) // Start workflow ``` -------------------------------- ### Initialize .context Directory Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/concepts/context-convention.md Use this command to scaffold the .context directory. It's recommended to use the `autoFill: true` option for initial setup. ```javascript context({ action: "init", autoFill: true }) ``` -------------------------------- ### Build and Preview Documentation Site Source: https://github.com/vinilana/dotcontext/blob/main/docs/README.md Build the static site for deployment or preview the built site locally. ```bash npm run build # static site in ./dist npm run preview # serve the built site locally ``` -------------------------------- ### Run Codex hook doctor Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Runs the 'doctor' command for Codex to check its hook setup. This helps diagnose and resolve any issues with the Codex hook installation. ```bash npx -y @dotcontext/cli@latest hook doctor codex ``` -------------------------------- ### Run Documentation Locally Source: https://github.com/vinilana/dotcontext/blob/main/README.md Commands to install dependencies and run the documentation site locally. Assumes you are in the 'docs' directory. ```bash cd docs && npm install && npm run dev ``` -------------------------------- ### Install MCP without hooks Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Use this flag to prevent the installer from prompting for or installing any hooks. ```bash npx -y @dotcontext/cli@latest mcp:install codex --no-hooks ``` -------------------------------- ### Initialize Project Context Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Scaffold the `.context/` directory for a new project. Use `autoFill: true` to pre-populate it with content from the codebase. ```shell context init --autoFill=true ``` -------------------------------- ### Interactive MCP Server Installation Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Drive the MCP installer interactively through the CLI. This command detects installed tools and prompts for configuration. ```bash npx -y @dotcontext/cli@latest mcp:install ``` -------------------------------- ### Install dotcontext hook for Pi Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-hooks.md Use this command to install the dotcontext hook for Pi. This installs an in-process extension rather than a shell hook. ```bash dotcontext hook install pi ``` -------------------------------- ### Install Pi Extension and MCP Components Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-pi.md Install the Pi extension for in-process hooks, the dotcontext MCP configuration for Pi, and the MCP adapter for Pi. These commands set up the necessary components for integrating dotcontext with Pi. ```bash pi install npm:@dotcontext/pi npx @dotcontext/mcp install pi --local pi install npm:pi-mcp-adapter ``` -------------------------------- ### Hook Install CLI Commands Source: https://github.com/vinilana/dotcontext/blob/main/CHANGELOG.md Commands for installing, dispatching, and uninstalling hooks for different AI models. Supports local/global installation and dry runs. ```bash dotcontext hook install dotcontext hook dispatch dotcontext hook uninstall ``` -------------------------------- ### Install dotcontext Hooks Separately Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-hooks.md Install hooks separately if MCP was installed without them or through a different method. This ensures background bootstrap and tracing are active. ```bash npx -y @dotcontext/cli@latest hook install claude-code # or npx -y @dotcontext/cli@latest hook install codex # or npx -y @dotcontext/cli@latest hook install pi ``` -------------------------------- ### Install MCP Config with Scope and Preview Options Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-the-cli.md Use flags like --global, --local, and --dry-run to control the scope and preview the changes before applying them. --dry-run shows what would happen without making changes. ```bash dotcontext mcp:install --global ``` ```bash dotcontext mcp:install --local --dry-run ``` -------------------------------- ### Guide Workflow Steps Source: https://github.com/vinilana/dotcontext/blob/main/src/mcp/README.md Retrieve the next steps, relevant skills, and portable gate hints for the current workflow. ```javascript workflow-guide({ intent: "explicit" }) ``` -------------------------------- ### Simplified Flow Example Source: https://github.com/vinilana/dotcontext/blob/main/src/mcp/README.md Illustrates the sequence of MCP tool usage for scaffolding, content filling, and workflow initiation. ```javascript context({ action: "init" }) └─ Returns: pendingFiles[] └─ For each file: └─ context({ action: "fillSingle", filePath }) └─ Write enhanced content └─ workflow-init({ name: "feature" }) └─ Start development ``` -------------------------------- ### Build Project Source: https://github.com/vinilana/dotcontext/blob/main/README.md Run this command to build the project before configuring local MCP settings. ```bash npm run build ``` -------------------------------- ### Initializing Sensors Configuration Source: https://github.com/vinilana/dotcontext/blob/main/README.md This JavaScript snippet shows how to initialize the sensors configuration by bootstrapping the context with an 'init' action. This process sets up the `.context/config/sensors.json` file for project-specific quality checks. ```javascript context({ action: "init" }) ``` -------------------------------- ### Example: Admin Workflow Status Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of checking the current status of an admin workflow. ```bash npx -y @dotcontext/cli@latest admin workflow status ``` -------------------------------- ### Initialize MCP Scaffolding Source: https://github.com/vinilana/dotcontext/blob/main/src/mcp/README.md Use this command to create the initial .context folder structure, including docs, agents, and skills templates. It returns a list of files that require content. ```javascript context({ action: "init" }) ``` -------------------------------- ### Install hooks for Codex Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Installs hooks for the Codex host. This command directly applies the configuration. ```bash npx -y @dotcontext/cli@latest hook install codex ``` -------------------------------- ### MCP Install Command for Pi Source: https://github.com/vinilana/dotcontext/blob/main/CHANGELOG.md Command to install the MCP for Pi, with options for local or global configuration. ```bash npx @dotcontext/mcp install pi ``` -------------------------------- ### Install MCP for a specific client Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Target a specific AI client, such as Claude, directly with the MCP installer. ```bash npx -y @dotcontext/cli@latest mcp:install claude ``` -------------------------------- ### Initialize Workflow Source: https://github.com/vinilana/dotcontext/blob/main/src/mcp/README.md Use this command to initialize a PREVC workflow, creating the .context/runtime/workflows/ folder, phase tracking, and configuring gates. ```javascript workflow-init({ name: "feature-name" }) ``` -------------------------------- ### Example: Dry Run Reverse Sync Source: https://github.com/vinilana/dotcontext/blob/main/README.md Example of performing a dry run for the reverse synchronization process. ```bash npx -y @dotcontext/cli@latest reverse-sync --dry-run ``` -------------------------------- ### Example Consolidated Tool Call Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/reference/mcp-tools.md This is a typical call to a consolidated MCP tool, demonstrating the required 'action' parameter and optional parameters like 'repoPath' and 'autoFill'. ```json { "action": "init", "repoPath": "/path/to/project", "autoFill": true } ``` -------------------------------- ### Install Lifecycle Hooks Source: https://github.com/vinilana/dotcontext/blob/main/README.md Installs lifecycle hooks for AI tools such as Claude Code, Codex CLI, or Pi. ```bash npx -y @dotcontext/cli@latest hook install [host] ``` -------------------------------- ### Update Global CLI Installation Source: https://github.com/vinilana/dotcontext/blob/main/README.md Commands to uninstall the old @ai-coders/context package and install the new @dotcontext/cli package globally. ```bash npm uninstall -g @ai-coders/context npm install -g @dotcontext/cli ``` -------------------------------- ### Start PREVC Workflow Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/guides/using-with-mcp.md Initiate the PREVC workflow after the project context has been set up. This tool is used once context is in place. ```shell workflow-init --workflowName prevc ``` -------------------------------- ### Install dotcontext CLI hook Source: https://github.com/vinilana/dotcontext/blob/main/docs/src/content/docs/en/getting-started/installation.md Installs the latest version of the dotcontext CLI hook. This is the primary command for setting up hooks. ```bash npx -y @dotcontext/cli@latest hook install ```