Grit CLI Reference
This document contains the help content for the grit
command-line program.
Command Overview:
grit
↴grit check
↴grit list
↴grit apply
↴grit doctor
↴grit auth
↴grit auth login
↴grit auth logout
↴grit auth get-token
↴grit install
↴grit init
↴grit workflows
↴grit workflows list
↴grit patterns
↴grit patterns list
↴grit patterns test
↴grit patterns edit
↴grit patterns describe
↴grit version
↴
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 violationslist
— List everything that can be applied to the current directoryapply
— Apply a pattern or migration to a set of filesdoctor
— Print diagnostic information about the current environmentauth
— Authentication commands, rungrit auth --help
for more informationinstall
— Install supporting binariesinit
— Install grit modulesworkflows
— Workflow commands, rungrit workflows --help
for more informationpatterns
— Patterns commands, rungrit patterns --help
for more informationversion
— 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 toDefault 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 sourceDefault value:
all
Possible values:
all
: All patternslocal
: 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
)
- A pattern name (ex.
<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 appliedDefault value:
false
--force
— Force apply, even if there are uncommitted changesDefault value:
false
-i
,--interactive
— Selectively apply changes interactivelyDefault 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.iologout
— Remove your grit.io credentialsget-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 modulesDefault 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 patternstest
— Test patterns against expected outputedit
— Edit a pattern in the studiodescribe
— 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 sourceDefault value:
all
Possible values:
all
: All patternslocal
: 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