Taskgist generates a concise, hyphenated "gist" or keyword phrase from a software engineering task description. It uses BoundaryML (BAML) to interact with Google's Gemini Large Language Models (LLMs) for intelligent keyword extraction.
Taskgist is a command-line tool designed to quickly summarize development tasks into a short, memorable, and usable string. This "gist" can be useful for:
- Generating branch names (e.g.,
feature/create-user-auth). - Prefixing commit messages.
- Quick task identifiers in notes or discussions.
The tool processes natural language task descriptions, extracts key actions and terms, and formats them into a hyphenated phrase.
- LLM-powered summarization: Leverages Google's Gemini models via BAML for nuanced keyword extraction.
- Concise output: Generates short, hyphenated phrases focusing on action verbs and essential single-word terms.
- Flexible input: Accepts task descriptions directly as a command-line argument or from a text file.
- BAML integration: Utilizes BAML for defining LLM interactions, data structures, and tests.
- Modern Python tooling: Uses
uvfor fast dependency management andjustfor task running. - CLI interface: Easy to use and integrate into scripts or development workflows.
- You provide a task description (e.g., "Implement user login with two-factor authentication").
- Taskgist uses a BAML function (
ExtractKeywordsdefined insrc/taskgist/baml_src/keywords.baml) to send this description to the configured LLM (currently Google Gemini FlashLite, as defined insrc/taskgist/baml_src/clients.baml). - The BAML function instructs the LLM to extract an action verb and a concise keyword phrase, omitting common articles, prepositions, and pronouns. Each keyword is returned as a single word.
- The LLM returns a structured
KeywordPhraseobject (defined in BAML). - Taskgist processes this object to create a hyphenated string (e.g.,
implement-user-login-two-factor-authentication). - The tool is designed to output only the final generated gist to standard output, making it suitable for piping to other commands. All diagnostic messages, logs, or errors are directed to standard error.
- Python 3.12 or higher.
- A Google AI API key for Gemini models. You will need to set the
GEMINI_API_KEYenvironment variable (see Configuration below). - pip (or uv pip) for installing the package.
- uv: For project and environment management. Follow the installation instructions on their site.
- just: A command runner.
The easiest way to install taskgist is using the pre-compiled wheel file from the latest GitHub release:
-
Download the
.whlfile: Go to the latest release page. Download the.whlfile (e.g.,taskgist-X.Y.Z-py3-none-any.whl) from the "Assets" section. -
Install using pip: Open your terminal and navigate to the directory where you downloaded the file. Then, install it using
pip(oruv pipif you haveuvinstalled and prefer to use it):pip install taskgist-X.Y.Z-py3-none-any.whl
(Replace
taskgist-X.Y.Z-py3-none-any.whlwith the actual filename you downloaded).This will install
taskgistand its dependencies into your Python environment. -
Configure API Key: Proceed to the Configuration section to set up your
GEMINI_API_KEY.
Alternatively, you can install it from within another project via
uv pip install git+https://github.com/ngirard/taskgistIf you want to contribute to taskgist or modify the source code:
-
Clone the repository:
git clone https://github.com/ngirard/taskgist.git cd taskgist -
Set up the environment and install dependencies:
uvwill create a virtual environment (typically.venv) and install all dependencies specified inpyproject.toml, includingtaskgistin editable mode.just sync
Alternatively, you can run the
uvcommands directly:uv venv # Create virtual environment uv sync # Sync dependencies
-
Generate the BAML client: BAML functions are compiled into a Python client. Generate it by running:
just baml-generate
This command is also part of the default
justtask.
Taskgist requires a Google AI API key to interact with the Gemini LLM.
-
Obtain an API key from Google AI Studio.
-
Set the
GEMINI_API_KEYenvironment variable. The recommended way is to create a.envfile in the project root:# .env GEMINI_API_KEY="YOUR_GEMINI_API_KEY_HERE"
Taskgist will automatically load variables from this
.envfile at runtime.
Once installed and configured, you can use the taskgist CLI. Ensure your virtual environment is activated if you're not using just run or uv run.
Basic usage with a string input:
taskgist "Create a new user authentication system with email verification and password reset capabilities"Example output:
create-user-authentication-email-verification-password-reset
Using a file input:
Create a file, for example, my_task.txt, with your task description:
Implement a feature to allow users to upload profile pictures.
The system should support JPG and PNG formats and resize images to a maximum of 500x500 pixels.
Then run taskgist pointing to the file, prefixed with @::
taskgist "@:my_task.txt"Example output:
implement-user-upload-profile-pictures
Running via just:
The justfile provides a convenient way to run the tool with arguments:
just run "Refactor the database schema for better performance"
just run "@:path/to/your/task_description.txt"This project uses just as a command runner and uv for Python packaging and virtual environment management.
Setting up the development environment:
Ensure uv and just are installed. Then, clone the repository and run:
just # This runs sync, baml-generate, and lintCommon development commands (see justfile for details):
just: Default task. Runssync,baml-generate, andlint.just sync: Creates a virtual environment (if needed) and installs/updates dependencies usinguv sync.just baml-generate: Generates the BAML Python client code. This is necessary after any changes to files insrc/taskgist/baml_src/. The generated client is placed insrc/taskgist/baml_client/.just baml-test: Runs tests defined within the BAML files (e.g., inkeywords.baml). This usesbaml-cli test.just lint: Lints the Python code using Ruff.just format: Formats the Python code using Ruff.just build: Builds the Python package (sdist and wheel) into thedist/directory.just run "<task_description>": A wrapper to execute thetaskgistCLI tool with the provided task description.just clean: Removes build artifacts, Python caches, and the generated BAML client directory.just install-editable: Installs the package in editable mode usinguv pip install -e .(usually handled byuv sync).
.
├── src
│ └── taskgist
│ ├── baml_src/ # BAML definitions
│ │ ├── clients.baml # LLM client configurations (e.g., Gemini)
│ │ ├── generators.baml # BAML client generator configuration
│ │ └── keywords.baml # BAML functions, classes, and tests for keyword extraction
│ ├── baml_client/ # Generated BAML Python client (auto-generated, do not edit directly)
│ ├── __init__.py # Package initializer (contains __version__)
│ └── main.py # CLI entrypoint and core Python logic
├── justfile # Command runner recipes using 'just'
├── pyproject.toml # Project metadata, dependencies, and build configuration (PEP 621)
└── README.md # This file
The core LLM interaction logic is defined in the src/taskgist/baml_src/ directory:
clients.baml: Defines the LLM client(s). Currently configured forFlashLite(a Google Gemini model) and specifies how to authenticate (usingGEMINI_API_KEYfrom environment variables).generators.baml: Configures how the BAML Python client code is generated bybaml-cli generate. It specifies the output directory (../, relative tobaml_src/, meaningsrc/taskgist/baml_client/) and the BAML version.keywords.baml:class KeywordPhrase: Defines the expected structured output from the LLM (anactionVerband a list ofphrasestrings).function ExtractKeywords: The main BAML function. It takes ataskDescriptionstring, includes a detailed prompt for the LLM, and specifiesKeywordPhraseas its return type.test ...: Inline test cases for theExtractKeywordsfunction. These can be executed usingjust baml-test.
This project is licensed under the MIT License. See the pyproject.toml file for license information.
Contributions are welcome! If you have suggestions for improvements, new features, or find any bugs, please feel free to:
- Open an issue to discuss the change.
- Fork the repository, make your changes, and submit a pull request.
Please ensure your code adheres to the project's linting and formatting standards (run just lint and just format).