Skip to main content

Intent-oriented code review for AI-assisted development

Project description

Clu CLI

Architecture

The CLI now follows a layered layout:

  • src/clu/cli/ contains Click command adapters only.
  • src/clu/lib/ contains feature orchestration and command entrypoints.
  • src/clu/models/ contains flat Pydantic models and enums.
  • src/clu/utils/ contains shared pure helpers.
  • src/clu/api/ contains backend auth and sync clients.
  • src/clu/store/ contains SQLite repositories and the store facade.
  • src/clu/adapter/, src/clu/git.py, and src/clu/transcript.py remain infrastructure-facing modules used by the library layer.

Commands

  1. clu auth
  2. clu install --global (default is in the current directory)
  3. clu append --agent codex/claude/gemini
  4. clu flush

Config path: $HOME/.clu/config.toml -- use this to store any secrets, preferences etc.

Happy Path Flow

  • User does clu auth login -- this opens a web based oauth login
    • After login, the CLI should silently refresh expired access tokens using the stored refresh token.
  • User does clu auth status to verify the current session and test refresh behavior.
  • User does clu install in the project directory, or clu install --global if they want to install it in the gobal config.
    • This asks the user what agent to install it for (TUI style picker)
      • Installing for claude code modifies the .claude/settings.json and installs the clu append command as the hook for all events and all matches (an example for the settings is added below)
      • Hooks Reference for Claude: https://code.claude.com/docs/en/hooks#hook-events
  • The clu append command reads the hook payload from stdin, stores the raw event locally, and incrementally parses transcript messages into SQLite.
  • The clu flush command syncs dirty sessions to /sessions and then bulk-uploads dirty messages to /session-messages in batches.

Eventual Direction

This SQLite file is the local capture layer. The backend correlates the synced session and message data with GitHub PR events later; the CLI no longer builds or submits a final changeset payload itself.

Settings JSON

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PermissionDenied": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PostToolUseFailure": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "SubagentStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "TaskCreated": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "TaskCompleted": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "StopFailure": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "TeammateIdle": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "InstructionsLoaded": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "ConfigChange": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "CwdChanged": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "FileChanged": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "WorktreeCreate": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "WorktreeRemove": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "PostCompact": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "Elicitation": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "ElicitationResult": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/Users/junaidrahim/Code/sandbox/log-hook.sh"
          }
        ]
      }
    ]
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clu_cli-1.17.0.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clu_cli-1.17.0-py3-none-any.whl (49.7 kB view details)

Uploaded Python 3

File details

Details for the file clu_cli-1.17.0.tar.gz.

File metadata

  • Download URL: clu_cli-1.17.0.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for clu_cli-1.17.0.tar.gz
Algorithm Hash digest
SHA256 5dddd55357d922378a4fdaab6495a6130c5bbb4d3b58acf8c1bf98a47556a1fb
MD5 34f6dc88ccd7518fc36532d6ab5949ac
BLAKE2b-256 ab4203890a4e81ad538b66ba9b642ebe6927a372fc79830c91c049b3044c2e64

See more details on using hashes here.

File details

Details for the file clu_cli-1.17.0-py3-none-any.whl.

File metadata

  • Download URL: clu_cli-1.17.0-py3-none-any.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for clu_cli-1.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78994486fb7dade241f69369416c44280fcac60809b27e68f0fb0ab614d4dfac
MD5 015a2a619ae5775f271201a1842f4525
BLAKE2b-256 48f6f921df17abc3e6ef2f51379660ccda9112bae469deae0079613880820a7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page