### Install Package
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Provides installation instructions for Packmind packages, guiding the agent to use packmind-cli or render_package.
```APIDOC
## POST /packages/install
### Description
Provides installation instructions for Packmind packages. This endpoint returns guidance that directs the AI agent to either use the `packmind-cli` (if available) or call the `render_package` tool to generate file updates.
### Method
POST
### Endpoint
/packages/install
### Parameters
#### Request Body
- **packageSlug** (string) - Required - The slug of the package to install. Use `list_packages` to find available packages.
- **relativePath** (string) - Required - The target directory where files should be installed (e.g., "/" for project root, "/packages/my-app/" for a monorepo subfolder)
### Request Example
```json
{
"packageSlug": "typescript-best-practices",
"relativePath": "/"
}
```
### Response
#### Success Response (200)
- **instructions** (string) - Step-by-step installation instructions guiding the AI agent.
#### Response Example
{
"instructions": "1. Check if packmind-cli is installed. 2. Use the CLI if available, or call render_package if not."
}
```
--------------------------------
### Form Submission Navigation Example
Source: https://github.com/packmindhub/packmind/blob/main/apps/frontend/NAVIGATION.md
This example demonstrates how to use the `useNavigation()` hook after a successful form submission to navigate the user to a newly created resource. It shows integrating programmatic navigation into an asynchronous operation.
```tsx
import { useNavigation } from '../../shared/hooks/useNavigation';
function CreateStandardForm() {
const nav = useNavigation();
const handleSubmit = async (data) => {
const newStandard = await createStandard(data);
// Navigate to the newly created standard
nav.space.toStandard(newStandard.id);
};
return
;
}
```
--------------------------------
### Install Packmind with Docker Compose
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/gs-install-self-hosted.md
This script automates the setup of Packmind using Docker Compose. It downloads and executes a setup script, creating a `./packmind` directory with the necessary configuration. After execution, Packmind is accessible at http://localhost:8081/. Updates can be performed using 'docker compose pull && docker compose up -d'.
```bash
mkdir packmind && \
cd packmind && \
curl -fsSL -o install.sh https://raw.githubusercontent.com/PackmindHub/packmind/refs/heads/main/dockerfile/prod/setup-packmind-compose.sh && \
chmod +x install.sh && \
./install.sh
```
--------------------------------
### Onboarding Workflows API
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Provides guided workflows for creating coding standards based on different information sources. Useful for initial setup of organizational standards.
```APIDOC
## Onboarding Workflows API
### Description
Provides guided workflows for creating coding standards based on different information sources. This is particularly useful when first setting up standards for your organization.
### Method
GET (Assumed, as it's a tool retrieval)
### Endpoint
`/tools/onboarding` (Assumed)
### Parameters
#### Query Parameters
- **workflow** (string) - Optional - The workflow name to retrieve. Available workflows: `codebase-analysis`, `git-history`, `documentation`, `ai-instructions`, `web-research`. If no workflow is specified, returns a mode selection guide.
### Request Example
```json
{
"tool": "onboarding",
"parameters": {
"workflow": "codebase-analysis"
}
}
```
### Response
#### Success Response (200)
- **workflow_guide** (object) - A structured guide for the selected onboarding workflow.
- **mode_selection** (array) - A list of available workflows if no workflow parameter is provided.
```
--------------------------------
### Bun Installation Script
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
A shell script to install the Bun JavaScript runtime. Fetches the installation script from bun.sh and executes it.
```bash
curl -fsSL https://bun.sh/install | bash
```
--------------------------------
### Use MCP Server Tools with AI Agents (TypeScript)
Source: https://context7.com/packmindhub/packmind/llms.txt
Demonstrates how to use various MCP server tools within an AI agent environment using TypeScript. Includes examples for creating standards, onboarding, installing packages, and listing standards.
```typescript
await mcp.callTool("createStandard", {
name: "API Design Standards",
description: "RESTful API design guidelines",
rules: [
{ content: "Use kebab-case for URL paths" },
{ content: "Version APIs with /v1, /v2 prefixes" }
]
});
```
```typescript
await mcp.callTool("onboarding", {});
// Interactive guided setup of first standards
```
```typescript
await mcp.callTool("installPackage", {
packageSlug: "backend-standards"
});
```
```typescript
const result = await mcp.callTool("listStandards", {});
// Returns all standards with their rules
```
--------------------------------
### Install Packages (Bash)
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Download and install specified packages and their standards into your local project. Multiple package slugs can be provided.
```bash
packmind-cli install [additional-package-slugs...]
packmind-cli install backend frontend
```
--------------------------------
### Install and Use Packmind CLI
Source: https://github.com/packmindhub/packmind/blob/main/README.md
Instructions for installing the Packmind CLI globally and using it to pull packages of standards and commands. Requires an API key for authentication.
```bash
# Install the CLI
npm install -g @packmind/cli
# Get your API key from Packmind: Settings → API Key → Generate Api Key
export PACKMIND_API_KEY_V3="your-api-key"
# Pull your packages
packmind-cli pull --list
packmind-cli pull
```
--------------------------------
### Testing Packmind CLI Executables
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
Examples of how to execute and test the built standalone Packmind CLI executables. This includes running the help command and performing a lint operation on a directory.
```bash
# Test the executable with help command
./dist/apps/cli-executables/packmind-cli-macos-arm64 lint --help
# Run a lint operation on the current directory
./dist/apps/cli-executables/packmind-cli-macos-arm64 lint .
```
--------------------------------
### Install Tree-sitter CLI
Source: https://github.com/packmindhub/packmind/blob/main/packages/linter-ast/res/README.md
Installs the Tree-sitter CLI globally using npm. This is a prerequisite for building WASM files.
```bash
npm i -g tree-sitter-cli
```
--------------------------------
### Install and Authenticate Packmind CLI
Source: https://context7.com/packmindhub/packmind/llms.txt
Installs the Packmind CLI globally using npm and authenticates the user with their Packmind API key. This is a prerequisite for using other CLI commands.
```bash
npm install -g @packmind/cli
```
```bash
export PACKMIND_API_KEY_V3="your_api_key_from_settings"
packmind-cli login
```
--------------------------------
### Add Rule to Standard Workflow Guidance
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Provides step-by-step guidance for adding a new rule to an existing standard. It ensures the rule is well-formed, includes examples, and fits the standard's context. It guides through initial request, drafting, and finalization steps before saving.
```plaintext
create_standard_rule --step initial-request
create_standard_rule --step drafting
create_standard_rule --step finalization
```
--------------------------------
### Basic Setup with SpacesHexa and TypeORM
Source: https://github.com/packmindhub/packmind/blob/main/packages/spaces/README.md
Demonstrates the basic setup for using the SpacesHexa class from @packmind/spaces. It involves initializing a TypeORM DataSource with the necessary entities and then instantiating SpacesHexa with this data source.
```typescript
import { SpacesHexa } from '@packmind/spaces';
import { DataSource } from 'typeorm';
const dataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL,
entities: [...spacesSchemas],
});
const spacesHexa = new SpacesHexa({ dataSource });
```
--------------------------------
### Install Command
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Commands related to installing packages and viewing their status. This includes listing available packages, viewing package details, checking workspace status, installing packages, and performing recursive installs for monorepos.
```APIDOC
## Install Command
### Description
Download commands and standards from packages to your local machine.
### List Available Packages
```bash
packmind-cli install --list
```
### View Package Details
```bash
packmind-cli install --show
```
### View Workspace Status
See an overview of all `packmind.json` files and their installed packages across your workspace:
```bash
packmind-cli install --status
```
**Example output:**
```
Workspace packages status
packmind.json Packages
-----------------------------------------------------------------
./packmind.json generic
./apps/api/packmind.json nestjs
./apps/frontend/packmind.json frontend
3 unique packages currently installed.
```
### Install Packages
```bash
packmind-cli install [additional-package-slugs...]
```
**Example:**
```bash
packmind-cli install backend frontend
```
### Recursive Install (Monorepos)
For monorepos or projects with multiple `packmind.json` files, use the recursive flag to install packages across all locations:
```bash
packmind-cli install -r
```
Or the long form:
```bash
packmind-cli install --recursive
```
```
--------------------------------
### Start Local Development Server with Yarn
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/README.md
Starts a local development server for the Docusaurus project. This command automatically opens the site in a browser and supports live reloading for most changes, facilitating rapid development.
```bash
yarn start
```
--------------------------------
### Basic Setup with TypeORM DataSource
Source: https://github.com/packmindhub/packmind/blob/main/packages/accounts/README.md
Initializes the AccountsHexa class with a TypeORM DataSource. This setup is recommended for integrating with your database, ensuring proper entity mapping and connection management for user and organization data.
```typescript
import { AccountsHexa } from '@packmind/accounts';
import { DataSource } from 'typeorm';
// Initialize with DataSource (recommended)
const dataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL,
entities: [...accountsSchemas],
});
const accountsHexa = new AccountsHexa({ dataSource });
```
--------------------------------
### Get Deployment Overview via API
Source: https://context7.com/packmindhub/packmind/llms.txt
Retrieves an overview of deployment statuses for recipes or standards. This GET request provides information on which recipes have been deployed, to which targets, their status, and the deployment timestamp. The response details the deployment status across different targets.
```bash
curl -X GET https://api.packmind.ai/api/v0/organizations/org_123/deployments/recipes/overview \
-H "Cookie: access_token=your_jwt_token"
```
--------------------------------
### List Available Packages with Packmind CLI
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/gs-distribute.md
This command lists all available packages that can be installed locally. It requires the Packmind CLI to be installed and configured.
```bash
packmind-cli install --list
```
--------------------------------
### Install Project Dependencies with Yarn
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/README.md
Installs all necessary project dependencies using the Yarn package manager. This is typically the first step before running any other project commands.
```bash
yarn
```
--------------------------------
### Run Git Package Tests with Jest
Source: https://github.com/packmindhub/packmind/blob/main/packages/git/README.md
This command executes the tests for the Git package using Jest. Ensure you are in the project's root directory and have nx installed to run this command.
```bash
npx nx test git
```
--------------------------------
### Direct Mode Setup MCP
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Configure the setup-mcp command to target specific agents directly using the --target flag. Multiple agents can be specified, and both long and short forms of the flag are supported.
```APIDOC
## Direct Mode Setup MCP
### Description
Specify target agents directly using the `--target` (or `-t`) flag for the `setup-mcp` command.
### Method
`packmind-cli setup-mcp`
### Endpoint
N/A (CLI Command)
### Parameters
#### Path Parameters
None
#### Query Parameters
- **--target** (string) - Required - The agent to target (e.g., `claude`). Can be specified multiple times.
- **-t** (string) - Required - Short form for `--target`.
### Request Example
```bash
packmind-cli setup-mcp --target claude
packmind-cli setup-mcp --target claude --target cursor
packmind-cli setup-mcp -t claude -t cursor -t copilot
```
### Response
N/A (CLI Command Output)
```
--------------------------------
### Advanced Setup with Custom Services
Source: https://github.com/packmindhub/packmind/blob/main/packages/accounts/README.md
Shows how to set up the AccountsHexa class with custom user and organization services using dependency injection. This advanced configuration allows for greater control and customization of the management logic.
```typescript
import {
UserService,
OrganizationService,
UserRepository,
OrganizationRepository,
} from '@packmind/accounts';
// Custom setup with dependency injection
const userRepo = new UserRepository(dataSource.getRepository(UserSchema));
const orgRepo = new OrganizationRepository(
dataSource.getRepository(OrganizationSchema),
);
const userService = new UserService(userRepo);
const orgService = new OrganizationService(orgRepo);
const accountsHexa = new AccountsHexa({
services: {
userService,
organizationService: orgService,
},
});
```
--------------------------------
### Get Deployment Overview
Source: https://context7.com/packmindhub/packmind/llms.txt
Retrieves an overview of deployment statuses for recipes or standards.
```APIDOC
## Get Deployment Overview
### Description
Retrieves an overview of deployment statuses for recipes or standards.
### Method
GET
### Endpoint
`/api/v0/organizations/{org_id}/deployments/{resource_type}/overview`
### Parameters
#### Path Parameters
- **org_id** (string) - Required - The organization ID.
- **resource_type** (string) - Required - The type of resource to get deployment overview for (e.g., "recipes", "standards").
#### Query Parameters
- **targetId** (string) - Optional - Filter deployments by a specific target ID.
### Request Example
(No request body)
### Response
#### Success Response (200 OK)
Returns a deployment overview object.
#### Response Example
```json
{
"deployments": [
{
"recipeId": "recipe_456",
"recipeName": "Add TypeORM Migration",
"targets": [
{
"targetId": "target_001",
"repositoryName": "backend-api",
"status": "deployed",
"deployedAt": "2025-01-08T10:30:00Z"
}
]
}
]
}
```
```
--------------------------------
### Get Package Details
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Retrieves the full content of a specific package including all its commands and standards.
```APIDOC
## GET /packages/{packageSlug}
### Description
Retrieves the full content of a specific package including all its commands and standards.
### Method
GET
### Endpoint
/packages/{packageSlug}
### Parameters
#### Path Parameters
- **packageSlug** (string) - Required - The slug identifier of the package
### Response
#### Success Response (200)
- **packageName** (string) - The name of the package
- **packageSlug** (string) - The slug of the package
- **packageDescription** (string) - The description of the package
- **commands** (array) - A list of all commands in the package with their summaries
- **standards** (array) - A list of all standards in the package with their summaries
#### Response Example
{
"packageName": "Example Package",
"packageSlug": "example-package",
"packageDescription": "An example package for demonstration.",
"commands": [
{
"name": "example-command",
"summary": "Executes an example command."
}
],
"standards": [
{
"name": "example-standard",
"summary": "Applies an example standard."
}
]
}
```
--------------------------------
### Install Packages via packmind-cli
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/distribution.md
This command-line interface (CLI) tool allows you to install packages directly from your terminal. It fetches specified packages from Packmind, generates instruction files for enabled AI agents, writes these files to your local repository, and notifies Packmind of the distribution. This method is ideal for CI/CD pipelines and local development workflows.
```bash
packmind-cli install
```
```bash
packmind-cli install backend-standards frontend-react
```
--------------------------------
### Create Command Workflow Guidance
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Provides step-by-step guidance for creating a new command, ensuring proper structure, context validation, and usage scenarios. The AI agent progresses through initial request, drafting, and finalization steps automatically.
```plaintext
create_command --step initial-request
create_command --step drafting
create_command --step finalization
```
--------------------------------
### Example Packmind.json File Structure
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/gs-distribute.md
This JSON structure represents the `packmind.json` file, which tracks locally installed packages and their versions. The `"*"` indicates the latest version is used.
```json
{
"packages": {
"backend": "*",
"frontend": "*",
"security": "*"
}
}
```
--------------------------------
### Extract and Run Signed macOS Executable (Bash)
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/MACOS_SIGNING_SETUP.md
This sequence of commands is used to prepare and execute a signed macOS binary. It involves granting execute permissions, bypassing the quarantine attribute (which prompts a security warning), and then running the CLI with a command like 'lint --help'. This is typically done after downloading the artifact from a CI/CD pipeline.
```bash
chmod +x ./packmind-cli-macos-arm64-signed
xattr -d com.apple.quarantine ./packmind-cli-macos-arm64-signed
./packmind-cli-macos-arm64-signed lint --help
```
--------------------------------
### Override Environment Variables with Docker Compose
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/gs-install-self-hosted.md
This example demonstrates how to override environment variables within the `docker-compose.yml` file for Packmind deployments using Docker Compose. It shows how to add the `SMTP_FROM` variable to the `api` service configuration, alongside other predefined configurations like database and Redis settings.
```yaml
api:
image: packmind/api:${PACKMIND_TAG:-latest}
container_name: packmind-api
ports:
- '3000:3000'
environment:
<<: [*database-url, *redis-config, *openai-config]
SMTP_FROM: username@acme.org
```
--------------------------------
### Cross-Platform Building with Bun
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
Demonstrates how to use Bun for cross-compilation to build Packmind CLI executables for different operating systems and architectures from any host platform. This leverages Bun's `build --compile` command.
```bash
# Build for Linux from macOS
bun build --compile --target=bun-linux-x64 apps/cli/src/main.ts --outfile dist/packmind-cli-linux
# Build for Windows from macOS
bun build --compile --target=bun-windows-x64 apps/cli/src/main.ts --outfile dist/packmind-cli-windows.exe
```
--------------------------------
### Install Packages with Packmind CLI
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/gs-distribute.md
This command installs one or more specified packages locally. If it's the first installation, it creates a `packmind.json` file. Subsequent runs without arguments use `packmind.json` for updates.
```bash
packmind-cli install [additional-package-slugs...]
```
--------------------------------
### Initialize GithubProvider with GitHub Token
Source: https://github.com/packmindhub/packmind/blob/main/packages/git/README.md
Initializes the GithubProvider class for interacting with GitHub using a personal access token and a logger instance. This provider is used for broader GitHub operations, such as listing repositories.
```typescript
import { GithubProvider } from '@packmind/git';
// Initialize with a GitHub token
const githubProvider = new GithubProvider('your-github-token', logger);
```
--------------------------------
### Migrating Manual URL Construction to Navigation Utilities
Source: https://github.com/packmindhub/packmind/blob/main/apps/frontend/NAVIGATION.md
Provides a clear before-and-after comparison of migrating from manual URL string concatenation to using the dedicated `navigate` function and `routes` utility. This highlights the benefits of using the provided navigation utilities for cleaner and more maintainable code.
```tsx
// Before:
nativegate(`/org/${orgSlug}/space/${spaceSlug}/recipes`);
Settings;
// After:
nav.space.toRecipes();
Settings;
```
--------------------------------
### Install @packmind/accounts Package
Source: https://github.com/packmindhub/packmind/blob/main/packages/accounts/README.md
Installation command for the @packmind/accounts package using npm. This is the first step to integrate user and organization management into your project.
```bash
npm install @packmind/accounts
```
--------------------------------
### Install @packmind/spaces Package
Source: https://github.com/packmindhub/packmind/blob/main/packages/spaces/README.md
Installs the @packmind/spaces package using npm. This command should be run in your project's terminal to add the package as a dependency.
```bash
npm install @packmind/spaces
```
--------------------------------
### Install Packmind CLI via npm
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Installs the Packmind CLI globally using npm, making the 'packmind-cli' command available system-wide. This is a common method for Node.js users.
```bash
npm install -g @packmind/cli
```
--------------------------------
### Recursive Package Installation for Monorepos (Bash)
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Install packages recursively across all packmind.json files within a monorepo or project with multiple configurations using the -r or --recursive flag.
```bash
packmind-cli install -r
packmind-cli install --recursive
```
--------------------------------
### Repository Implementation and Testing Recipe
Source: https://github.com/packmindhub/packmind/blob/main/packages/AGENTS.md
Provides a pattern for implementing standardized repositories with soft delete functionality and comprehensive tests. This recipe ensures maintainable code and reliable data access patterns within the Packmind codebase. It covers both the implementation of the repository methods and the corresponding test cases.
```typescript
// Example repository implementation (see TypeORM standard for query details)
// Example test implementation using Jest (see Jest standard for patterns)
```
--------------------------------
### View Workspace Package Status (Bash)
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/cli.md
Check the status of installed packages across your entire workspace by running packmind-cli install --status. This command summarizes packmind.json files and their associated packages.
```bash
packmind-cli install --status
```
--------------------------------
### Install Packages Locally via CLI
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/packages-management.md
Installs packages directly to your local machine using the Packmind CLI. This method does not require Git configuration and ensures your AI coding assistant has the latest guidelines.
```bash
packmind-cli install --list
```
```bash
packmind-cli install backend-api frontend-web
```
--------------------------------
### Create New Package Recipe
Source: https://github.com/packmindhub/packmind/blob/main/packages/AGENTS.md
Guides the creation of a new buildable TypeScript package within the Packmind Nx monorepo. It includes setting up TypeScript paths, TypeORM, and Webpack, enabling the package to function as a reusable library. This recipe ensures consistent, type-safe code reuse across applications.
```bash
# Example command to create a new package
npx nx g @nrwl/js:library my-new-package --unitTestRunner=jest --bundler=webpack
# After generation, configure build settings, TypeORM, and tsconfig paths as needed.
```
--------------------------------
### Packmind CLI Basic Commands
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
Essential commands for interacting with the Packmind CLI, including displaying help information and performing linting on directories or specific paths. Includes how to access help for the lint command.
```bash
# Show help
packmind-cli --help
# Lint current directory
packmind-cli lint .
# Lint specific path
packmind-cli lint src/
# Show lint command help
packmind-cli lint --help
```
--------------------------------
### Building Standalone Packmind CLI Executables with Bun
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
Commands for building standalone executables of the Packmind CLI using Bun. This process embeds the Bun runtime and dependencies, allowing the CLI to run without a pre-installed Node.js or Bun environment. Includes options for building for the current platform, specific platforms, and all supported platforms.
```bash
# Build for Current Platform
nx run packmind-cli:build-executable
# or: bun run apps/cli/bun-build.ts
# Build for Linux (x64 + ARM64)
nx build-executable-linux packmind-cli
# Build for macOS (x64 + ARM64)
nx build-executable-macos packmind-cli
# Build for Windows (x64)
nx build-executable-windows packmind-cli
# Build for All Platforms
nx run packmind-cli:build-executable-all
# or: bun run apps/cli/bun-build.ts --target=all
```
--------------------------------
### Error Handling Examples
Source: https://github.com/packmindhub/packmind/blob/main/packages/accounts/README.md
Illustrates how to handle potential errors during user and organization management operations, such as attempting to create a user or organization with a name that already exists. This demonstrates the package's robust error handling capabilities.
```typescript
try {
await accountsHexa.signUpUser('existing-username', 'password', 'org-id');
} catch (error) {
// Error: Username 'existing-username' already exists
}
try {
await accountsHexa.createOrganization('Existing Organization');
} catch (error) {
// Error: Organization name 'Existing Organization' already exists
}
```
--------------------------------
### Running Packmind CLI from Source
Source: https://github.com/packmindhub/packmind/blob/main/apps/cli/README.md
Instructions for installing dependencies and running the Packmind CLI in development mode directly from the source code using npm scripts. This allows for immediate testing of CLI features without a full build process.
```bash
# Install dependencies
npm install
# Run the CLI in development
nx run packmind-cli:run -- lint
# Or use npm script
npm run packmind-cli:v3:lint
```
--------------------------------
### Initialize GithubRepository for GitHub API Interaction
Source: https://github.com/packmindhub/packmind/blob/main/packages/git/README.md
Initializes the GithubRepository class to interact with a specific GitHub repository. Requires a GitHub token and repository details such as owner, repo name, and optionally the branch. It uses the GitHub API for operations.
```typescript
import { GithubRepository } from '@packmind/git';
// Initialize with a GitHub token and repository options
const githubRepo = new GithubRepository('your-github-token', {
owner: 'your-username-or-org',
repo: 'your-repo-name',
branch: 'main', // Optional, defaults to 'main'
});
```
--------------------------------
### Check available npm scripts
Source: https://github.com/packmindhub/packmind/blob/main/packages/linter-ast/res/README.md
Lists all available npm scripts defined in the project's package.json file. This command is useful for identifying custom build scripts, such as those for compiling WASM modules.
```bash
npm run
```
--------------------------------
### Render Package
Source: https://github.com/packmindhub/packmind/blob/main/apps/doc/docs/mcp-server.md
Generates file updates for the AI agent to apply when installing a Packmind package, used when packmind-cli is not available.
```APIDOC
## POST /packages/render
### Description
Generates file updates for the AI agent to apply when installing a Packmind package. This endpoint is called by the AI agent after `install_package` when the `packmind-cli` is not available.
### Method
POST
### Endpoint
/packages/render
### Parameters
#### Request Body
- **packageSlug** (string) - Required - The slug of the package to render. Use `list_packages` to find available packages.
- **installedPackages** (array) - Optional - Array of already installed package slugs from your `packmind.json` file. Read the file and extract the package slugs from the `packages` section to preserve existing installations.
- **relativePath** (string) - Required - The target directory where files should be installed (e.g., "/" for project root, "/packages/my-app/" for a monorepo subfolder)
- **gitRemoteUrl** (string) - Required - The git remote URL of your repository. Run `git remote get-url origin` to obtain it. Use an empty string if unable to retrieve.
- **gitBranch** (string) - Required - The current git branch name. Run `git branch --show-current` to obtain it. Use an empty string if unable to retrieve.
### Request Example
```json
{
"packageSlug": "example-package",
"installedPackages": ["existing-package"],
"relativePath": "/packages/my-app/",
"gitRemoteUrl": "https://github.com/user/repo.git",
"gitBranch": "main"
}
```
### Response
#### Success Response (200)
- **filesToCreateOrUpdate** (object) - An object where keys are file paths and values are their content.
- **filesToDelete** (array) - An array of file paths to delete.
- **sectionUpdates** (object) - Section-based updates for files like `CLAUDE.md`.
#### Response Example
```json
{
"filesToCreateOrUpdate": {
"./src/index.js": "console.log('Hello, world!');"
},
"filesToDelete": [
"./old_file.js"
],
"sectionUpdates": {
"CLAUDE.md": {
"introduction": "## Updated Introduction"
}
}
}
```
```