Skip to main content

Gjalla CLI — architecture guardrails for AI coding agents

Project description

Gjalla Pre-commit CLI

Pre-commit analysis CLI for validating changes against team rules.

Installation

pip install -e .

Commands

Command Description
init Initialize gjalla in a repository
commit Analyze staged changes before commit
bypass Bypass analysis for a commit
status Show current status
hook Manage git hooks (install/uninstall)
caps Show available capabilities
sync Sync configuration
auth Authentication management
impact Show impact analysis
mcp MCP server mode

User Guide

Initial Setup

  1. Configure API key:

    gjalla init
    
    • Prompts for API key (or set GJALLA_API_KEY env var)
    • Discovers available projects from API
    • Links current repository to a project
  2. Install pre-commit hook (optional):

    gjalla hook install
    

Daily Usage

Automatic (via pre-commit hook):

  • Hook runs gjalla commit automatically on each git commit
  • Blocks commit if violations are found

Manual:

git add <files>
gjalla commit
git commit -m "message"

Analysis Flow

When gjalla commit runs:

  1. Opens WebSocket connection to analysis service
  2. Sends staged changes for analysis
  3. Executes tool calls from the service (file reads, searches)
  4. Displays results: violations, warnings, suggestions
  5. Stores analysis receipt on successful analysis

Reading Output

  • Violations (red): Must fix before commit proceeds
  • Warnings (yellow): Should review, won't block commit
  • Suggestions (blue): Optional improvements
  • Receipt: Analysis ID stored for audit trail

Bypassing Analysis

When you need to skip analysis:

gjalla bypass -m "reason for bypass"
git commit -m "message"

Logs bypass with timestamp and reason.

Checking Status

gjalla status

Shows: project linkage, hook status, last analysis receipt.

Hook Management

gjalla hook install    # Install pre-commit hook
gjalla hook uninstall  # Remove pre-commit hook
gjalla hook status     # Check hook installation

Configuration

Global config: ~/.gjalla/config.yaml

api_key: "your-api-key"
api_url: "https://api.gjalla.io"
projects:
  /path/to/repo: "project-id"

Project config: .gjalla.yaml (in repo root)

  • Project-specific rules and settings

Environment variables:

  • GJALLA_API_KEY - Overrides config file api_key
  • GJALLA_API_URL - Overrides config file api_url

Development Guide

Setup

git clone <repo-url>
cd gjalla-precommit
python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pre-commit install  # Install hooks after cloning

Running Tests

python3 -m pytest tests/ -v

Project Structure

gjalla_precommit/
  cli.py              # Entry point, command group
  commands/           # CLI command implementations
    init.py           # gjalla init
    commit.py         # gjalla commit
    bypass.py         # gjalla bypass
    status.py         # gjalla status
    hook.py           # gjalla hook install/uninstall
    caps.py           # gjalla caps
    sync.py           # gjalla sync
    auth.py           # gjalla auth
    impact.py         # gjalla impact
    mcp.py            # gjalla mcp
  config/             # Configuration management
    settings.py       # Settings loading, config paths
  protocol/           # WebSocket protocol handling
  display/            # Terminal output formatting (rich)
  tools/              # Tool implementations for analysis
tests/                # Test suite

Dependencies

  • click - CLI framework
  • rich - Terminal formatting
  • websockets - WebSocket client
  • gitpython - Git operations
  • pyyaml - Config file parsing
  • pydantic - Settings validation
  • httpx - HTTP client
  • pathspec - Gitignore-style pattern matching

Dev Dependencies

  • pytest - Test runner
  • pytest-asyncio - Async test support

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

gjalla-0.3.5.tar.gz (64.8 kB view details)

Uploaded Source

Built Distribution

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

gjalla-0.3.5-py3-none-any.whl (49.7 kB view details)

Uploaded Python 3

File details

Details for the file gjalla-0.3.5.tar.gz.

File metadata

  • Download URL: gjalla-0.3.5.tar.gz
  • Upload date:
  • Size: 64.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gjalla-0.3.5.tar.gz
Algorithm Hash digest
SHA256 b4a1c56957c0f209b8550ba2afec841c8efbccb814d9d1ba7c205f689a5755b9
MD5 d6434e6f29fe1e303205ae5564f6d653
BLAKE2b-256 f79614b6a786db642d2d8b481d2659ad462933fd3f183f52e352b29ce1397ec5

See more details on using hashes here.

Provenance

The following attestation bundles were made for gjalla-0.3.5.tar.gz:

Publisher: ci-publish.yml on elliemdaw/gjalla-precommit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gjalla-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: gjalla-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gjalla-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ab647bf7eb82f55332028d2a7491d3af9f2498d51b1ff089e80531a8b1814165
MD5 5a1b6a89e8bc146ca7682dc009bb7224
BLAKE2b-256 39e73bf04c5182b9a5e5f4a08d490d3d6174345d3b19c00d660c6bd521565c40

See more details on using hashes here.

Provenance

The following attestation bundles were made for gjalla-0.3.5-py3-none-any.whl:

Publisher: ci-publish.yml on elliemdaw/gjalla-precommit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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