Grit CLI Reference

This document contains the help content for the grit command-line program.

Command Overview:

grit

Software maintenance on autopilot, from grit.io

Usage: grit [OPTIONS] <COMMAND>

For help with a specific command, run grit help <command>.

Subcommands:
  • check — Check the current directory for pattern violations
  • list — List everything that can be applied to the current directory
  • apply — Apply a pattern or migration to a set of files
  • doctor — Print diagnostic information about the current environment
  • auth — Authentication commands, run grit auth --help for more information
  • install — Install supporting binaries
  • init — Install grit modules
  • workflows — Workflow commands, run grit workflows --help for more information
  • patterns — Patterns commands, run grit patterns --help for more information
  • version — Display version information about the CLI and agents
Options:
  • --json — Enable JSON output, only supported on some commands
  • --jsonl — Enable JSONL output, only supported on some commands

grit check

Check the current directory for pattern violations

Usage: grit check [OPTIONS] [PATHS]...

Arguments:
  • <PATHS> — The target paths to apply the checks to

    Default value: .

Options:
  • --fix — Apply fixes to all rewrites
  • --verbose — Show verbose output
  • --level <LEVEL> — Check only patterns at or above an enforcement level
  • --no-cache — Do not use cache
  • --refresh-cache — Clear cache before running check

grit list

List everything that can be applied to the current directory

Usage: grit list [OPTIONS]

Options:
  • --level <LEVEL> — List only at or above an enforcement level

  • --source <SOURCE> — List items from a specific source

    Default value: all

    Possible values:

    • all: All patterns
    • local: Only patterns from the local repo

grit apply

Apply a pattern or migration to a set of files

Usage: grit apply [OPTIONS] <PATTERN_OR_WORKFLOW> [PATHS]...

Arguments:
  • <PATTERN_OR_WORKFLOW> — The pattern to apply, in a few forms:

    • A pattern name (ex. raw_no_console_log)
    • A pattern by itself (ex. '`console.log` => `console.error`')
    • A pattern call, with arguments (ex. 'openai_main(client=openai)')
    • A path to a pattern file (ex. ./patterns/raw_no_console_log.grit)
    • A workflow name (ex. lint)
  • <PATHS>

    Default value: .

Options:
  • --temporal-port <TEMPORAL_PORT> — Existing Temporal port to use (ex. 7233); otherwise, an embedded server is started

  • --input <INPUT> — JSON input parameter to pass to the workflow

  • --verbose — Print verbose output

  • --dry-run — Show a dry-run of the changes that would be applied

    Default value: false

  • --force — Force apply, even if there are uncommitted changes

    Default value: false

  • -i, --interactive — Selectively apply changes interactively

    Default value: false

grit doctor

Print diagnostic information about the current environment

Usage: grit doctor

grit auth

Authentication commands, run grit auth --help for more information

Usage: grit auth <COMMAND>

Subcommands:
  • login — Log in with grit.io
  • logout — Remove your grit.io credentials
  • get-token — Get your grit.io token

grit auth login

Log in with grit.io

Usage: grit auth login

grit auth logout

Remove your grit.io credentials

Usage: grit auth logout

grit auth get-token

Get your grit.io token

Usage: grit auth get-token

grit install

Install supporting binaries

Usage: grit install [OPTIONS]

Options:
  • --update — Look for updates and install them

grit init

Install grit modules

Usage: grit init [OPTIONS]

Options:
  • --global — Update global grit modules

    Default value: false

grit workflows

Workflow commands, run grit workflows --help for more information

Usage: grit workflows <COMMAND>

Subcommands:
  • list — List all available workflows

grit workflows list

List all available workflows

Usage: grit workflows list

grit patterns

Patterns commands, run grit patterns --help for more information

Usage: grit patterns <COMMAND>

Subcommands:
  • list — List all available named patterns
  • test — Test patterns against expected output
  • edit — Edit a pattern in the studio
  • describe — Describe a pattern

grit patterns list

List all available named patterns

Usage: grit patterns list [OPTIONS]

Options:
  • --level <LEVEL> — List only at or above an enforcement level

  • --source <SOURCE> — List items from a specific source

    Default value: all

    Possible values:

    • all: All patterns
    • local: Only patterns from the local repo

grit patterns test

Test patterns against expected output

Usage: grit patterns test [OPTIONS]

Options:
  • --filter <FILTER> — Regex of a specific pattern to test
  • --exclude <EXCLUDE> — Regex of tags to exclude
  • --verbose — Show verbose output
  • --update — Update expected test outputs

grit patterns edit

Edit a pattern in the studio

Usage: grit patterns edit <PATH>

Arguments:
  • <PATH> — The pattern path to edit

grit patterns describe

Describe a pattern

Usage: grit patterns describe <NAME>

Arguments:
  • <NAME> — The pattern name to describe

grit version

Display version information about the CLI and agents

Usage: grit version