From 61485f91ad2b6ec567dd68317a5d6fc6c0b341ce Mon Sep 17 00:00:00 2001 From: dangnd1 Date: Thu, 5 Mar 2026 00:44:18 +0700 Subject: [PATCH] feat(CLI): Add Antigravity IDE support via `--target antigravity` flag This Pull Request introduces `--target antigravity` support within the installation script to bridge Everything Claude Code configurations smoothly onto the Antigravity IDE ecosystem. - Modified `install.sh` to parse and act on the new `--target antigravity` CLI arg. - **Flattened Rules Conversion**: Logic automatically copies Language-agnostic (Common/Globs) rules as well as specific language stack rules into `common-*.md` and `{lang}-*.md` structures within `.agent/rules/`. - **Workflow & Agent Aggregation**: Commands safely fall in `.agent/workflows/`, and `agents/` alongside `skills/` components are merged into `.agent/skills/`. - Contains overwrite warnings to ensure local customized rules aren't completely overridden without consent. - Minor updates to `README.md` to properly document the flag addition. --- README.md | 7 +++-- install.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 03e9786e..30383dc9 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,8 @@ cd everything-claude-code # ./install.sh typescript python golang # or target cursor: # ./install.sh --target cursor typescript +# or target antigravity: +# ./install.sh --target antigravity typescript ``` For manual install instructions see the README in the `rules/` folder. @@ -180,7 +182,7 @@ For manual install instructions see the README in the `rules/` folder. ## 🌐 Cross-Platform Support -This plugin now fully supports **Windows, macOS, and Linux**. All hooks and scripts have been rewritten in Node.js for maximum compatibility. +This plugin now fully supports **Windows, macOS, and Linux**, alongside tight integration across major IDEs (Cursor, OpenCode, Antigravity) and CLI harnesses. All hooks and scripts have been rewritten in Node.js for maximum compatibility. ### Package Manager Detection @@ -767,12 +769,13 @@ Each component is fully independent.
-Does this work with Cursor / OpenCode / Codex? +Does this work with Cursor / OpenCode / Codex / Antigravity? Yes. ECC is cross-platform: - **Cursor**: Pre-translated configs in `.cursor/`. See [Cursor IDE Support](#cursor-ide-support). - **OpenCode**: Full plugin support in `.opencode/`. See [OpenCode Support](#-opencode-support). - **Codex**: First-class support for both macOS app and CLI, with adapter drift guards and SessionStart fallback. See PR [#257](https://github.com/affaan-m/everything-claude-code/pull/257). +- **Antigravity**: Tightly integrated setup for workflows, skills, and flatten rules in `.agent/`. - **Claude Code**: Native — this is the primary target.
diff --git a/install.sh b/install.sh index dbc2c959..ee7257e6 100755 --- a/install.sh +++ b/install.sh @@ -11,8 +11,9 @@ # ./install.sh --target cursor typescript python golang # # Targets: -# claude (default) — Install rules to ~/.claude/rules/ -# cursor — Install rules, agents, skills, commands, and MCP to ./.cursor/ +# claude (default) — Install rules to ~/.claude/rules/ +# cursor — Install rules, agents, skills, commands, and MCP to ./.cursor/ +# antigravity — Install configs to .agent/ # # This script copies rules into the target directory keeping the common/ and # language-specific subdirectories intact so that: @@ -44,8 +45,8 @@ if [[ "${1:-}" == "--target" ]]; then shift 2 fi -if [[ "$TARGET" != "claude" && "$TARGET" != "cursor" ]]; then - echo "Error: unknown target '$TARGET'. Must be 'claude' or 'cursor'." >&2 +if [[ "$TARGET" != "claude" && "$TARGET" != "cursor" && "$TARGET" != "antigravity" ]]; then + echo "Error: unknown target '$TARGET'. Must be 'claude', 'cursor', or 'antigravity'." >&2 exit 1 fi @@ -54,8 +55,9 @@ if [[ $# -eq 0 ]]; then echo "Usage: $0 [--target ] [ ...]" echo "" echo "Targets:" - echo " claude (default) — Install rules to ~/.claude/rules/" - echo " cursor — Install rules, agents, skills, commands, and MCP to ./.cursor/" + echo " claude (default) — Install rules to ~/.claude/rules/" + echo " cursor — Install rules, agents, skills, commands, and MCP to ./.cursor/" + echo " antigravity — Install configs to .agent/" echo "" echo "Available languages:" for dir in "$RULES_DIR"/*/; do @@ -181,3 +183,64 @@ if [[ "$TARGET" == "cursor" ]]; then echo "Done. Cursor configs installed to $DEST_DIR/" fi + +# --- Antigravity target --- +if [[ "$TARGET" == "antigravity" ]]; then + DEST_DIR=".agent" + + if [[ -d "$DEST_DIR/rules" ]] && [[ "$(ls -A "$DEST_DIR/rules" 2>/dev/null)" ]]; then + echo "Note: $DEST_DIR/rules/ already exists. Existing files will be overwritten." + echo " Back up any local customizations before proceeding." + fi + + # --- Rules --- + echo "Installing common rules -> $DEST_DIR/rules/" + mkdir -p "$DEST_DIR/rules" + if [[ -d "$RULES_DIR/common" ]]; then + for f in "$RULES_DIR/common"/*.md; do + if [[ -f "$f" ]]; then + cp "$f" "$DEST_DIR/rules/common-$(basename "$f")" + fi + done + fi + + for lang in "$@"; do + # Validate language name to prevent path traversal + if [[ ! "$lang" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: invalid language name '$lang'. Only alphanumeric, dash, and underscore allowed." >&2 + continue + fi + lang_dir="$RULES_DIR/$lang" + if [[ ! -d "$lang_dir" ]]; then + echo "Warning: rules/$lang/ does not exist, skipping." >&2 + continue + fi + + echo "Installing $lang rules -> $DEST_DIR/rules/" + for f in "$lang_dir"/*.md; do + if [[ -f "$f" ]]; then + cp "$f" "$DEST_DIR/rules/${lang}-$(basename "$f")" + fi + done + done + + # --- Workflows (Commands) --- + if [[ -d "$SCRIPT_DIR/commands" ]]; then + echo "Installing commands -> $DEST_DIR/workflows/" + mkdir -p "$DEST_DIR/workflows" + cp -r "$SCRIPT_DIR/commands/." "$DEST_DIR/workflows/" + fi + + # --- Skills and Agents --- + mkdir -p "$DEST_DIR/skills" + if [[ -d "$SCRIPT_DIR/agents" ]]; then + echo "Installing agents -> $DEST_DIR/skills/" + cp -r "$SCRIPT_DIR/agents/." "$DEST_DIR/skills/" + fi + if [[ -d "$SCRIPT_DIR/skills" ]]; then + echo "Installing skills -> $DEST_DIR/skills/" + cp -r "$SCRIPT_DIR/skills/." "$DEST_DIR/skills/" + fi + + echo "Done. Antigravity configs installed to $DEST_DIR/" +fi