Skip to main content

DeployVersion

grk

Use GROK API in the terminal, control input, output and profiles.

Features

  • Prompt grok using a combination of file(s) and prompt.
  • Have profiles to use different grok assistants in the same project.
  • Precisely control which files go into grok (contrast with agents).

Installation

Install with uv:

uv pip install https://github.com/wr1/grk.git

Configuration

You can create a .grkrc YAML file in the current directory to set default options. It now supports multiple profiles.

profiles:
    default:
        model: grok-code-fast-1
        role: expert engineer and dev
        output: output.json
        prompt_prepend: " "
        temperature: 0.1  
    law:
        model: grok-4
        role: lawyer, expert legal scholar
        output: output.json
        prompt_prepend: ""
        temperature: 0.15
    docs:
        model: grok-4
        role: documentation-specialist
        output: output.json
        prompt_prepend: "aim for conciseness and documenting use over implementation, "
        temperature: 0.7  
brief:
    file: "design_brief.typ"
    role: "assistant"

Usage

help

Quick start

Using shorthand for fish shell.

# write project brief
echo "write a 3d finite element solver using hex8 elements, use it to model a cube with 10x10x10 elements where x,y,z span range [0,1], clamp z==0 and apply unit distributed surface stress in positive z direction at z==1, output a vtu file where stresses and displacements are added as point data to the mesh, use numpy operations for speed and a logger to print progress to stdout, use user [{name="test",email="test@example.com"}]" > README.md

# fold the project
cf 

# start session
gu codefold.json

# ask to implement
gm "please implement according to README" -o __temp.json

# unfold and install
cu __temp.json ; uv pip install -e . 

# close session
gd

# run code
hex-fem
# INFO:hex_fem.fem:Generating mesh
# INFO:hex_fem.fem:Assembling stiffness
# INFO:hex_fem.fem:Assembling forces
# INFO:hex_fem.fem:Solving system
# INFO:hex_fem.fem:Computing stresses
# INFO:hex_fem.fem:Writing output

output

Single-Shot (One-Off) Commands

grk config init
grk config list
grk single run <input_file> <prompt> [-p <profile>]  # Note: -p is the short form for --profile

Interactive (Session-Based) Commands

grk session up <initial_file> [-p <profile>]
grk session msg <prompt> [-o <output>] [-i <input_file>]
grk session list
grk session down

In session mode, responses are postprocessed: any explanatory messages are printed to the console, and the output file is cleaned to ensure valid JSON in {'files': [...]} format (if possible).

All settings are governed by the specified profile in .grkrc. If no .grkrc exists, it uses the default profile.

Environment Variables

  • XAI_API_KEY: xAI API key (required)

License

MIT

Metadata

Release files for grk-cli 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grk-cli 0.2.3
File Size Uploaded
grk_cli-0.2.3.tar.gz 6.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for grk-cli 0.2.3
File Interpreter ABI Platform
grk_cli-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 MB

Release files / grk_cli-0.2.3.tar.gz

Download URL grk_cli-0.2.3.tar.gz
Size 6.8 MB
Tags Source
SHA-256 checksum
How to use checksums
5f622250b9b48ee3e92c4fb62f290cd7d7ffa3fd214478c337270602d01d64e1
BLAKE2b-256 checksum
How to use checksums
59846e9f1ff09ff4815f150715e716d32d4f8584707c453468079098cac76952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2025.

Transparency log

Release files / grk_cli-0.2.3-py3-none-any.whl

Download URL grk_cli-0.2.3-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcb2ec5597168476936fa145983b5854a0423ded29731ce6dfae2ae1a7a75a3a
BLAKE2b-256 checksum
How to use checksums
076fec4943c4fe07d088852814f7cc3618c55dddc7d226321387188d329a3db6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page