Aller au contenu principal

Utility Scripts

14 scripts to install, configure and maintain claude-base

14
Scripts
5
Categories

Overview

The scripts are organized into 5 categories:

CategoryScriptsDescription
Installationnew-project.shInstall the foundation
Maintenanceupdate.sh, diff.sh, uninstall.sh, check-updates.shMaintain the foundation
Diagnosticdoctor.sh, validate.sh, validate-counts.shVerify the installation
Toolside.shIDE configuration
Internallint.sh, test.sh, bump-version.sh, audit-base.sh, export-minimal.shCI and foundation maintenance

Installation Scripts

new-project.sh

Main script to create a new project or configure an existing project.

# Quick install (recommended)
curl -fsSL https://raw.githubusercontent.com/christopherlouet/claude-base/main/scripts/new-project.sh | bash

# Or from the cloned foundation
./scripts/new-project.sh [OPTIONS] [PATH]

Main options:

OptionDescription
-t, --type TYPEProject type (react, vue, node-api, python, go, flutter)
-n, --name NAMEProject name
--cicdInclude CI/CD workflows
--hooksInclude Git hooks
--mcpInclude MCP configuration
--dockerInclude Docker configuration
-y, --yesNon-interactive mode

Example:

# New React project with CI/CD
./scripts/new-project.sh -t react -n my-app --cicd --hooks

# Configure an existing project
cd my-existing-project
./scripts/new-project.sh --cicd --hooks

Features:

  • Automatic project type detection
  • Analysis of existing CI/CD with improvement suggestions
  • Claude Code hooks configuration
  • Dependency installation

Maintenance Scripts

update.sh

Updates commands, agents, skills and rules from the foundation.

# Quick update
curl -fsSL https://raw.githubusercontent.com/christopherlouet/claude-base/main/scripts/update.sh | bash

# Or from the cloned foundation
./scripts/update.sh [OPTIONS] [PATH]

Options:

OptionDescription
-f, --forceForce update (overwrites local changes)
--backupCreate a backup only
--settingsUpdate settings.json
--skillsUpdate skills only
--agentsUpdate agents only
--rulesUpdate rules only
--cleanClean before update
--orphansDetect orphan files
--remove-orphansRemove orphan files

Example:

# Standard update
./scripts/update.sh

# Forced update with cleanup
./scripts/update.sh --force --clean

# Update skills only
./scripts/update.sh --skills

check-updates.sh

Checks for available updates for Claude Code CLI and community skills.

./scripts/check-updates.sh [OPTIONS]

Options:

OptionDescription
--jsonJSON output format
--quietSilent mode (only if updates available)
--forceIgnore cache (24h TTL by default)
--no-cliDo not check Claude Code CLI
--no-skillsDo not check skills.sh
--timeout NNetwork timeout in seconds (default: 10)

Return codes:

CodeMeaning
0Everything is up to date
1Updates available
2Error during check

Example:

# Full check
./scripts/check-updates.sh

# JSON output for CI/CD
./scripts/check-updates.sh --json

# CLI only, no cache
./scripts/check-updates.sh --no-skills --force

diff.sh

Compares the local configuration with the foundation to identify differences.

./scripts/diff.sh [OPTIONS] [PATH]

Options:

OptionDescription
--show newShow only new files
--show modifiedShow only modified files
--show deletedShow only deleted files
--contentShow the content of differences
--no-colorDisable colors

Example:

# See all differences
./scripts/diff.sh

# See only local modifications
./scripts/diff.sh --show modified --content

Output:

📊 Comparison with the claude-base foundation

New files (local): 2
Modified files: 5
Deleted files: 0
Identical files: 98

uninstall.sh

Removes the Claude Code configuration from a project.

./scripts/uninstall.sh [OPTIONS] [PATH]

Options:

OptionDescription
--keep-claude-mdKeep the CLAUDE.md file
--no-backupDo not create a backup
-f, --forceRemove without confirmation
--remove-localAlso remove local files

Example:

# Uninstall with backup (default)
./scripts/uninstall.sh

# Full uninstall
./scripts/uninstall.sh --force --no-backup
attention

By default, a backup is created in .claude-backup-YYYYMMDD-HHMMSS/.


Diagnostic Scripts

doctor.sh

Full diagnostic of the Claude Code environment.

./scripts/doctor.sh [OPTIONS] [PATH]

Options:

OptionDescription
--fixAttempt to fix detected issues
--jsonJSON output format

Checks performed:

