- global CLAUDE.md (time tracking via MCP lesstime) - workspace CLAUDE.md (dev_malio inventory) - commands : ticket-writer, push-tickets-lesstime, full-project-review, bump-version - MCP install guide (Code + Desktop) + .mcp.json.example - scripts/install.sh + sync.sh
65 lines
2.1 KiB
Bash
Executable File
65 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# install.sh — Symlink claude-config files into ~/.claude/
|
|
#
|
|
# Idempotent : sauvegarde l'existant puis remplace par des symlinks vers ce repo.
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
CLAUDE_DIR="${HOME}/.claude"
|
|
BACKUP_DIR="${CLAUDE_DIR}/backup-$(date +%Y%m%d-%H%M%S)"
|
|
|
|
echo "→ Repo : ${REPO_DIR}"
|
|
echo "→ Claude config : ${CLAUDE_DIR}"
|
|
echo
|
|
|
|
mkdir -p "${CLAUDE_DIR}/commands"
|
|
|
|
backup_and_link() {
|
|
local src="$1"
|
|
local dst="$2"
|
|
if [[ -e "$dst" && ! -L "$dst" ]]; then
|
|
mkdir -p "$BACKUP_DIR"
|
|
echo " · backup $dst → $BACKUP_DIR/"
|
|
mv "$dst" "$BACKUP_DIR/"
|
|
elif [[ -L "$dst" ]]; then
|
|
rm "$dst"
|
|
fi
|
|
ln -s "$src" "$dst"
|
|
echo " ✓ link $dst → $src"
|
|
}
|
|
|
|
echo "→ Lien : ~/.claude/CLAUDE.md"
|
|
backup_and_link "${REPO_DIR}/global/CLAUDE.md" "${CLAUDE_DIR}/CLAUDE.md"
|
|
|
|
echo
|
|
echo "→ Liens : ~/.claude/commands/*.md"
|
|
for src in "${REPO_DIR}/commands/"*.md; do
|
|
name="$(basename "$src")"
|
|
backup_and_link "$src" "${CLAUDE_DIR}/commands/${name}"
|
|
done
|
|
|
|
echo
|
|
echo "→ Lien : dev_malio/CLAUDE.md (workspace)"
|
|
WORKSPACE_DIR="$(dirname "${REPO_DIR}")"
|
|
backup_and_link "${REPO_DIR}/workspace/CLAUDE.md" "${WORKSPACE_DIR}/CLAUDE.md"
|
|
|
|
echo
|
|
if [[ -d "$BACKUP_DIR" ]]; then
|
|
echo "✓ Backups stockés dans : $BACKUP_DIR"
|
|
fi
|
|
|
|
echo
|
|
echo "═══════════════════════════════════════════════"
|
|
echo "✅ Symlinks installés."
|
|
echo
|
|
echo "Étape manuelle restante — configurer le MCP Lesstime :"
|
|
echo
|
|
echo " 1. Récupère un token API sur http://project.malio-dev.fr/profile"
|
|
echo " 2. cp ${REPO_DIR}/mcp/.mcp.json.example ${CLAUDE_DIR}/.mcp.json"
|
|
echo " 3. Remplace REPLACE_WITH_YOUR_LESSTIME_API_TOKEN dans ${CLAUDE_DIR}/.mcp.json"
|
|
echo " 4. Redémarre Claude Code (/exit puis claude)"
|
|
echo
|
|
echo "Voir ${REPO_DIR}/mcp/INSTALL.md pour Claude Desktop."
|
|
echo "═══════════════════════════════════════════════"
|