CheckDescription
Claude CodeVersion and installation
GitConfiguration and version
Node.jsVersion (if JS/TS project)
.claude folderPresence and permissions
settings.jsonJSON validity
HooksHooks configuration
MCPConfigured MCP servers

Example:

# Full diagnostic
./scripts/doctor.sh

# Diagnostic with automatic fixes
./scripts/doctor.sh --fix

Output:

🏥 Claude Code Diagnostic

✓ Claude Code installed (v1.0.0)
✓ Git configured
✓ Node.js 20.x
✓ .claude folder present
⚠ settings.json: missing hook
✗ MCP: github server not configured

Result: 4 OK, 1 warning, 1 error

validate.sh

Validates the Claude Code configuration and computes a quality score.

./scripts/validate.sh [OPTIONS] [PATH]

Options:

OptionDescription
--jsonJSON output format
--scoreShow only the score

Special actions (used by hooks):

# Protect the main branch
./scripts/validate.sh protect-main

# Auto-format
./scripts/validate.sh auto-format $FILE_PATH

# Type check
./scripts/validate.sh typecheck $FILE_PATH

# Auto-install dependencies
./scripts/validate.sh auto-install $FILE_PATH

# Session message
./scripts/validate.sh session-start

Example:

# Full validation
./scripts/validate.sh

# Score only
./scripts/validate.sh --score
# Output: 85

Tool Scripts

ide.sh

Configures IDEs for optimal integration with claude-base.

./scripts/ide.sh <setup|check|remove> <ide> [OPTIONS] [PATH]

Supported IDEs:

IDECommandGenerated files
VSCodevscodesettings.json, tasks.json, extensions.json, snippets
CursorcursorSame as VSCode
IntelliJidearun configurations, code style, templates
Vim/Neovimvimabbreviations, mappings, autocmds
AllallConfigures all detected IDEs

Commands:

CommandDescription
setupConfigure the IDE
checkVerify the configuration
removeRemove the configuration

Options:

OptionDescription
-n, --dry-runSimulate without modifying
-f, --forceOverwrite existing files

Example:

# Configure VSCode
./scripts/ide.sh setup vscode

# Verify IntelliJ configuration
./scripts/ide.sh check idea

# Remove Vim configuration
./scripts/ide.sh remove vim

# Configure all detected IDEs
./scripts/ide.sh setup all


Internal Scripts

lint.sh

Validates the code quality of the foundation itself (used by CI).

./scripts/lint.sh

test.sh

Runs the foundation's tests (bats tests).

./scripts/test.sh

bump-version.sh

Updates the foundation's version (VERSION, badges, references).

./scripts/bump-version.sh <new-version>

audit-base.sh

Full structural audit: detects orphan files, broken references, inconsistencies between the foundation and the documentation.

./scripts/audit-base.sh

export-minimal.sh

Exports a minimal configuration of the foundation as a .tar.gz archive (or copies directly to a target folder). Used by new-project.sh --minimal for projects that only want a subset of the foundation.

# Default archive (dist/claude-base-minimal.tar.gz)
./scripts/export-minimal.sh

# Archive with custom path
./scripts/export-minimal.sh --output /tmp/claude-base.tar.gz

# Direct copy to a folder (no archive)
./scripts/export-minimal.sh --dest-dir /path/project

The manifest of included files is defined in scripts/lib/minimal-manifest.txt.


Usage with curl

Several scripts can be run directly from GitHub:

# Install
curl -fsSL https://raw.githubusercontent.com/christopherlouet/claude-base/main/scripts/new-project.sh | bash

# Update
curl -fsSL https://raw.githubusercontent.com/christopherlouet/claude-base/main/scripts/update.sh | bash

# With options (requires downloading first)
curl -fsSL https://raw.githubusercontent.com/christopherlouet/claude-base/main/scripts/new-project.sh -o /tmp/new-project.sh
chmod +x /tmp/new-project.sh
/tmp/new-project.sh --cicd --hooks

Summary

ScriptMain usageQuick command
new-project.shCreate/configure a projectcurl ... | bash
update.shUpdatecurl ... | bash
check-updates.shCheck for updates./scripts/check-updates.sh
diff.shCompare with the foundation./scripts/diff.sh
uninstall.shUninstall./scripts/uninstall.sh
doctor.shDiagnose./scripts/doctor.sh --fix
validate.shValidate config./scripts/validate.sh
ide.shConfigure IDEs./scripts/ide.sh setup vscode